Skip to main content
The chatgpt provider calls the Codex backend that ships with a ChatGPT subscription (Plus, Pro, Business, or Enterprise). Usage is billed against the subscription’s quota, not an OpenAI Platform API key. Pair it with the Codex guide to run Codex -> GoModel -> ChatGPT subscription.

Configure

The credential is the access token from your Codex sign-in:
Or in config.yaml:
Run codex login first if ~/.codex/auth.json does not exist yet. GoModel derives the ChatGPT account ID from the token itself, so nothing else is needed.
The token expires roughly every 10 days. Re-export it (the Codex CLI refreshes the file whenever it runs) or run codex login again when requests start returning 401.

Models

The Codex backend has no model-listing endpoint, so GoModel ships the inventory a ChatGPT subscription can call:
Override it when your plan serves a different set:
A model outside the plan’s set is rejected upstream with The '<model>' model is not supported when using Codex with a ChatGPT account. gpt-5.4 and gpt-5.4-mini leave ChatGPT-authenticated Codex on August 31, 2026; use gpt-5.6-terra and gpt-5.6-luna instead. Both stay available to Codex sessions authenticated with an OpenAI API key, through the openai provider.

Responses API only

The Codex backend serves /responses and nothing else, so /v1/chat/completions and /v1/embeddings answer 501 for chatgpt models. Use /v1/responses, which is what Codex sends anyway. The backend also validates against a strict parameter allowlist. GoModel adapts requests rather than failing them, so callers keep using the standard Responses API: Because the backend streams only, a non-streaming POST /v1/responses is served by streaming upstream and returning the final response object. Clients see a normal non-streaming response. See Responses compatibility for how the gateway’s Responses surface behaves across providers.

Prompt caching

The backend keeps one conversation on a warm prefix cache when every turn carries the same session-id header; prompt_cache_key alone gets no cache hits. GoModel sends the detected session as session-id, or the client’s prompt_cache_key when no session is detected, and forwards the key in the body too, as the Codex CLI does. When the client sends no key, the session id stands in for it if it fits the 64-character key limit. If the client sends no key and GoModel detects no session, the backend gets neither signal. Send prompt_cache_key to keep cache hits; a session header such as X-Session-Id also works unless SESSION_KEEPING_ENABLED=false, which turns session detection off. To check hit rates against the real backend, run the opt-in live test:

Reported cost is not real spend

Subscription usage is flat-rate, but these model IDs also exist on the OpenAI Platform, so the model catalog attaches their per-token API prices. Usage records and dashboard totals for chatgpt show a figure that corresponds to no actual charge, and the same collision makes GET /v1/models advertise modes: ["chat", "responses"]. The modes are cosmetic — they drive dashboard grouping, not routing. Pricing is not: it feeds cost tracking, budgets, and cost load balancing.
A budget can therefore reject chatgpt traffic for “spending” money the subscription never charges. Scope budgets to a user path that excludes subscription traffic, or leave budgets off for it. Declaring per-model pricing and modes: ["responses"] in model metadata corrects what /v1/models advertises, but usage records still price at catalog rates. Declare every model you want served: the list replaces the default inventory rather than adding to it.

Limits

Subscription quota is separate from API credit. When it is exhausted the gateway relays a 429:
OpenAI authorizes these tokens for Codex traffic. Use this provider to route your own Codex usage through GoModel, not as a general-purpose inference API.
Last modified on October 7, 2026