Skip to main content

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:

Installation

Codex CLI

npm install -g @openai/codex

Codex app

Download the app from OpenAI Codex.

Configuration

Create or update ~/.codex/config.toml:
model = "openai-latest"
model_reasoning_effort = "high"
model_provider = "capriole_ai"

[model_providers.capriole_ai]
name = "Capriole AI"
base_url = "https://api.caprioletech.com/v1"
wire_api = "responses"
env_key = "CAPRIOLE_AI_API_KEY"
env_key_instructions = "Export CAPRIOLE_AI_API_KEY before starting Codex"

Run Codex

Set your API key, then start Codex:
export CAPRIOLE_AI_API_KEY="YOUR_CAPRIOLE_AI_API_KEY"
codex

Supported models

Codex supports Capriole AI OpenAI models through the Responses API. Use openai-latest for new setups so Capriole AI can route Codex to our recommended flagship OpenAI model without changing your config.
  • openai-latest
  • openai/gpt-5.5
  • openai/gpt-5.4-mini

Troubleshooting

Why does Codex return an authentication error?

Confirm that CAPRIOLE_AI_API_KEY is exported in the same shell before running codex.

Why can’t Codex find the model?

Confirm that model_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 that base_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 as openai; 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