Use Codex CLI with amazee.ai¶
Codex CLI is OpenAI's open-source terminal coding agent. Connect it to amazee.ai to route requests through your regional endpoint with full budget controls and data residency.
Prerequisites¶
- Codex CLI installed (installation guide)
- An amazee.ai API key
Connect Codex CLI to amazee.ai¶
Step 1 — Configure the provider¶
Create or edit ~/.codex/config.toml:
model_provider = "openai"
model = "claude-sonnet-4-5"
[model_providers.openai]
name = "openai"
base_url = "https://llm.[your-region].amazee.ai/v1"
env_key = "AMAZEEAI_API_KEY"
Replace [your-region] with your region code (e.g. ch103, us103, de103).
Step 2 — Set your API key¶
Add to your shell profile (~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish):
Then reload your shell:
Step 3 — Start Codex¶
Switching models¶
Change the model value in config.toml to any model from Available Models:
Troubleshooting¶
- Auth errors
- Make sure
AMAZEEAI_API_KEYis set. Runecho $AMAZEEAI_API_KEYto verify. - Model not found
- Use the exact model ID from Available Models.
- Connection errors
- Verify your base URL is correct and includes
/v1.