Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Merging this PR will not alter performance1 warning
Comparing |
dm3ch
force-pushed
the
litellm_chatgpt_subscription_passthrough
branch
2 times, most recently
from
October 15, 2026 22:56
e805443 to
89fa601
Compare
Signed-off-by: Dmitry Chepurovskiy <me@dm3ch.net>
Signed-off-by: Dmitry Chepurovskiy <me@dm3ch.net>
dm3ch
force-pushed
the
litellm_chatgpt_subscription_passthrough
branch
from
October 22, 2026 13:44
89fa601 to
fa6f998
Compare
dm3ch
marked this pull request as ready for review
October 22, 2026 14:28
This was referenced Oct 26, 2026
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Developers can use their locally signed-in ChatGPT subscription through LiteLLM without putting an OpenAI API key on the proxy. The client keeps login and token refresh, while a separate LiteLLM key controls gateway access and usage attribution
Details
TLDR
Problem this solves
How it solves it
Intentional product change: passthrough logs and response-header callbacks receive redacted credential headers instead of raw credentials
User Flow
Before, the locally signed-in client cannot send a subscription prompt through the gateway
POST http://localhost:4000/backend-api/codex/responsesand receive404 Not Foundhttp://localhost:4000/ui/?page=logsand find no completed subscription response with token usageAfter, the same client receives a subscription response attributed to its gateway identity
POST http://localhost:4000/backend-api/codex/responsesand receive the streamed answerhttp://localhost:4000/ui/?page=logsto inspect the gateway user, key alias, model, and token usageRelevant issues
Fixes #46062
Pre-Submission checklist
Rebased onto
f2118fc7, preserving #47171 Responses billing, background settlement markers, and resumed-stream model detection. The native subscription routes remain separate from existing API-key-backed OpenAI passthroughAt
fa6f998c,make check BASE_REF=upstream/mainpasses, along with 3,532 selected unit tests and 16 fixed-host TLS integration cases. Compressed HTTP/SSE cases verify model restrictions, usage persistence, and credential isolation. The cancellation case observes reservation release and connection closure while the upstream remains blockedIndependent review caught a decoded gzip response being decoded again when creating a redacted callback copy. Two route regressions reproduced it before the fix and pass afterward. The follow-up review found no remaining issues in that scope
This PR adds no dependencies or decoder. It uses upstream's bounded gzip/zstd middleware from #47418 and its final outbound-header filter rather than adding another relay header switch
At
fa6f998c, external unit, smoke, lint, schema sync, coverage upload, and Codecov patch checks pass. Two checks failNo current-tip Greptile, Veria, or Bugbot reviews are reported. Missing results are not approvals. The PR remains draft and no maintainer review is requested
Screenshots / Proof of Fix
Used interactive Codex CLI 0.163.0 with an existing real ChatGPT sign-in,
gpt-6.1-sol, a separate per-user gateway key, and request compression enabled. Both local proxies used isolated PostgreSQL databases. No mock LLM provider was used. Terminal captures follow the previously approved proof formatBoth runs used this client configuration, with credentials retained only in private client files and the gateway key supplied through the environment
The interactive command was
codex --no-alt-screen -a never -s read-only \ --enable enable_request_compression \ 'Reply exactly LITELLM_SUBSCRIPTION_OK. Do not use tools.'Before (f2118fc)
Interactive subscription prompt
tmux capture-pane -p -S -160 -t pr46684-beforeand observe the failed native requestNative catalog
GET http://127.0.0.1:4000/backend-api/codex/models?client_version=0.163.0with the two separate credentials404and{"detail":"Not Found"}Gateway attribution
After (fa6f998)
Interactive subscription prompt
tmux capture-pane -p -S -160 -t pr46684-afterand observe the real subscription responseNative catalog
200and the nativemodelsarray containing nine models, including the selectedgpt-6.1-solGateway attribution
Type
New Feature
Caveats
Medium
Low
Final Attestation