What is Codex
Codex is OpenAI’s coding agent for software development. It can use Capriole AI through a custom model provider configured to send requests to Capriole AI’s Responses-compatible API.Prerequisites
Before you begin, make sure you have:- A Capriole AI account (Sign up here)
- A Capriole AI API key (Get your key)
Installation
Codex CLI
Codex app
Download the app from OpenAI Codex.Configuration
Create or update~/.codex/config.toml:
Run Codex
Set your API key, then start Codex:Supported models
Codex supports Capriole AI OpenAI models through the Responses API. Useopenai-latest for new setups so Capriole AI can route Codex to our recommended flagship OpenAI model without changing your config.
openai-latestopenai/gpt-5.5openai/gpt-5.4-mini
Troubleshooting
Why does Codex return an authentication error?
Confirm thatCAPRIOLE_AI_API_KEY is exported in the same shell before running codex.
Why can’t Codex find the model?
Confirm thatmodel_provider = "capriole_ai" is set and that model is openai-latest or a supported Capriole AI OpenAI model ID.
Why do requests fail with endpoint or protocol errors?
Confirm thatbase_url = "https://api.caprioletech.com/v1" and wire_api = "responses" are set under [model_providers.capriole_ai].
Why does Codex ignore the Capriole AI provider?
Do not use a reserved built-in provider ID such asopenai; keep the custom provider ID as capriole_ai.
Why don’t config changes apply?
Confirm that~/.codex/config.toml is the active user config file, trust the project before relying on project-scoped .codex/config.toml, then restart Codex.
Notes
- The configuration uses
env_keyso your API key stays in your shell environment instead of the config file. - Official references: Codex CLI, Codex config basics, Codex config reference, and sample configuration.