What is Codex CLI?
Codex CLI is OpenAI’s open-source coding agent for the terminal. It reads your repo, proposes and applies edits, and runs commands in a sandbox. A model provider in config.toml defines how it connects — base URL, wire API and auth — so it isn’t locked to OpenAI’s own endpoint.
- An agentic terminal coder with sandboxed command execution.
- Connects to any OpenAI-compatible endpoint via a custom
[model_providers.<id>]table. - Supports a
wire_apiofchat(Chat Completions) orresponses. - Open source; configured entirely from
~/.codex/config.toml.
Why route Codex CLI through Tokonomix?
Codex CLI is excellent, but pinned to one vendor’s models by default. A Tokonomix model_provider opens it to 130+ models across families — and a consensus option for the changes a single model shouldn’t decide alone.
- One provider entry, 130+ models — switch with the top-level
modelkey. - Use
tokonomix-consensusfor risky refactors, a fast slug for routine edits. - Per-call spend caps bound an autonomous coding session.
- Region / origin routing keeps a code-streaming agent compliant.
Connect Tokonomix in config.toml
Add a [model_providers.tokonomix] table with the Tokonomix base_url, an env_key, and wire_api = "chat" (Tokonomix is Chat Completions-compatible). Then activate it with the top-level model and model_provider keys.
model = "anthropic/claude-sonnet-4-6"
# Opt-in (planning/review only, no tool-calling): model = "tokonomix-consensus"
model_provider = "tokonomix"
[model_providers.tokonomix]
name = "Tokonomix"
base_url = "https://tokonomix.ai/api/v1"
env_key = "TOKONOMIX_API_KEY"
wire_api = "chat"Codex reserves the provider IDs openai, ollama and lmstudio — name your custom provider something else (e.g. tokonomix), then set model_provider = "tokonomix".
Verify it works
- Export
TOKONOMIX_API_KEY, save~/.codex/config.toml, and start Codex CLI. - Run a small task and confirm it uses the Tokonomix provider and model.
- Check the call and token usage in your Tokonomix dashboard.

