Skip to main content
Auriko connects to Codex through two environment variables, routing your completions through Auriko instead of OpenAI.

Prerequisites

Install Codex

Run the official install script:
Or install via npm:
Or via Homebrew (macOS):
Open a new terminal after installing, then confirm Codex is available:
The install script writes PATH to ~/.bashrc, which non-interactive shells don’t source. In CI, GitHub Actions, or agent-driven sessions, add this before invoking codex:

Set your API key

Add these two lines to your shell profile (~/.zshrc on macOS, ~/.bashrc on Linux):
The variable names are OPENAI_* because Codex reads OpenAI-standard environment variables. Your Auriko API key goes in OPENAI_API_KEY. Your key starts with ak_live_ (production) or ak_test_ (testing). The base URL must include /v1. Codex appends /responses directly. If you’ve logged in to Codex with a ChatGPT account, these environment variables override the ChatGPT login. Codex routes completions through OPENAI_BASE_URL instead of chatgpt.com. Reload your shell after saving:
Or open a new terminal.
To keep your default codex connected to ChatGPT, create a wrapper command instead of modifying your shell profile.Add your Auriko API key to your shell profile (~/.zshrc or ~/.bashrc):
Create the wrapper script:
Add ~/.local/bin to your PATH if it isn’t already:
Reload your shell, then verify:
Use codex-auriko for Auriko sessions and codex for your ChatGPT subscription.

Verify

Run a test completion:
Codex prints sandbox setup output on first run. The model response follows. Expect two cosmetic warnings:
  • Model metadata for '...' not found: metadata isn’t available for models served through custom base URLs.
  • missing field 'models': the response uses the standard data field instead of a models field.

Use different models

Pass any model ID with the -m flag:
To switch models mid-session, type /model <id>.
Codex uses the Response API with hosted tools, which only GPT models support. Non-GPT models (Claude, DeepSeek, Gemini) return a hosted_tool_not_supported error.
These are the models available through Auriko that work with Codex:
ModelAuthorContext
gpt-5.5OpenAI1M
gpt-5.4OpenAI1M
gpt-5.4-miniOpenAI400K
gpt-5.4-nanoOpenAI400K
gpt-5-codexOpenAI400K
o4-miniOpenAI200K
o3OpenAI200K
gpt-4oOpenAI128K
gpt-5.4-nano works for basic tasks but doesn’t support all Codex tools (e.g., tool_search). Complex multi-tool sessions may require a larger model. To list all Auriko models (only GPT models with Response API support work with Codex):

Control routing

Configure routing in the Auriko dashboard. See routing options for details.

Uninstall

Remove OPENAI_API_KEY and OPENAI_BASE_URL from your shell profile (~/.zshrc or ~/.bashrc). If you created a codex-auriko wrapper, delete ~/.local/bin/codex-auriko.

Troubleshoot

SymptomCauseFix
Completions go to ChatGPT, not AurikoOPENAI_API_KEY not set; ChatGPT auth takes overExport OPENAI_API_KEY with your Auriko key
hosted_tool_not_supportedNon-GPT model usedUse a GPT model (see model table above)
404 on requestsOPENAI_BASE_URL missing /v1Use exactly https://api.auriko.ai/v1
”Model metadata not found” warningBuilt-in metadata not available for custom-provider modelsCosmetic. No action needed
”missing field models” warningAuriko’s model list format differs slightly from OpenAI’sCosmetic. No action needed
401 or “API key is invalid”Wrong key value or expired keyRun echo $OPENAI_API_KEY to check. Verify at curl -H "Authorization: Bearer $OPENAI_API_KEY" https://api.auriko.ai/v1/me
codex: command not foundInstall script PATH not loadedRun export PATH="$HOME/.codex/bin:$PATH" or open a new terminal