Skip to content

Feature: add a separate OpenAI Codex provider for OAuth-specific model limits #3183

Open

Description

@nabilfreeman

Proposal

Add a separate OpenAI Codex provider for models served through ChatGPT/Codex OAuth.

The main openai provider should continue describing direct API access. The Codex provider can inherit shared model metadata with base_model and override the limits that differ on the Codex backend. Harnesses such as OpenCode can then select the correct provider when Codex OAuth is active.

This has moved beyond a one-time client workaround: four current Codex models now have different limits from their direct API definitions.

Evidence

Models Direct OpenAI API Codex OAuth
gpt-5.5 1,050K context / 922K input / 128K output 400K context / 272K input / 128K output
gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna 1,050K context / 922K input / 128K output 500K context / 372K input / 128K output

The Codex values can be independently checked with codex debug models. GPT-5.5 reports 272000; all three GPT-5.6 models report 372000.

Related

Activity

  1. github-actions commented on Jul 10, 2026

    @github-actions
    Contributor

    This issue needs maintainer review, and no automated fix was opened.

    This is a feature/architectural proposal rather than a concrete catalog data fix. The core ask is to create a new provider entity (openai-codex) to represent a distinct serving surface, and the issue itself explicitly defers the design to maintainer preference ("The exact provider ID and integration metadata can follow maintainer preference"). Specifically:

    1. New provider creation is a blocker-level change. Per AGENTS.md, every new provider must ship a compliant providers/<id>/logo.svg, and adding a provider is a structural decision that warrants maintainer sign-off — not something to auto-generate.
    2. It's a policy/product discussion. Whether Codex OAuth warrants a separate provider versus another representation (e.g., a documented limit override mechanism) is a design call, not a factual correction to existing metadata.
    3. The cited limits are not from authoritative provider documentation. The values come from OpenCode's codex debug models CLI output and OpenCode's internal override history, not from OpenAI's first-party API docs or pricing/model pages. They reflect one client's handling rather than a provider-published catalog I can independently verify.

    If a maintainer decides to proceed with a separate openai-codex provider, the follow-up work (provider TOML + logo + base_model-backed model entries with overridden [limit] blocks) would be actionable, but it should be scoped after that decision.

  2. nabilfreeman commented on Jul 10, 2026

    @nabilfreeman
    ContributorAuthor

    @rekram1-node I'd like to hear your thoughts on this. You worked on both the previous GPT-5.5 Codex limit handling and the GPT-5.6 models in models.dev, so your perspective on whether a separate Codex provider is the right long-term approach would be especially useful.

  3. timrichardson commented on Jul 13, 2026

    @timrichardson
    Sponsor

    openai changes the context limits at will to address token consumption problems it seems. Getting this wrong causes grief in opencode if using the plans

  4. jimsimon commented on Aug 6, 2026

    @jimsimon

    I believe this would also allow harnesses that leverage codex (CLI or OAuth) to list "Ultra" as a reasoning_option for models that support it

  5. ngvoicu commented on Nov 9, 2026

    @ngvoicu

    Draft implementation: #13161 (openai-codex, GPT-6.1 Sol and Terra, v2_only, so v1 is unchanged).

    One data point on limits: the 372K/500K values are Codex's client settings (context_window / max_context_window in the Codex model catalog: 500K / 872K for GPT-6.1). The backend itself accepts the API's 922K input on a ChatGPT plan:

    • gpt-6.1-sol: 921,807 accepted, 921,957 rejected (context_too_large);
    • gpt-6.1-terra: 920,870 accepted, 921,875 rejected.

    So the PR keeps the API limits; a working-window default looks like a client setting rather than the model's limit. Happy to change that if you see it differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions