codex-shim can expose subscription-backed models without storing Dashboard
API keys in ~/.codex-shim/models.json:
- ChatGPT/Codex passthrough uses the Codex access token created by
codex loginand forwards native/v1/responsesrequests to ChatGPT's Codex backend. - Cursor/Composer passthrough uses the local
cursor-agentOAuth session created bycursor-agent loginand exposes Composer 2.5 ascomposer-2-5.
Both integrations are optional, auth-gated, and advertised only when the local login state is usable. They are different from BYOK routes: you do not add a Dashboard API key for these subscription flows.
codex-shim doctor
codex-shim list
codex-shim statusUseful health fields:
{
"chatgpt_passthrough": true,
"cursor_passthrough": true
}codex-shim doctor is the safest first diagnostic because it does not start or
stop the daemon, write config, call model providers, or print token contents.
When ~/.codex/auth.json exists and contains tokens.access_token, the shim
adds ChatGPT/Codex model slugs to discovery surfaces such as:
codex-shim list/health/v1/models- the generated
.codex-shim/custom_model_catalog.json
Current fallback slugs include gpt-5.5 and related GPT/Codex slugs. The shim
keeps Codex's native Responses payload shape and forwards it to:
https://chatgpt.com/backend-api/codex/responses
It sends the Codex access token as Authorization: Bearer ... and, when
present, the account id from auth.json. The token is not written into the
custom model catalog.
codex login
codex-shim generate
codex-shim listIf gpt-5.5 appears, you can select it from the Codex picker or run:
codex-shim model use gpt-5.5For passthrough-only use, ~/.codex-shim/models.json may be missing. The shim
can still generate a catalog containing subscription-backed entries when the
Codex auth file is valid.
export CODEX_SHIM_DISABLE_CHATGPT=1After disabling, regenerate or restart the shim if you need discovery surfaces to stop listing ChatGPT passthrough entries immediately.
- Run
codex loginagain ifcodex-shim doctorreports ChatGPT passthrough as unavailable. - Confirm the auth file exists at
~/.codex/auth.json. Do not paste or upload the file; it contains tokens. - If the model picker still does not show GPT/Codex slugs, run
codex-shim generateand checkcodex-shim listbefore debugging Desktop picker behavior. - If
/healthreportschatgpt_passthrough: false, the daemon process may have been started before login or withCODEX_SHIM_DISABLE_CHATGPTset.
When cursor-agent status reports an active login, the shim exposes Composer
2.5 as:
composer-2-5
Requests to that slug are converted into a prompt for cursor-agent --print
using your local CLI OAuth session. This is subscription passthrough, not
Dashboard API-key billing.
cursor-agent login
cursor-agent status
codex-shim generate
codex-shim listThen select Composer 2.5 in the picker or run:
codex-shim model use composer-2-5The helper script is optional, but convenient:
scripts/codex-shim-install-cursor-composerIt regenerates the local catalog/config and sets composer-2-5 as the active
model when cursor-agent status reports an active login.
If cursor-agent is not on PATH, point the shim at it explicitly:
export CURSOR_AGENT_BIN=/path/to/cursor-agentBy default, the cursor-agent child process runs in the current working directory. Override that with:
export CODEX_SHIM_CURSOR_WORKSPACE=/path/to/workspaceexport CODEX_SHIM_DISABLE_CURSOR=1Do not configure Composer through cursor-api.standardagents.ai unless you
intentionally want Dashboard API-key billing (crsr_...). For subscription
passthrough, the shim relies on cursor-agent login instead.
The shim also removes CURSOR_API_KEY from the child cursor-agent environment
so a stale shell variable cannot override your CLI OAuth login.
- The bridge is prompt-based because
cursor-agent --printis a CLI interface, not a native OpenAI/Anthropic provider endpoint. - Image inputs are described/omitted in the prompt bridge rather than forwarded as a native multimodal API payload.
- Tool-call fidelity is lower than native ChatGPT/Codex passthrough or BYOK providers that support structured tool calls directly.
- Run
cursor-agent statusfirst. If it says you are not logged in, runcursor-agent login. - Run
codex-shim doctorand check theCursor passthroughsection. - Check
/health;cursor_passthrough: truemeans the daemon can expose Composer. - If the daemon was already running when you logged in, restart it so discovery endpoints and generated catalog/config are refreshed.
- If
CURSOR_AGENT_BINis set, verify it points to an executablecursor-agentbinary.
- The generated catalog does not contain ChatGPT tokens or Cursor OAuth tokens.
codex-shim doctorreports auth availability and paths, but does not print token contents.- ChatGPT passthrough reads
~/.codex/auth.jsonat request time and forwards the access token only to ChatGPT's Codex backend. - Cursor passthrough spawns
cursor-agentlocally and sends the constructed prompt to that CLI process through stdin. - Do not share
~/.codex/auth.json, shell history containing tokens, or any request dump/log that may contain private prompts.
| Flow | Credential source | Slug examples | Upstream shape |
|---|---|---|---|
| ChatGPT/Codex passthrough | codex login / ~/.codex/auth.json |
gpt-5.5 |
Native Codex Responses backend |
| Cursor/Composer passthrough | cursor-agent login |
composer-2-5 |
cursor-agent --print bridge |
| BYOK OpenAI-compatible | api_key or api_key_env in settings |
your configured slug | /chat/completions |
| BYOK Anthropic-compatible | api_key or api_key_env in settings |
your configured slug | /messages |
Use subscription passthrough when you want to spend subscription quota through the local authenticated CLI. Use BYOK models when you want to route to a provider endpoint and API key you control directly.