Integration guide
Codex
Codex is OpenAI's command-line coding assistant. It can talk to any custom model provider through its config.toml, so pointing that provider at CrossModel gives you access to the whole catalog.
Quickstart
1. Install Codex
macOS / Linux:
curl -fsSL https://chatgpt.com/codex/install.sh | shWindows:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"Or install with npm:
npm install -g @openai/codex2. Create an API key
Sign in to the Console and create a key that starts with cm- on the API Keys page. The key is shown only once, so copy it somewhere safe.
3. Add CrossModel as a provider
Edit ~/.codex/config.toml and define the CrossModel provider:
model_provider = "crossmodel"
model = "openai/gpt-5.5"
[model_providers.crossmodel]
name = "CrossModel"
base_url = "https://api.crossmodel.ai/v1"
env_key = "CROSSMODEL_API_KEY"4. Set the API key environment variable
env_key tells Codex which environment variable holds your key. Add it to your shell profile (~/.zshrc or ~/.bashrc):
export CROSSMODEL_API_KEY="cm-YOUR_KEY"Reopen the terminal, or run source ~/.zshrc, to load it.
5. Launch
Run Codex from your project directory:
cd /path/to/your/project
codexHow it works
model_provider selects the default provider, and the [model_providers.crossmodel] block describes it: base_url points at CrossModel's OpenAI-compatible endpoint (https://api.crossmodel.ai/v1), and env_key tells Codex where to read the key. Requests go to CrossModel with your cm- key sent as a Bearer token.
Choosing models
To switch models, just change the model field in config.toml — no reinstall needed. Model IDs follow the vendor/short_name format, e.g. openai/gpt-5-mini or deepseek/deepseek-v4-pro. See the full list in the model catalog.
Troubleshooting
| Symptom | What to check |
|---|---|
| Auth failure | Confirm CROSSMODEL_API_KEY is set, active in the current shell, and holds a valid cm- key. |
| "Model not found" | Verify the model field matches an ID from the /v1/models response. |
| Requests bypass CrossModel | Make sure model_provider is set to crossmodel and base_url ends with /v1. |
| Insufficient balance | Top up in the Console. |