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
Install Codex CLI with the official installer:
Or install it with npm:
Verify the install:
Codex app
Download the app from OpenAI Codex.
Configuration
Model validation
Codex CLI 0.160.1 passes a file-read, file-write, and final-answer check through Capriole AI with the configuration below.
Create or update ~/.codex/config.toml:
What each setting does:
model is the default model. Change it with /model in a session or --model on the command line.
model_provider selects the Capriole AI provider defined below it.
base_url includes /v1, because Codex adds /responses itself.
wire_api = "responses" uses the Responses API, the only protocol Codex supports for custom providers.
env_key reads your key from the environment and sends it as a Bearer token.
Run Codex
Set your API key, then start Codex from your project directory:
For a non-interactive run, use codex exec:
Supported models
Codex uses Capriole AI OpenAI models through the Responses API. Use the native model IDs below with Codex’s built-in model picker and reasoning settings. You do not need a custom model_catalog_json. Only models supported by Capriole AI can be called.
gpt-6-astra
gpt-6.1-sol
gpt-6-sol
gpt-6-luna
gpt-5.6-terra
gpt-5.6-luna
gpt-5.5
Use Codex 0.159.2 or later for gpt-6.1-sol. Older versions do not include its model metadata and fall back to generic settings.
The API also accepts the openai/-prefixed forms and openai-latest. The openai-latest alias follows Capriole AI’s recommended OpenAI flagship model.
Codex can also run xai/grok-4.7 through the same provider, because Capriole AI serves Grok on the Responses API.
Codex has built-in metadata only for OpenAI’s native model IDs. For openai-latest and xai/grok-4.7, it prints Model metadata ... not found and uses fallback settings. The session still works, but use a native ID such as gpt-6-astra for the best results.
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 one of the IDs in Supported models.
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
Last modified on October 20, 2026