Integration
Codex CLI with an OpenAI-compatible provider
Codex CLI reads providers from ~/.codex/config.toml. An OpenAI-compatible provider with a base URL and an environment key is all it needs.
Updated
The provider block
Add a model_providers entry with the base URL https://llmcode.io/v1, the environment variable that holds the key, and wire_api set to responses. Then point the top-level model_provider at that entry and set model to a published slug.
On Windows the file lives in %USERPROFILE%\.codex\config.toml; on macOS and Linux in ~/.codex/config.toml. The key itself stays in the environment — the config references it by name, so the file can be committed or shared.
Choosing the wire API
Codex can speak either the responses or the chat completions format. responses matches the CLI default; if a profile rejects that shape, switch wire_api to chat and keep the same base URL.
Streaming is not available on /v1/responses in this version. Run the CLI without stream mode; requests with stream: true return 400.
What the first run should show
Start with a short prompt, then open /account/logs. A healthy run shows one row per request with the model, the tokens and the charge. If the CLI reports an authentication error, the environment variable is not visible to the process that launched it.
Agentic runs read whole repositories, so a spend limit on the key is the cheapest insurance: it caps the session instead of the account.
Connect
model = "claude-sonnet-5-5"
model_provider = "llmcode"
[model_providers.llmcode]
name = "LLMcode"
base_url = "https://llmcode.io/v1"
env_key = "LLMCODE_API_KEY"
wire_api = "responses"curl https://llmcode.io/v1/models \
-H "Authorization: Bearer $LLMCODE_API_KEY"Published model prices
USD per 1M tokens. The numbers come from the public catalog on every page rebuild — this is the sale price, not an estimate.
| Model | Input | Output | Cache |
|---|---|---|---|
| Claude Opus 5.5 | $2.70 | $8.00 | $0.14 |
| DeepSeek Flash | $0.50 | $2.00 | $0.01 |
| Claude Sonnet 5.5 | $1.33 | $6.67 | $0.07 |
| DeepSeek V4 Pro | $2.20 | $6.60 | $0.07 |
Top-up from $10, balance in USD. 1 USD = 1,000,000 UT. No subscription and no auto-charge.
Questions
Which config file does Codex read?
~/.codex/config.toml (%USERPROFILE%\.codex\config.toml on Windows).
Is the LLMcode key written into the config?
No. The config names an environment variable through env_key, and the token stays in the shell environment.
Can I keep OpenAI and LLMcode side by side?
Yes. Define both providers in config.toml and switch model_provider per session or per project.
Why does the CLI return 404 for a model?
The slug is not a published profile, or the key is not allowed to use it. Check the list from GET /v1/models with the same key.