Using Corion AI with Codex
Codex CLI talks to Corion through the OpenAI Responses API, which Corion exposes at https://api.corion.ai. One config.toml entry wires it up; no adapter or shim needed.
Prerequisites
- Codex CLI installed
- A Corion API key from Dashboard → API keys
Setup
Codex's custom-provider path uses the Responses API (wire_api = "responses" is the only supported wire protocol), so point base_url at Corion's v1 root and set the provider.
Add to ~/.codex/config.toml:
model_provider = "corion"
model = "kimi-k3"
[model_providers.corion]
name = "Corion AI"
base_url = "https://api.corion.ai/v1"
env_key = "CORION_API_KEY"
Then export the key Codex reads from the environment:
# macOS / Linux
export CORION_API_KEY="your-corion-api-key"
# Windows PowerShell (persistent)
setx CORION_API_KEY "your-corion-api-key" # restart your terminal after this
env_key names the environment variable Codex reads; the key itself never lands in the config file.
Before running anything, confirm your key can see the models:
curl https://api.corion.ai/v1/models -H "Authorization: Bearer $CORION_API_KEY"
You should get kimi-k3, deepseek-v4-pro-0813 and deepseek-v4-flash-0731 back.
Switch models any time:
codex -m kimi-k3
codex -m deepseek-v4-flash-0731
Available models: kimi-k3 (1M context, 128K max output), deepseek-v4-pro-0813 (1M context, 375K max output), deepseek-v4-flash-0731 (1M context, 64K max output).
Verify
A minimal non-interactive run — a stream of reasoning plus the answer means auth, routing, and billing all work:
codex exec "Reply with exactly: pong"
Expect the header to show model: kimi-k3, provider: corion, a token count at the end, and pong as the answer. A 401 means the key is wrong or truncated — Corion shows the complete key only once at creation, so generate a fresh one in the dashboard.
Before trusting Codex with edits, run a read-only task first — for example codex exec "summarize this directory" — and confirm the reply and any tool calls work. Only then enable write permissions.
Notes and limitations
-
Right protocol, no adapter. Codex only speaks the Responses API to custom providers; most OpenAI-compatible routers don't offer it. Corion does, so this is a direct connection, not a chat-completions shim.
-
Model metadata ... not foundwarning — benign. At startup Codex queries/v1/modelsexpecting a shape Corion doesn't send, so it logsmissing field 'models'and falls back to default metadata for an unknown model id. Generation is unaffected. You can silence the guesswork by pinning the real limits:model_context_window = 1048576 # kimi-k3 / deepseek-v4-flash-0731 model_auto_compact_token_limit = 900000 -
Streaming works; Codex streams Responses events from Corion the same way it does from OpenAI.
For other request errors, see errors and retries.
Sources: Codex CLI configuration reference, Codex CLI overview.
