Add ChatGPT subscription support and responses bridge - #19030
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| - Ensure the page loads properly on both desktop and mobile | ||
|
|
||
| Exception: If working within an existing website or design system, preserve the established patterns, structure, and visual language. | ||
|
|
There was a problem hiding this comment.
The instructions from codex cli. The endpoint will refuse prompts that do not include these instructions verbatim according to my tests.
There was a problem hiding this comment.
Maybe only a specific subset is required, I didn't do in-depth tests. The api certainly refused requests without instructions and custom instructions.
There was a problem hiding this comment.
AFAIK:
"You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI on a user's computer."
This is all you need :)
| api_key=kwargs.get("api_key"), | ||
| json_mode=kwargs.get("json_mode"), | ||
| ) | ||
| elif not stream: |
There was a problem hiding this comment.
the api only allows stream=true, so this is a component that buffers the streamed output and returns a regular json/http result from it, if the user requests stream=false.
There was a problem hiding this comment.
But we already handle stream=false. for other providers. Can you take a look? I don't think this would be needed
There was a problem hiding this comment.
I didn’t find any other places where stream=False is handled by buffering a streaming iterator. The Responses API path only returns a streaming iterator when stream=True at the request layer, and otherwise does a non‑stream HTTP call that yields a ResponsesAPIResponse directly.
- The core Responses handler only instantiates streaming iterators when stream=True.
- Other Responses configs (OpenAI, Manus) just parse JSON and don’t consume SSE.
- MockResponsesAPIStreamingIterator goes the opposite direction (non‑stream → stream).
So the “buffer stream to JSON” pattern exists only in the ChatGPT Responses config, and I didn’t find other providers doing it.
There was a problem hiding this comment.
ok. one final thing, can you do ruff, mypy and lint checks of all files in the PR? Because we are good to merge then
There was a problem hiding this comment.
-
Ruff: 0/10 errors on changed lines; all 10 are F811s in litellm/utils.py but outside PR hunks at litellm/
utils.py:1188, litellm/utils.py:1347, litellm/utils.py:1917, litellm/utils.py:2978, litellm/utils.py:3784, litellm/
utils.py:4956, litellm/utils.py:5600, litellm/utils.py:7622, litellm/utils.py:8340, litellm/utils.py:8481. -
MyPy: 0/20 errors on changed lines; all are outside PR hunks in untouched files: litellm/passthrough/utils.py:21,
litellm/caching/redis_cache.py:556, litellm/caching/redis_cache.py:556, litellm/caching/redis_cache.py:577, litellm/
caching/redis_cache.py:1170, litellm/caching/redis_cache.py:1173, litellm/caching/redis_cache.py:1175, litellm/
caching/redis_cache.py:1324, litellm/caching/redis_cache.py:1325, litellm/integrations/custom_guardrail.py:553,
litellm/vector_stores/main.py:196, litellm/llms/anthropic/files/handler.py:94, litellm/responses/
litellm_completion_transformation/handler.py:25, litellm/responses/litellm_completion_transformation/handler.py:94,
litellm/llms/custom_httpx/llm_http_handler.py:7058, litellm/main.py:5287, litellm/litellm_core_utils/
token_counter.py:709, litellm/proxy/openai_files_endpoints/storage_backend_service.py:237, litellm/proxy/
openai_files_endpoints/storage_backend_service.py:237, litellm/proxy/agent_endpoints/a2a_endpoints.py:263.lint ran in the pipeline (timed out on the most recent run but was good before)
There was a problem hiding this comment.
@krrishdholakia Feel free to merge it in today's staging branch
| api_key=kwargs.get("api_key"), | ||
| json_mode=kwargs.get("json_mode"), | ||
| ) | ||
| elif not stream: |
There was a problem hiding this comment.
But we already handle stream=false. for other providers. Can you take a look? I don't think this would be needed
29adf34
into
BerriAI:litellm_staging_01_19_2026
* Add ChatGPT subscription support and responses bridge * Fix typing import for responses bridge * Guard device code timestamp parsing * add /v1/messages endpoint to chatgpt model
Relevant issues
implements #18753
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
Changes
Added Chatgpt subscription support with OAuth, model translation, stream caching and docs.