Skip to content

Add ChatGPT subscription support and responses bridge - #19030

Merged
5 commits merged into
BerriAI:litellm_staging_01_19_2026from
msexxeta:main
Jan 19, 2026
Merged

Add ChatGPT subscription support and responses bridge#19030
5 commits merged into
BerriAI:litellm_staging_01_19_2026from
msexxeta:main

Conversation

@msexxeta

Copy link
Copy Markdown
Contributor

Relevant issues

implements #18753

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • 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.

@vercel

vercel Bot commented Jan 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
litellm Ready Ready Preview, Comment Jan 15, 2026 10:00am

@CLAassistant

CLAassistant commented Jan 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread provider_endpoints_support.json Outdated
- 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is all this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instructions from codex cli. The endpoint will refuse prompts that do not include these instructions verbatim according to my tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe only a specific subset is required, I didn't do in-depth tests. The api certainly refused requests without instructions and custom instructions.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

Comment thread litellm/model_prices_and_context_window_backup.json
Comment thread litellm/completion_extras/litellm_responses_transformation/handler.py Outdated
api_key=kwargs.get("api_key"),
json_mode=kwargs.get("json_mode"),
)
elif not stream:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we already handle stream=false. for other providers. Can you take a look? I don't think this would be needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krrishdholakia Feel free to merge it in today's staging branch

@Sameerlite Sameerlite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

api_key=kwargs.get("api_key"),
json_mode=kwargs.get("json_mode"),
)
elif not stream:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we already handle stream=false. for other providers. Can you take a look? I don't think this would be needed

@ghost
ghost changed the base branch from main to litellm_staging_01_19_2026 January 19, 2026 13:37
@ghost
ghost merged commit 29adf34 into BerriAI:litellm_staging_01_19_2026 Jan 19, 2026
4 of 6 checks passed
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 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
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants