Connect Codex CLI to Smouter
Point OpenAI’s Codex CLI at Smouter with a custom model provider in ~/.codex/config.toml.
What you need
- Base URL:
https://api.smouter.ai/v1— the/v1suffix matters; leaving it off is the most common setup failure. - API key: an
sk-smouter-…secret from API keys. It is shown once at creation — if you lost it, create a new key. - Model id: copied exactly from the live catalog (or
GET /v1/models). Ids are matched verbatim — no vendor prefixes, no renaming.
Point Codex CLI at Smouter
- Add a
smouterprovider to~/.codex/config.tomland select it withmodel_provider. env_keynames the environment variable Codex reads the key from — export it before launching.- Keep
wire_api = "chat". Smouter also serves the Responses API, but statelessly: Codex's responses mode can sendprevious_response_id, which a stateless surface rejects with400. The chat wire avoids that entirely.
model = "<model-id>"model_provider = "smouter" [model_providers.smouter]name = "Smouter"base_url = "https://api.smouter.ai/v1"env_key = "SMOUTER_API_KEY"wire_api = "chat"The Codex IDE extension reads the same ~/.codex/config.toml, so this provider works there too. The Codex built into the ChatGPT desktop app is tied to ChatGPT accounts and cannot use a custom provider.
Verify outside the tool first
Two commands separate a Smouter problem from a tool problem. If both succeed, your key, credit, and model id are fine — whatever remains is the tool's configuration.
# Which model ids can I use right now? (no auth needed)curl -s https://api.smouter.ai/v1/models | jq -r '.data[].id'If it doesn't work
- Base URL wrong or missing
/v1. OpenAI-style tools need exactlyhttps://api.smouter.ai/v1— no trailing/chat/completions, no bareapi.smouter.ai. Anthropic-style tools (Claude Code) usehttps://api.smouter.aiwith no suffix. 401 auth— the key was pasted wrong, expired, or revoked. Secrets are shown once; create a fresh key in API keys and paste it whole, including thesk-smouter-prefix.402 insufficient_quota— your wallet or a per-key cap can't cover the request. Top up in Billing or raise the key's cap.404 model_not_found— the id doesn't match the catalog. Copy it verbatim from the catalog; ids are case-sensitive and carry noopenai/-style prefix (where a tool requires one, the tool strips it before sending).429— a rate or tokens-per-minute window is exhausted. Honorretry-after; per-key TPM is adjustable in API keys.- Scoped key. If the key has a model allowlist, every model the tool may call — including fallbacks — must be on it. When in doubt, test with an unscoped key.
- The tool's UI moved. Settings get renamed; the three constants don't. Any field asking for an OpenAI(-compatible) base URL, key, and model name takes the values above.
Still stuck? Open a ticket with the request's x-request-id (or the error body) and we'll trace it — or email support@smouter.ai.