Codex CLI with idapt
Found this helpful? Share it:
Found this helpful? Share it:
Set up Codex CLI against idapt's compatible APIs with the steps below. This article and the AI Gateway quickstarts lander render the same shared steps, so they never drift.
Codex CLI with idapt
A TOML provider block with command-based auth points Codex at idapt and pulls the live model catalog.
npm i -g @openai/codex# ~/.codex/config.toml
model_provider = "idapt"
model = "openai/gpt-5.6-luna"
model_reasoning_effort = "high"
[model_providers.idapt]
name = "idapt"
base_url = "https://idapt.app/api/openai/v1"
wire_api = "chat"
[model_providers.idapt.auth]
command = "sh"
args = ["-c", "echo $IDAPT_API_KEY"]Command-based auth also triggers the model-catalog refresh, so non-OpenAI ids get real metadata instead of the Unknown model fallback. Windows: use command = "powershell" with Write-Output $env:IDAPT_API_KEY. model_reasoning_effort takes low, medium, high, xhigh, or max.
The quickstart keeps codex as your surface. When you are ready to leave it, one command imports its chat history into idapt: run Import chats from coding agents (idapt chat import --from codex), then continue in idapt directly.
Related articles
API keys and scopes
Create a key, choose its scopes, pin it to an API version, rotate it, and cap what it can spend.
Rate limits and errors
Every error shape the API returns, what each rate limit is, and how to handle a wall in code.
Cap what an API key spends
Give every Gateway API key a lifetime, monthly, or daily USD cap, and what a capped-out key returns.
OpenAI-compatible API
Use idapt's 200+ models from any app that speaks the OpenAI API format.
Claude Code with idapt
Point Claude Code at idapt's Anthropic-compatible API with ANTHROPIC_BASE_URL and an idapt key; add MCP for workspace access.
OpenCode with idapt
Configure OpenCode to route through idapt's OpenAI-compatible API: a provider block in opencode.json with the base URL and your key.
Aider with idapt
Use Aider with idapt's OpenAI-compatible API: OPENAI_API_BASE plus a prefixed model flag route edits through your idapt key.
Import chats from coding agents
Bring your Claude Code, Codex, or OpenCode session history into idapt with one CLI command: dates and tool calls included.
Was this helpful?