Models and routing
The model ID in each request selects its provider. One proxy listener can serve every provider through Anthropic Messages and the enabled OpenAI-compatible routes.
Routing patterns
Section titled “Routing patterns”| Pattern | Provider |
|---|---|
Registered gpt-* IDs and their -fast and -ultrafast forms |
Codex |
kimi-for-coding, kimi-k2.6, k2.6 |
Kimi |
grok-composer-2.5-fast, grok-4.5, grok-4.6 |
Grok |
Non-conflicting registered OpenCode Go IDs and every opencode-go/<model-id> |
OpenCode Go |
cursor, Cursor legacy aliases, cursor:<id>, cursor-agent:<id>, cursor-plan:<id>, cursor-ask:<id>, claude-cursor:<id> |
Cursor Agent |
Anthropic-style aliases such as haiku, sonnet, opus, fable, and registered claude-* aliases |
The aliasProvider, Codex by default |
An unknown ID returns HTTP 400 with the supported provider catalog. There is no implicit fallback for arbitrary model names.
Prefer the live catalog
Section titled “Prefer the live catalog”The model list changes faster than documentation. Ask the installed CLI:
claude-code-proxy modelsclaude-code-proxy models --fullThe compact command abbreviates Cursor’s dynamic aliases. --full prints every usable alias and explicit parameter variant discovered for the proxy’s signed-in Cursor account. Discovery uses Cursor’s services directly; installing or upgrading the CLI is not required to update model names.
The HTTP equivalent is:
curl http://127.0.0.1:18765/v1/modelsShell quoting and model roles
Section titled “Shell quoting and model roles”Quote model values in shell commands, especially IDs containing brackets, commas, or other shell syntax. Preserve the exact advertised parameter names and values. Shell quotes protect the value; they are not part of the model ID. In JSON settings, use ordinary JSON strings without adding shell quotes.
ANTHROPIC_MODEL selects the initial model. The three ANTHROPIC_DEFAULT_*_MODEL variables assign Claude Code’s Opus, Sonnet, and Haiku roles independently; each can select a different provider or model family. For a complete Cursor example with Gemini, Opus, and Grok, use Configure Claude Code.
Codex fast mode
Section titled “Codex fast mode”Every registered Codex model also has a local -fast form. The proxy removes -fast from the upstream model and requests the priority service tier.
Models that offer the ultrafast tier also have a local -ultrafast form, which requests the ultrafast service tier. Today those are gpt-6-astra-ultrafast and gpt-6.1-sol-ultrafast. An -ultrafast name on any other model is not a registered ID.
For Claude Code requests on /v1/messages, a configured codex.serviceTier or CCP_CODEX_SERVICE_TIER override wins over both suffixes. When the forced tier is ultrafast and the model does not offer it, the proxy requests priority instead.
The [1m] hint
Section titled “The [1m] hint”A trailing [1m] affects Claude Code’s local compaction policy. The proxy strips it before matching and forwarding the model. Use it only when the upstream model and account can accept the resulting context, and set a safe CLAUDE_CODE_AUTO_COMPACT_WINDOW when the real limit is below one million tokens.
Main and small models
Section titled “Main and small models”Set both model variables to routable IDs:
ANTHROPIC_MODEL='gpt-6-sol[1m]'ANTHROPIC_DEFAULT_HAIKU_MODEL='gpt-6-luna[1m]'Claude Code sends background work to its small/fast model. Its built-in Haiku ID can route through aliasProvider, but a concrete provider ID keeps the behavior explicit.
Claude Code /model
Section titled “Claude Code /model”When ANTHROPIC_BASE_URL already points to the proxy, these can change the request model:
claude --model <id>at launch- Claude Code’s
/modelcommand in a session ANTHROPIC_MODELfor a new process
A model change can switch upstream providers because routing is per request. It does not change ANTHROPIC_BASE_URL or move the process back to direct Anthropic.
Gateway model discovery
Section titled “Gateway model discovery”Enable Claude Code discovery at process start:
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 \ANTHROPIC_BASE_URL=http://127.0.0.1:18765 \ANTHROPIC_AUTH_TOKEN=unused \ANTHROPIC_MODEL='gpt-6-sol[1m]' \ANTHROPIC_DEFAULT_HAIKU_MODEL='gpt-6-luna[1m]' \ claudeClaude Code’s gateway picker filters for IDs beginning with claude or anthropic. /v1/models therefore exposes distinct Cursor selections once as claude-cursor:<id>, alongside the other providers’ registered IDs and aliases. Each gateway ID preserves the original readable Cursor selection, including explicit bracket parameters.
Choose by readable label in /model, or copy an exact advertised ID for scripts. Raw cursor:<id> names and synonyms remain routable for API requests, --model, and environment variables. Gateway labels show the selected context parameter rather than relying on an upstream model label, and distinguish otherwise identical choices by their differing parameters.
Highlight a picker row and press s to switch only the current session; Enter or a typed /model <id> also saves the choice for future sessions (Claude Code model settings).
The HTTP catalog supports limit, after_id, and before_id. Follow last_id while has_more is true to retrieve subsequent pages. See Cursor Agent for parameter syntax, account discovery, and switching behavior.
Alias routing
Section titled “Alias routing”CCP_ALIAS_PROVIDER=kimi or "aliasProvider": "kimi" routes recognized Anthropic-style aliases to Kimi. Accepted values are codex and kimi. Explicit provider IDs always use their provider.