Command-line AI tools — Claude Code, Codex, opencode, aider and similar — connect to the gateway with three settings: a base URL, a key, and a model name. This page explains the two protocol families those tools speak, and how to pick the right one. If you are connecting a library or an app rather than a CLI, see Configure your agent.

Every CLI needs the same three things

OpenAI-compatible CLIs

Most CLIs speak the OpenAI protocol. This includes opencode, aider, Codex and others.
The CLI sends requests to /v1/chat/completions and receives OpenAI-format answers.

Anthropic-protocol CLIs (Claude Code)

Claude Code speaks the Anthropic protocol. Point it at the gateway the same way:
Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY. The gateway reads the token variable.
The gateway answers Anthropic-format requests at /v1/messages. The model behind the gateway does not need to be made by Anthropic — the gateway translates.

Claude Code: subscription login vs gateway key

Claude Code can authenticate two ways, and the two are easy to confuse. Both are legitimate. Which fits depends on your situation:
  • If you already pay for a Claude subscription and only use Claude Code, connecting it to the gateway adds a metered hop for no benefit — use your subscription login directly.
  • If you want all your AI tools behind one door, or you are giving someone access without sharing a subscription login, use a gateway key as shown above.
There is no single “right” answer baked into the gateway. The gateway supports both paths; the choice is about cost and convenience for you.

Model names

Give the full name of the model.
The gateway will list every name it accepts:
A name with openrouter/ in front routes through OpenRouter, which charges per request. Access to OpenRouter models may be restricted per team.
To see which models your key may call, ask the gateway:

Test your setup

Send one request to confirm the key and model work before debugging a tool’s config: