Skip to content

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.

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.

The model list changes faster than documentation. Ask the installed CLI:

Terminal window
claude-code-proxy models
claude-code-proxy models --full

The 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:

Terminal window
curl http://127.0.0.1:18765/v1/models

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.

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.

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.

Set both model variables to routable IDs:

Terminal window
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.

When ANTHROPIC_BASE_URL already points to the proxy, these can change the request model:

  • claude --model <id> at launch
  • Claude Code’s /model command in a session
  • ANTHROPIC_MODEL for 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.

Enable Claude Code discovery at process start:

Terminal window
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]' \
claude

Claude 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.

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.