Inference Cheap

Connect Codex

Use your Inference Cheap key in Codex CLI or the app.

For agents — copy the setup prompt.

Configure Codex

Paste this block at the start of ~/.codex/config.toml (or $CODEX_HOME/config.toml), before any [section]. Replace YOUR_API_KEY with the key provided by the Inference Cheap team.

# <inference_cheap>

model_providers.inference_cheap.experimental_bearer_token = "YOUR_API_KEY"

model_providers.inference_cheap.name = "OpenAI"
model_providers.inference_cheap.base_url = "https://codex.inference.cheap"
model_providers.inference_cheap.wire_api = "responses"
model_providers.inference_cheap.supports_websockets = false
model_provider = "inference_cheap" # Set to "openai" to use your own subscription.

# </inference_cheap>

Replace existing settings for this provider; do not duplicate keys or tables. Keep your model, reasoning effort, service tier, and other preferences. The URL has no /v1. Keep name = "OpenAI" for remote context compaction.

Start a task

Restart Codex and start a new task. The block uses HTTP streaming; set supports_websockets to true if you want WebSocket transport.

To use your ChatGPT subscription again, set model_provider = "openai" and restart Codex. Keep the block for switching back later.

Troubleshooting

  • Config error: remove duplicate keys/tables; put the block before any section.
  • Auth error: check your Inference Cheap key; contact the team if it fails.
  • Wrong provider: restart Codex and check profile or project overrides.
  • Missing model or feature: availability depends on your key and Codex version.

For agents

Copy this Markdown prompt to your agent.

Connect Codex
# Connect Codex to Inference Cheap

1. Read and back up `$CODEX_HOME/config.toml` (default: `~/.codex/config.toml`).
   Preserve file permissions, unrelated settings, and model preferences.
2. Reuse the user's Inference Cheap key. If missing, ask them to obtain one
   from the Inference Cheap team and enter it locally. Never print the key.
3. Insert or replace this block at the start of the file, before any section.
   Replace YOUR_API_KEY. Consolidate duplicate provider keys/tables; convert
   extra options in an existing provider table to dotted keys before removing it.

```toml
# <inference_cheap>

model_providers.inference_cheap.experimental_bearer_token = "YOUR_API_KEY"

model_providers.inference_cheap.name = "OpenAI"
model_providers.inference_cheap.base_url = "https://codex.inference.cheap"
model_providers.inference_cheap.wire_api = "responses"
model_providers.inference_cheap.supports_websockets = false
model_provider = "inference_cheap" # Set to "openai" to use your own subscription.

# </inference_cheap>
```

4. Parse the TOML. Confirm one marked block, one top-level model_provider,
   and the values above. Check profile/project overrides; preserve other settings.
5. Ask the user to restart Codex and start a new task. If a connection test
   was requested, send one short prompt and report the result.

On this page