Developer Docs › Codex CLI

Codex CLI

Use Onefast API in Codex CLI, OpenAI's official command-line coding assistant.

1. Install

Shell

npm install -g @openai/codex@latest

2. Configure the model provider

Edit ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml):

~/.codex/config.toml

model_provider = "custom"
model = "gpt-5.5"
model_reasoning_effort = "high"
disable_response_storage = true

[model_providers.custom]
name = "custom"
base_url = "https://api.onefast.ai/v1"
wire_api = "responses"
requires_openai_auth = true
  • base_url must include /v1.
  • wire_api = "responses": Codex uses the Responses API.
  • model can be any other GPT model from the model catalog.

3. Add your key

Edit ~/.codex/auth.json:

~/.codex/auth.json

{
  "OPENAI_API_KEY": "sk-xxx"
}

4. Verify

Shell

codex exec "Introduce yourself in one sentence."

Troubleshooting

  • 401: check the key in auth.json. If you previously logged in to Codex with a ChatGPT account, run codex logout and try again.
  • Model unavailable: the key's groups don't include the selected model. Pick another model, or add a group to the key in the console.
  • Reasoning effort: model_reasoning_effort can be low / medium / high; higher is slower and uses more output tokens.