Use Codex
Run a session on GPT models through your ChatGPT subscription with sc -u codex. You need to be signed in first with sc auth codex.
Do this for me on this machine: run my Claude Code session on Codex, or keep Claude on the main loop and send subagents to Codex, and show me my Codex usage. This is superclaude's own guide. Read all of it as raw Markdown first, without summarizing it: curl -fsSL "https://superclaude.io/docs/codex-usage.md" Then: 1. Tell me in a few lines what you are going to change. 2. Do every step yourself: run the commands, edit the files, check each result. 3. Stop only for what needs me: a browser sign-in, a choice between options, a secret to paste. 4. Finish by showing it works, and tell me the one command I will use from now on. Other superclaude pages, if you need them: https://superclaude.io/llms.txt
-
Launch on Codex
sc -u codex <project> <agent>Claude Code opens with every role answered by a GPT model on your ChatGPT Plus or Pro subscription.
scchecks the profile before Claude Code opens, so a missing sign-in fails there with a message that names the fix (Codex setup covers the sign-in). On this profile your Claude login is not used (what changes). -
Check your Codex usage
sc usage --endpoint codexscprints your plan and each limit window, with percent used and when it resets.
To keep Claude on the main loop and send only subagents to Codex, build a hybrid profile (first fold below).
Claude main loop, Codex subagents
This profile needs the anthropic passthrough endpoint from Anthropic and Claude next to codex:
[profiles.claude-codex]
opus = { slug = "anthropic/opus" }
sonnet = { slug = "codex/gpt-5.4", reasoning = { effort = "high" } }
haiku = { slug = "codex/gpt-5.4", reasoning = { effort = "low" } }sc profiles claude-codex
sc -u claude-codex <project> <agent>The main loop runs on Claude Opus with your login. A subagent that asks for Sonnet or Haiku, and Claude Code’s background requests, go to Codex. A Fable request stays on Claude, because a hybrid leaves an unmapped role on Anthropic. -m sonnet moves the main loop onto Codex too. The recommended walkthrough builds the same shape with DeepSeek and shows how to check the routing.
Pick the model and reasoning effort for the main loop
-m is an alias for Claude Code’s --model. On a gateway profile it picks which row serves the main loop:
sc -u codex <project> <agent> -m sonnetThe gateway sends Codex the effort as reasoning.effort and asks for a reasoning summary, which Claude Code shows as a thinking block (how levels map). A request’s own level wins over the row’s. The Codex backend rejects sampling fields, so the gateway strips temperature and top_p from every Codex request, and a temperature on a Codex row has no effect.
Role inheritance, the fable rule and the row fields are on Profiles.
Read Codex usage and handle a 429
sc usage polls every configured OAuth account through the daemon. For each Codex identity it shows the plan and each limit window, with percent used and when it resets. --json prints the same as JSON; pct_used is the stable field. If the daemon is unreachable, Codex rows show Error rather than disappearing.
The gateway reads each 429 from Codex:
- A throttle with a wait. A
Retry-Afterheader means a short wait. The gateway waits and retries inside its retry budget, 60 seconds by default, and hands a longer wait back to Claude Code. - A spent plan window. Codex sends
usage_limit_reachedwith a reset time and noRetry-After. With two or more identities, the gateway takes that identity out of rotation until the window resets, or for 15 minutes if no reset time came. With one identity it retries with backoff inside the budget, then returns the429withRetry-Afterset to the reset time. - Every identity cooling down. Requests get
429 all keys for this endpoint are rate-limited (cooling down).
Codex rate-limits per ChatGPT account, so a second --label adds headroom only if it signs in a different account. The general key-pool rules are on How the gateway routes.
A Codex launch or request fails
| You see | Do this |
|---|---|
Launch fails: has auth=oauth but no signed-in identities | sc auth codex |
Requests fail: oauth identity <label> for endpoint codex needs sign-in | sc auth codex --label <label> |
429 all keys for this endpoint are rate-limited | Every identity’s window is spent. sc usage --endpoint codex shows the reset time; launch with sc -u direct <project> <agent> meanwhile, which runs that session without the gateway. |
profile <name> defines no fable role | A full-gateway Codex profile got a Fable request. Add a fable row, or pick another model with -m. |
targets endpoint codex, which has no [endpoints.codex] | The endpoint block is still commented out. See Codex setup. |
-i/--incognito is not supported with the hybrid per-role routing profile | Drop -i, or use the full codex profile. |
temperature on a Codex row changes nothing | Codex forbids sampling fields; tune with reasoning instead. |
Next: Anthropic and Claude