Can Claude Code use other models like GPT, DeepSeek, GLM, Kimi or Gemini?
Yes: point ANTHROPIC_BASE_URL at an endpoint that speaks Anthropic's Messages API, then set ANTHROPIC_AUTH_TOKEN to its key and ANTHROPIC_MODEL to the model. DeepSeek, Z.ai and Moonshot run such endpoints for their own models; a proxy or a gateway like Standard Compute covers GPT and Gemini too. Anthropic does not support any of these setups.
# Every Claude Code request on DeepSeek V4.1 Flash
# No /v1 here: Claude Code adds /v1/messages itself.
export ANTHROPIC_BASE_URL=https://api.stdcmpt.com
export ANTHROPIC_AUTH_TOKEN=YOUR_API_KEY
export ANTHROPIC_MODEL=deepseek/deepseek-v4.1-flash
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek/deepseek-v4.1-flash
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek/deepseek-v4.1-flash
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek/deepseek-v4.1-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek/deepseek-v4.1-flash
claude
Replace YOUR_API_KEY with a key from the dashboard. Shell exports last for one terminal; put the same values in the env block of ~/.claude/settings.json to keep them.
Ways to run another model in Claude Code
| Route | Base URL | What you get |
|---|---|---|
| DeepSeek API | api.deepseek.com/anthropic | DeepSeek models only, per token, half price off-peak. Opus names map to V4 Pro, Sonnet and Haiku names to Flash |
| Z.ai API | api.z.ai/api/anthropic | GLM 5.3 and GLM 5.3 Flash only, per token or on Z.ai's GLM Coding Plan |
| Kimi API | api.moonshot.ai/anthropic | Kimi models only, per token. Kimi's setup uses K3 for the session and K2.7 Code for background calls |
| LiteLLM | Your own proxy | Any provider LiteLLM supports, including OpenAI and Gemini. You run the proxy and pay each provider separately |
| claude-code-router | A proxy on 127.0.0.1 | OpenAI, Gemini, OpenRouter, DeepSeek, Kimi, Z.ai and others. Same trade-off as LiteLLM |
| Standard Compute | api.stdcmpt.com | Claude, GPT, Gemini, DeepSeek, GLM, Kimi, MiniMax and Qwen on one key. Monthly plan with a fixed budget that stops at the cap |
Add https:// in front of each base URL; Claude Code adds /v1/messages itself. Endpoints and model mappings from each project's own docs, checked October 13, 2026.
Pinning a model through Standard Compute
- Model IDs carry the vendor: deepseek/deepseek-v4.1-flash, z-ai/glm-5.3, openai/gpt-6-luna, google/gemini-3.8-flash, moonshotai/kimi-k3. The full list is on the Models page.
- Anthropic's hyphenated IDs such as claude-sonnet-5-5 return model_not_found. Use the dotted form, anthropic/claude-sonnet-5.5.
- Run /status to check the base URL; Request Logs in the dashboard show which model answered each call.
Setup for one model
- DeepSeek in Claude Code: V4.1 Flash, V4 Pro on opus, and DeepSeek's own endpoint compared.
- Kimi K3 in Claude Code: K3 with a cheaper background model, since K3 is costly per token.
- GLM 5.3 in Claude Code: GLM 5.3 with GLM 5.3 Flash for subagents and screenshots.
- Qwen 3.8 in Claude Code: Qwen 3.8 Max with Qwen 3.8 Flash for background calls.
- GPT in Claude Code: GPT-5.6 Sol, Terra and GPT-6 Luna across the model slots.
- Gemini in Claude Code: Gemini 3.8 Flash, 3.1 Pro and Flash-Lite, and the January price change.
- MiniMax M3 in Claude Code: a low-priced, text-only option for every slot.
What changes when the model is not Claude
Claude Code's prompts and tools are built for Claude, and Anthropic's gateway docs say it "doesn't support routing Claude Code to non-Claude models through any gateway". How well a model handles the tool calls varies, so try it on a real task first.
| Feature | What happens | What to do |
|---|---|---|
| Thinking toggle | Standard Compute drops the thinking parameter and returns no thinking blocks. DeepSeek's endpoint ignores budget_tokens | Set reasoning per model on the Models page |
| Context window | Claude Code assumes 200K tokens for model IDs it doesn't recognize and compacts there | Set CLAUDE_CODE_MAX_CONTEXT_TOKENS; Standard Compute stops requests at about 850K input |
| /model picker | Gateway discovery only lists IDs containing claude or anthropic | Use --model or ANTHROPIC_MODEL |
| Subagents | With the launcher they keep the sonnet and haiku names, which mean smart routing here | Set the ANTHROPIC_DEFAULT_*_MODEL and CLAUDE_CODE_SUBAGENT_MODEL variables, as in the configs above |
| Prompt caching | DeepSeek ignores cache_control and caches repeated prefixes itself. Standard Compute sets cache points for Claude; other providers cache prefixes on their side | Nothing to set |
| Your Claude login | Not used while a gateway key is set, so Pro and Max limits don't apply and the plan doesn't pay | Unset the variables to go back to it |
Sources: Anthropic's Claude Code docs (LLM gateway, gateway compatibility guide, model configuration) and DeepSeek's Anthropic API guide, checked October 13, 2026.
What a request costs on each model
Cache reads decide the bill: 87% of an agent's prompt is cache hits, so GLM 5.3, at $0.26 per million cached tokens against Sonnet 5.5's $0.10, costs slightly more per request despite its lower input price.
What changed for custom base URLs, September 29 to October 14, 2026
| Date | Version | Change | What it means for you |
|---|---|---|---|
| Sep 29 | 2.1.285 | Sessions behind a custom ANTHROPIC_BASE_URL use the 1M context window of models that have one: Opus 4.7 and later, Sonnet 5 and later, Fable | Sessions run longer before compacting, so late requests re-send more context. Run /autocompact 200k if your gateway stops at 200K |
| Oct 5 | 2.1.290 | No more failures behind proxies and gateways that reject one of Claude Code's beta headers | Fewer failed turns to retry on a proxy |
| Oct 7 | 2.1.293 | Claude Haiku 5.5 is the default Haiku model: $0.10 / $0.50 per million tokens, $0.50 / $2.50 on prompts over 100K | Background calls cost less, until a prompt passes 100K |
| Oct 8 | 2.1.295 | When a gateway refuses the 1M-context beta, Claude Code resends the request without it | A [1m] model no longer fails every request behind such a gateway |
| Oct 14 | 2.1.299 | Streams through a custom base URL wait 300 seconds for first data instead of 180, and gateway-specific model names no longer fail compaction near 200K | Slow first tokens on big prompts stop aborting and being re-sent |
From Claude Code's release notes on GitHub, checked October 14, 2026. On Standard Compute, requests stop at about 850K input tokens.
The catch
Every route here runs Claude Code on something Anthropic does not test it against. Anthropic's docs warn that Claude Code adds capabilities with each release and a gateway that doesn't forward them breaks those features, so an update can break a proxy setup overnight. A model that mishandles a tool call also costs you the retry. Use other models for the routine work and keep a Claude model for the hard steps.
Where Standard Compute fits
One key reaches every model in the catalog from Claude Code. Pin one with --model, or keep Claude Code's own model names and smart routing picks per request from the models you select. Each plan has a fixed monthly budget, and requests stop there, with no overage charges.
FAQ
Can I use DeepSeek in Claude Code?
Yes. Point Claude Code at DeepSeek's own endpoint, https://api.deepseek.com/anthropic, with a DeepSeek key, or pin deepseek/deepseek-v4.1-flash through Standard Compute with ANTHROPIC_MODEL or --model.
Can I point Claude Code at GLM 5.3 without signing up for a Chinese cloud account?
Yes: Standard Compute serves z-ai/glm-5.3 and z-ai/glm-5.3-flash on its Anthropic Messages endpoint, so setting ANTHROPIC_BASE_URL=https://api.stdcmpt.com, ANTHROPIC_AUTH_TOKEN to a Standard Compute key and ANTHROPIC_MODEL=z-ai/glm-5.3 runs Claude Code on GLM 5.3 with no Z.ai account, on a monthly plan from $19 with a fixed budget. Z.ai's own route, https://api.z.ai/api/anthropic, needs a Z.ai account and key, billed per token or on its GLM Coding Plan.
Can Claude Code use GPT or Gemini models?
Only through something that translates, because Claude Code speaks Anthropic's Messages API and OpenAI's and Google's APIs use their own formats. LiteLLM and claude-code-router do it on your machine; Standard Compute serves openai/gpt-6-luna, google/gemini-3.8-flash and other catalog models on its Messages endpoint.
Is there one API that serves both Claude and GPT models, so I can stop juggling two providers?
Yes: Standard Compute serves Claude, GPT, Gemini, DeepSeek, GLM and Kimi models on one key and one bill, through Anthropic's Messages API for Claude Code (https://api.stdcmpt.com) and OpenAI-compatible Chat Completions for other tools (https://api.stdcmpt.com/v1). Switch with --model, for example anthropic/claude-opus-5.5 for architecture and openai/gpt-6-luna for quick edits. LiteLLM and claude-code-router do the same on your own machine, with a separate bill from each provider.
Is there a monthly plan that routes to Fable or Opus when it matters and a cheaper model when it doesn't?
Yes: on Standard Compute, select Fable 5.1 or Opus 5.5 together with cheaper models on the Models page, keep Claude Code's own model names, and smart routing picks a model per request, for one monthly price from $19. Fable 5.1 lists at $10/$50 per million input/output tokens, so pinning it for every request uses a budget quickly; routing the routine steps elsewhere is what makes the budget last.
Do I need a Claude subscription to use Claude Code with other models?
No. Claude Code needs a base URL and a key. While a gateway key is set, Claude Code sends it instead of your claude.ai login, so the subscription is neither needed nor used for those requests.
Why doesn't my model show up in /model?
Claude Code's gateway model discovery only keeps model IDs that contain "claude" or "anthropic". Start Claude Code with --model and the model ID, or set ANTHROPIC_MODEL, to use anything else.
Do subagents use the model I pinned?
Not with the launcher's --model alone: subagents and background calls still ask for Claude Code's sonnet and haiku names, which Standard Compute routes across your selected models. Set ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL and CLAUDE_CODE_SUBAGENT_MODEL to pin them too.
Why does Claude Code compact so early with DeepSeek or GLM?
Claude Code assumes a 200K-token window for model IDs it doesn't recognize. Set CLAUDE_CODE_MAX_CONTEXT_TOKENS to the window you want; on Standard Compute keep it under about 850K, where requests stop.