Overview
Quickstart
Connect through OpenAI-compatible clients, Claude / Anthropic clients, or Codex CLI by changing only the gateway URL and API key.
Prepare
curl https://api.devrouter.ai/v1/models -H "Authorization: Bearer $DEVROUTER_API_KEY"01
Prepare
Create a DevRouter API key first
Sign in to the console, create an API key, then call `/v1/models` to confirm the available model and routing scope.
curl https://api.devrouter.ai/v1/models -H "Authorization: Bearer $DEVROUTER_API_KEY"- A new API key is fully revealed only once.
- The public catalog helps with discovery, while the key's route strategy decides what is actually reachable.
02
OpenAI
Connect OpenAI-compatible clients
Keep your current OpenAI SDK or compatible client and point `baseURL` at DevRouter `/v1`.
import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.DEVROUTER_API_KEY, baseURL: "https://api.devrouter.ai/v1",});- Use one standard API entrypoint.
- Most request shapes stay unchanged.
03
Claude
Connect Claude Code / Anthropic clients
Claude Code keeps sending Anthropic-style requests. Point `ANTHROPIC_BASE_URL` at the DevRouter host root.
{ "env": { "ANTHROPIC_AUTH_TOKEN": "<DEVROUTER_API_KEY>", "ANTHROPIC_BASE_URL": "https://api.devrouter.ai" }}- Claude Code can read this from `~/.claude/settings.json`.
- The Anthropic SDK uses the host root and calls `/v1/messages` itself.
04
Codex
Connect Codex CLI
Codex CLI uses the responses wire API. Point `base_url` at the DevRouter host root and keep the key in `auth.json`.
# ~/.codex/config.tomlmodel_provider = "devrouter" [model_providers.devrouter]name = "devrouter"base_url = "https://api.devrouter.ai"wire_api = "responses"request_max_retries = 4stream_max_retries = 10stream_idle_timeout_ms = 300000 # ~/.codex/auth.json{ "OPENAI_API_KEY": "<DEVROUTER_API_KEY>"}- Set `wire_api = "responses"` in `config.toml`.
- Replace `OPENAI_API_KEY` in `auth.json` with your DevRouter API key.