Codex reads model providers from ~/.codex/config.toml. Add a [model_providers.continuum] table with base_url set to https://continuumcode.ai/v1, env_key set to CONTINUUM_API_KEY, and wire_api set to "responses"; set model_provider = "continuum" and model to a served ID at the top of the file. Export CONTINUUM_API_KEY with a cont_sk_ key created in the Continuum web app under Settings, then Account, then Inference API, then run codex. The one field people get wrong is wire_api: Codex removed the "chat" value in 0.122 and now speaks the Responses API, which the Continuum gateway serves at /v1/responses. Responses are capped at 8,192 output tokens. Personal Continuum API keys are a paid-plan feature: Plus is $25/mo, Max 100 is $100/mo, Max 200 is $200/mo, and Ultra is $500/mo as of August 2026.
- One TOML table does the job:
[model_providers.continuum]withbase_url,env_key, andwire_api. wire_apimust be"responses". Codex dropped the"chat"value in 0.122, and an omitted or wrong value is the top failure mode.- The base URL carries the
/v1:https://continuumcode.ai/v1. Codex appends/responsesitself. env_keynames a variable, it does not hold a key. The value has to be exported in the shell that actually runscodex.- Any served model ID works, including Claude and Gemini names. Codex is the client; it does not care whose model answers.
- Output is capped at 8,192 tokens per response. Agent turns iterate, so long single generations are the only ones that notice.
What the provider block actually changes
Codex treats "which API do I talk to" as configuration rather than as a compiled-in fact. A provider is a named table in ~/.codex/config.toml that says where the endpoint is, which environment variable holds the credential, and which wire protocol to speak. Setting model_provider at the top of the file selects one. Nothing else about the CLI changes: the sandbox, the approval policy, AGENTS.md, and every slash command behave exactly as they did.
What moves and what does not, checked 13 August 2026.
| Surface | Where it runs after the change | Who bills it |
|---|---|---|
| Every Codex turn | Continuum’s inference API | Your Continuum plan |
| Sandbox and approvals | Locally, unchanged | Nobody; they are local policy |
| Your ChatGPT sign-in | Untouched, and unused while this provider is active | Your ChatGPT plan, for nothing |
Switching back is a one-line edit: delete or comment out model_provider and Codex returns to its built-in default. Keeping the [model_providers.continuum] table on disk costs nothing while it is unselected, so there is no reason to remove it.
What you need first
Setting the Codex CLI up this way requires Continuum Plus or higher. Inference keys do not mint on the Free tier, so the Create key button stays disabled until you subscribe, and the provider block below is inert without one.
- The Codex CLI, version 0.122 or later. Older builds still accept
wire_api = "chat", and the instructions below assume the modern one.codex --versiontells you. - A Continuum account on a paid plan. Personal API keys are a paid-plan feature. As of August 2026 that is Plus at $25/mo, Max 100 at $100/mo, Max 200 at $200/mo, or Ultra at $500/mo; each step up raises the weekly hosted allowance. See pricing for the detail.
- A shell you can export a variable in. That is the whole install footprint.
Point Codex at Continuum
Create a Continuum API key
In the Continuum web app at continuumcode.ai/app, open Settings, then Account, then Inference API. Create your key under Your keys. The same panel is on the Usage tab. Copy it immediately: it begins with cont_sk_, and the full value is displayed exactly once. There is no way to read it back, so a lost key is replaced rather than recovered.
Keys mint on Plus and above, so on the Free tier Create key stays disabled until you subscribe.
Add the provider to ~/.codex/config.toml
Create the file if it does not exist. The two top-level keys select the provider and the model; the table describes the endpoint. Order matters in TOML only in that top-level keys must come before the first table header, which is why model and model_provider sit above [model_providers.continuum] here.
model = "gpt-5.6-sol"
model_provider = "continuum"
[model_providers.continuum]
name = "Continuum"
base_url = "https://continuumcode.ai/v1"
env_key = "CONTINUUM_API_KEY"
wire_api = "responses"
Export the key and run Codex
env_key names the variable Codex will read; it does not store the secret. Export it in the shell you are about to run codex in, or put it in that shell’s profile if you want it to persist.
export CONTINUUM_API_KEY="cont_sk_..."
codex
Confirm the first turn actually landed
Ask it something trivial. A successful reply proves the key, the URL, the wire protocol, and the model ID all at once, which is worth doing before you point it at real work. If it fails, the smoke test in the troubleshooting section below separates a gateway problem from a Codex problem in one command.
The one field that has to be right: wire_api
Two OpenAI-shaped wire protocols exist, and Codex used to support both. wire_api = "chat" spoke Chat Completions; wire_api = "responses" speaks the newer Responses API. Codex removed the "chat" value in 0.122. A modern Codex is a Responses client and nothing else, which is precisely why the Continuum gateway serves POST /v1/responses alongside POST /v1/chat/completions.
| Value | What happens |
|---|---|
wire_api = "responses" | Correct. Codex posts to /v1/responses and the gateway answers. |
wire_api = "chat" | Rejected by Codex 0.122 and later; the value no longer exists. |
| omitted | Depends on the Codex build’s default, which is not something to leave to chance in a third-party provider block. State it. |
The second-order version of the same mistake is the base URL. Because Codex appends the route itself, base_url must carry the /v1 and stop there: https://continuumcode.ai/v1, no trailing slash and no path after it. Anthropic-shaped clients have the opposite rule and take the bare origin, which is worth knowing if you are also setting up Claude Code against the same gateway.
The models you can name
These IDs were read from the live gateway on 17 August 2026. Put one on the model line. Codex has no opinion about the vendor behind an ID, so a Claude or Gemini model in a Codex session is unremarkable to the CLI.
Paid lane, drawn from your plan’s inference allowance.
| Model ID | What it is |
|---|---|
claude-opus-5 | The flagship, and the gateway’s default |
claude-fable-5 | Claude 5 family |
claude-sonnet-5 | Claude 5 family |
gpt-5.6-sol | GPT-5.6 family, the closest thing to a native Codex model |
gpt-5.6-terra | GPT-5.6 family |
gpt-5.6-luna | GPT-5.6 family |
grok-4.6 | xAI |
gemini-3.5-flash | |
deepseek-v4-flash | DeepSeek |
glm-5.3 | Z.ai, via OpenCode Go |
muse-spark-1.2 | Muse |
The free lane
These models do not draw down your plan’s weekly inference allowance. Naming one in config.toml still needs a paid key, because that is what minting a key requires. They are chat-grade rather than agent-grade: fine for questions and small edits, and not what you want driving a long Codex run that is going to touch your repository.
On a paid key, these :free models do not draw your weekly budget.
| Model ID | Provider |
|---|---|
google/gemma-4-26b-a4b-it:free | |
nvidia/nemotron-3-ultra-550b-a55b:free | NVIDIA |
nvidia/nemotron-3-super-120b-a12b:free | NVIDIA |
cohere/north-mini-code:free | Cohere |
poolside/laguna-m.1:free | Poolside |
tencent/hy3:free | Tencent |
curl -s https://continuumcode.ai/v1/models \
-H "Authorization: Bearer cont_sk_..."
When it does not work
| Symptom | Cause | Fix |
|---|---|---|
| Protocol or parse error on the first turn | wire_api missing or wrong | Set it to "responses" exactly |
| 401 or an authentication failure | The variable is not set in this shell | Run echo $CONTINUUM_API_KEY in the same terminal you run codex in |
| 401 with the variable clearly set | Key mistyped, truncated on paste, or revoked | Mint a new key; the original is unrecoverable |
| 404 on every request | A trailing slash or a path appended to base_url | Set it to exactly https://continuumcode.ai/v1 |
| Unknown or invalid model | The ID is not on your plan’s allowlist | Check it against GET /v1/models with your key |
| A long answer stops mid-sentence | The 8,192-token output cap | Ask for the work in parts; agent turns iterate and rarely hit it |
| It still talks to OpenAI | model_provider is not set, or is misspelled | It must match the table name after model_providers. exactly |
curl -s https://continuumcode.ai/v1/responses \
-H "Authorization: Bearer cont_sk_..." \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-sol","input":"say hi"}'
One environment note worth stating because it costs people an afternoon: an editor or IDE that launches codex for you does not necessarily inherit the shell profile you exported the key in. A launcher started before you edited that profile is running with the old environment, and quitting and reopening it is the fix.
Questions people ask
Nowhere in config.toml. The env_key field names an environment variable, and Codex reads the secret from it at startup, so you export CONTINUUM_API_KEY in the shell that runs codex. Keeping the key out of the config file is the reason Codex works this way. The key itself comes from the web app under Settings, then Account, then Inference API, created under Your keys.
Codex removed the "chat" value in 0.122, so a current Codex speaks only the Responses API. The Continuum gateway serves POST /v1/responses for exactly this reason. Omitting the field leaves the choice to the build default, which is not worth risking in a third-party provider block.
Yes. OpenAI-shaped clients append their own route, so base_url is https://continuumcode.ai/v1 with no trailing slash. Anthropic-shaped clients such as Claude Code take the bare origin instead, which is the opposite rule and a common source of confusion when you configure both.
Yes. Codex is a client and does not care whose model answers; any ID the gateway serves works on the model line, including the claude-* family. It is the same request shape either way.
No. While model_provider points at Continuum, Codex never calls OpenAI, so your ChatGPT sign-in is untouched and unused. Deleting the model_provider line returns Codex to its built-in default.
Change the model line in ~/.codex/config.toml to another served ID. The provider table does not change. Run curl -s https://continuumcode.ai/v1/models with your key to see what is currently served.
Responses are capped at 8,192 output tokens. A single generation asked to emit an entire large file can truncate; agent turns iterate across several responses, so in practice they are unaffected.
Yes, unchanged. Sandboxing and approval policy are local Codex behaviour and have nothing to do with which endpoint answers the model call.
Remove or comment out the model_provider line. The [model_providers.continuum] table can stay on disk; an unselected provider does nothing.
Sources
Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.
- OpenAI Codex: configuration the model_providers table, base_url, env_key, and wire_api
- openai/codex on GitHub the 0.122 release that removed wire_api = "chat"
- Continuum pricing plan names, prices, and which tiers include personal API keys
- Continuum hosted inference the model lanes and the gateway surfaces, read 13 August 2026; the live /v1/models endpoint itself needs a cont_sk_ bearer