Disclosure: I'm Alex, the founder of UberLLM, a marketplace API with an Anthropic-compatible endpoint. The examples use it because it is the one I know. The settings themselves apply to any Anthropic-compatible endpoint, and the last section gives each model maker's own endpoint, which is the most direct route.
Claude Code talks to one API: Anthropic's Messages API. It does not care who answers, as long as the answer has the right shape. So it can run on DeepSeek, GLM or Kimi models. It also breaks in quiet ways when one setting is missing. This post is the settings, what changes on a model that is not Claude, and the errors people have hit with their fixes.
1. The address and the key
Claude Code reads two settings to use another endpoint. It adds /v1/messages to the base URL itself, so the base URL has no /v1 at the end:
export ANTHROPIC_BASE_URL=https://api.uberllm.dev export ANTHROPIC_AUTH_TOKEN=ull_your_key claude Run /status inside Claude Code to see which address it is using.
2. Map every model slot
This is the part people get wrong. Claude Code does not use one model. It has slots, and each one asks for a Claude model name unless you say otherwise:
| Variable | What it sets |
|---|---|
ANTHROPIC_MODEL | The model the session starts on |
ANTHROPIC_DEFAULT_OPUS_MODEL | What opus means |
ANTHROPIC_DEFAULT_SONNET_MODEL | What sonnet means |
ANTHROPIC_DEFAULT_HAIKU_MODEL | What haiku means; also used for background work such as titles and summaries |
CLAUDE_CODE_SUBAGENT_MODEL | The model subagents run on |
A slot left unset keeps asking for a Claude model. On a single-maker endpoint that request fails. On a multi-model endpoint it is served, and you pay Claude prices for it.
3. Tell Claude Code the context size
Claude Code knows the context size of Claude models only. For any other model it assumes 200,000 tokens and compacts the conversation before that.
- If the model has a 1M-token context, end the main model id with
[1m]. - For any other size, set
CLAUDE_CODE_MAX_CONTEXT_TOKENSto the real size.
Do not round up. A context set larger than the model has makes requests fail once the conversation outgrows the model.
4. One block per model family
Model ids are as they were in our catalog on November 19, 2026. All three models take tool calls, which Claude Code needs.
DeepSeek (DeepSeek V4.1 Flash, 1,048,576 tokens of context):
export ANTHROPIC_BASE_URL=https://api.uberllm.dev export ANTHROPIC_AUTH_TOKEN=ull_your_key export ANTHROPIC_MODEL='deepseek/deepseek-v4.1-flash[1m]' 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 GLM (GLM 5.3, 1,000,000 tokens of context):
export ANTHROPIC_BASE_URL=https://api.uberllm.dev export ANTHROPIC_AUTH_TOKEN=ull_your_key export ANTHROPIC_MODEL='z-ai/glm-5.3[1m]' export ANTHROPIC_DEFAULT_OPUS_MODEL='z-ai/glm-5.3' export ANTHROPIC_DEFAULT_SONNET_MODEL='z-ai/glm-5.3' export ANTHROPIC_DEFAULT_HAIKU_MODEL='z-ai/glm-5.3' export CLAUDE_CODE_SUBAGENT_MODEL='z-ai/glm-5.3' claude Kimi (Kimi K3.1 Pro, 1,048,576 tokens of context):
export ANTHROPIC_BASE_URL=https://api.uberllm.dev export ANTHROPIC_AUTH_TOKEN=ull_your_key export ANTHROPIC_MODEL='moonshotai/kimi-k3.1-pro[1m]' export ANTHROPIC_DEFAULT_OPUS_MODEL='moonshotai/kimi-k3.1-pro' export ANTHROPIC_DEFAULT_SONNET_MODEL='moonshotai/kimi-k3.1-pro' export ANTHROPIC_DEFAULT_HAIKU_MODEL='moonshotai/kimi-k3.1-pro' export CLAUDE_CODE_SUBAGENT_MODEL='moonshotai/kimi-k3.1-pro' claude 5. Keep it in a settings file, with the key out of it
Save the key to a file only you can read:
mkdir -p ~/.uberllm && chmod 700 ~/.uberllm printf '%s\n' 'ull_your_key' > ~/.uberllm/key && chmod 600 ~/.uberllm/key Then put the address, a key helper and the model variables in ~/.claude/settings.json (every project) or <project>/.claude/settings.local.json (one project; your other projects stay on your Anthropic plan):
{ "apiKeyHelper": "cat ~/.uberllm/key", "env": { "ANTHROPIC_BASE_URL": "https://api.uberllm.dev", "ANTHROPIC_MODEL": "deepseek/deepseek-v4.1-flash[1m]", "ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek/deepseek-v4.1-flash", "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek/deepseek-v4.1-flash", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek/deepseek-v4.1-flash", "CLAUDE_CODE_SUBAGENT_MODEL": "deepseek/deepseek-v4.1-flash" } } Claude Code runs apiKeyHelper to get the key, so the key is never written into a settings file. Once the file is in place, remove every ANTHROPIC_* variable from your shell and shell profile: a token exported in the shell replaces the saved key, and ANTHROPIC_MODEL exported in the shell beats the model setting.
6. Check that it works
Start Claude Code and run /status. Then test the Messages API directly, which is the address Claude Code calls:
curl https://api.uberllm.dev/v1/messages \ -H "Authorization: Bearer $(cat ~/.uberllm/key)" \ -H "anthropic-version: 2023-06-01" \ -H "content-type: application/json" \ -d '{"model":"deepseek/deepseek-v4.1-flash","max_tokens":16,"messages":[{"role":"user","content":"ping"}]}' Then run a real task in a scratch folder and check that files actually change. Some models are weaker at long tool loops than Claude, and no endpoint fixes that.
7. What changes on a model that is not Claude
- Tool calls. Claude Code works through tool calls, so it needs a model that takes them. On our endpoint a request with tools sent to a model that cannot call them is refused with
400 tools_not_supported. - Thinking blocks. Claude Code requires a
signaturefield on thinking it gets back. Some providers sent DeepSeek's reasoning without it, and a long session could stop. We fixed that on our side on October 28, 2026. - DeepSeek, thinking and tools. DeepSeek's thinking mode wants the reasoning of every earlier turn sent back when tools are used, and answers 400 when it is missing. When a DeepSeek provider refuses a tool call for that reason, we answer the call with thinking off instead of failing it.
- Kimi sampling. Kimi K3 and Kimi K3.1 Pro run at a fixed temperature and top_p and refuse a request that sets its own.
- The cost Claude Code shows is not your bill. It is worked out on your computer from Anthropic's list prices. Look at your provider's usage page.
- Your claude.ai login is not used. Features that need it, such as claude.ai connectors,
/scheduleand Remote Control, are not available. - Your code goes to whoever serves the model. See the trade-offs below.
8. Troubleshooting
| What you see | Cause and fix |
|---|---|
Missing required field in assistant message: 'signature' | The endpoint returned thinking without a signature. Fixed on ours since October 28, 2026; on another endpoint, turn thinking off. |
Parameter 'temperature'=0.5 is not supported for kimi-k3 model. | Kimi runs at a fixed temperature. Since November 18, 2026 we resend such a request without that setting; elsewhere, remove it. |
Your apiKeyHelper script is failing. | The key file is missing or unreadable. Save the key again with the two commands in section 5. |
| Claude Code still asks you to log in, or still uses your Anthropic plan | ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY exported in the shell wins over the saved key. Also, Claude Code reads a project's settings only after you trust that folder. |
| Claude models on your bill | A model slot was left unset. Set ANTHROPIC_MODEL and all four slot variables. |
| Requests fail once the conversation gets long | The context you told Claude Code is larger than the model has. Use the real size. |
400 context_length_exceeded | The prompt is longer than the model takes. The message gives both sizes. |
404 model_not_found | The model id is not in the catalog. GET https://api.uberllm.dev/v1/models lists the ids. |
402 insufficient_credits | The prepaid balance cannot cover the request, so it was not sent. |
503 no_available_provider | Nobody can serve that model right now, even after retries. Retry shortly or pick another model. Nothing was charged. |
429 rate_limited | The key went over its request limit per minute. Wait and retry. |
9. Switch back to Claude
Close the terminal, or clear the variables in it:
unset ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKEN ANTHROPIC_MODEL \ ANTHROPIC_DEFAULT_OPUS_MODEL ANTHROPIC_DEFAULT_SONNET_MODEL \ ANTHROPIC_DEFAULT_HAIKU_MODEL CLAUDE_CODE_SUBAGENT_MODEL \ CLAUDE_CODE_MAX_CONTEXT_TOKENS For a settings file, remove apiKeyHelper and the ANTHROPIC_* entries of its env block. Claude Code goes back to your Anthropic login on the next start.
10. The direct route: each maker's own endpoint
You do not need a marketplace for this. Each maker publishes an Anthropic-compatible endpoint, used with a key from that maker. From each maker's own docs, read on November 19, 2026:
- Kimi (Moonshot AI):
ANTHROPIC_BASE_URLishttps://api.moonshot.ai/anthropicand the model iskimi-k3[1m]. - GLM (Z.ai):
ANTHROPIC_BASE_URLishttps://api.z.ai/api/anthropic. - DeepSeek:
ANTHROPIC_BASE_URLishttps://api.deepseek.com/anthropic. Their page lists what that endpoint ignores, such ascache_controland thebudget_tokensof thinking.
A maker's endpoint serves that maker's models, billed by that maker. Sections 2, 3, 8 and 9 apply to them too.
The trade-offs of doing this through UberLLM
I would rather you read these from me than find them later:
- Third-party sellers. We do not run the models. Each request is served by a third-party provider through a seller's account, and everything the session reads is sent there. Do not use it in a repository that holds secrets, credentials or customer data.
- We save requests for 90 days by default. Each API key has a "Do not save my requests and answers" switch that turns this off.
- Our checks have limits. No software check proves which weights produced an answer. What we test, and what we cannot prove, is at uberllm.dev/verification.
- It is prepaid, from $5, by card or PayPal. There is no free credit. If you only want to try one model family, the maker's own endpoint in section 10 is the simpler test.
- We are a new company with no independent reviews yet.
The full guide, with the current model table, lives at uberllm.dev/answers/claude-code-with-deepseek-glm-kimi. If a setting here is wrong for your version of Claude Code, tell me in the comments and I will fix the post.
