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