Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions docs/providers/chatgpt.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "ChatGPT subscription"
description: "Route Responses API traffic through a ChatGPT subscription instead of an OpenAI Platform API key."
description: "Route Responses API traffic — and chat completions translated onto it — through a ChatGPT subscription instead of an OpenAI Platform API key."
icon: "message-circle"
keywords: ["ChatGPT", "Codex", "subscription", "OAuth", "Responses API", "provider setup"]
---
Expand Down Expand Up @@ -62,11 +62,27 @@ is not supported when using Codex with a ChatGPT account`.
Codex sessions authenticated with an OpenAI API key, through the `openai`
provider.

## Responses API only
## Supported surfaces

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 Codex backend serves `/responses` and nothing else. GoModel translates
`/v1/chat/completions` onto it — request, response, and streaming — so chat
clients work too. `/v1/embeddings` still answers `501`: the backend has no
embeddings endpoint.

Chat requests are converted to Responses requests, executed upstream, and
converted back to chat completions. The returned `chatcmpl-` IDs are labels,
not resource handles: GoModel pins `store: false` and drops
`previous_response_id` (the backend allows neither), so no chaining is
possible and chat clients resend full history as usual.

Chat parameters with no Responses equivalent are rejected with a `400` that
names the field, before any upstream call: `n` other than 1, `logit_bias`,
`stop`, `seed`, `frequency_penalty`, `presence_penalty`, `logprobs`,
`top_logprobs`, `modalities`, `audio`, `web_search_options`, and
the deprecated `functions` / `function_call` pair. Zero spellings of
`logprobs`, `top_logprobs`, and the penalties (`false` / `0`) are tolerated:
they change nothing. `prediction` is dropped instead: it is a speed hint and
never changes the answer.

The backend also validates against a strict parameter allowlist. GoModel
adapts requests rather than failing them, so callers keep using the standard
Expand All @@ -79,6 +95,11 @@ Responses API:
| `instructions`, `tools`, `tool_choice`, `parallel_tool_calls`, `reasoning`, `text`, `include` | Forwarded |
| `temperature`, `top_p`, `max_output_tokens`, `previous_response_id`, `truncation`, `metadata`, `user`, `service_tier`, `top_logprobs` | Dropped — unsupported upstream |

Translated chat requests go through the same allowlist: `temperature`,
`top_p`, and `max_tokens` / `max_completion_tokens` map to valid Responses
fields and are then silently dropped upstream, exactly as for native Responses
requests.

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
Expand Down
7 changes: 4 additions & 3 deletions docs/providers/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ support, not every individual model capability exposed by an upstream provider.
| Provider | Credential | Example Model | Chat | `/responses` | Embed | Files | Batches | Passthru | Guide |
| -------- | ---------- | ------------- | :--: | :----------: | :---: | :---: | :-----: | :------: | ----- |
| OpenAI | `OPENAI_API_KEY` | `gpt-5.5` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | — |
| ChatGPT subscription | `CHATGPT_API_KEY` (Codex sign-in token) | `gpt-5.6-sol` | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | [ChatGPT subscription](/providers/chatgpt) |
| ChatGPT subscription | `CHATGPT_API_KEY` (Codex sign-in token) | `gpt-5.6-sol` | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | [ChatGPT subscription](/providers/chatgpt) |
| Anthropic | `ANTHROPIC_API_KEY` | `claude-sonnet-4-20250514` | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | [Anthropic](/providers/anthropic) |
| Cohere | `COHERE_API_KEY` | `command-a-plus-05-2026` | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | [Cohere](/providers/cohere) |
| Google Gemini | `GEMINI_API_KEY` | `gemini-3.7-flash` | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | [Google Gemini](/providers/gemini) |
Expand Down Expand Up @@ -147,8 +147,9 @@ support, not every individual model capability exposed by an upstream provider.
reject requests that omit it (override with
`OPENCODE_GO_DEFAULT_REASONING_EFFORT`). Set `OPENCODE_GO_API_KEY`; the base
URL defaults to `https://opencode.ai/zen/go/v1`.
- **ChatGPT subscription** — serves `/v1/responses` only, billed against the
ChatGPT plan's quota rather than API credit. The upstream accepts a strict
- **ChatGPT subscription** — serves `/v1/responses` and `/v1/chat/completions`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SUGGESTION (style) — already updated by CodeRabbit's outside-diff comment. Re-confirm the merge keeps this version.

(translated onto Responses), billed against the ChatGPT plan's quota rather
than API credit. The upstream accepts a strict
parameter allowlist and streams only; GoModel adapts requests and collapses
the stream for non-streaming callers. Set `CHATGPT_API_KEY` to the access
token from `codex login`. Reported cost is not real spend: these model IDs
Expand Down
Loading
Loading