Guide

How to use DeepSeek in Claude Code

Run Claude Code on DeepSeek V4.1 Flash through Nexum Router's Anthropic-compatible API: three environment variables, no proxy to host, on a flat $5.50/week plan.

By the Dialagram team Updated 3 min read

Why run DeepSeek in Claude Code

Claude Code is the agent; the model behind it is a setting. Nexum Router serves DeepSeek V4.1 Flash on an Anthropic-compatible endpoint, so Claude Code's tools, slash commands and sessions work unchanged while DeepSeek writes the code, with a 200,000-token context window. The answers come from DeepSeek V4.1 Flash, not from Anthropic's Claude models.

Step 1: Create an account and an API key

Create an account at /router/auth, subscribe for $5.50/week, and create an API key in the dashboard at /router. Nexum Router keys start with dgr_live_.

Step 2: Point Claude Code at the router and pin DeepSeek

Set ANTHROPIC_BASE_URL to the router's Anthropic-compatible endpoint, /router/claude, ANTHROPIC_AUTH_TOKEN to your dgr_live_ key, and ANTHROPIC_MODEL to deepseek-v4.1-flash, then start claude as usual.
export ANTHROPIC_BASE_URL="https://dialagram.me/router/claude"
export ANTHROPIC_AUTH_TOKEN="dgr_live_your-key"
export ANTHROPIC_MODEL="deepseek-v4.1-flash"
claude

Step 3: Make the setting permanent

Put the same three variables in the env block of ~/.claude/settings.json so every new terminal and every project runs on DeepSeek without exporting anything.
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://dialagram.me/router/claude",
    "ANTHROPIC_AUTH_TOKEN": "dgr_live_your-key",
    "ANTHROPIC_MODEL": "deepseek-v4.1-flash"
  }
}

Step 4: Save DeepSeek as your Claude Code Model

Some requests Claude Code makes still carry its own model names, which the router does not serve; those go to the model saved under Claude Code Model in the dashboard at /router. Save DeepSeek V4.1 Flash there so those requests run on DeepSeek too.

What DeepSeek usage costs

The flat $5.50/week plan includes $5 of DeepSeek V4.1 Flash usage every day, renewed daily: $35 a week at no extra cost. Unused daily usage does not roll over, and you can add DeepSeek credits from the dashboard at /router. The Qwen, Xiaomi Mimo and Meta Muse Spark models on the same key have no daily allowance, no hourly windows and no weekly caps.

Nexum Router or the DeepSeek API directly?

DeepSeek's own platform bills per token from a balance you top up. Nexum Router is one flat weekly subscription: the daily DeepSeek allowance is included, and the same key also runs the Xiaomi Mimo and Meta Muse Spark models in Claude Code and the Qwen models in OpenAI-compatible tools. Plan prices and limits side by side: Claude Code alternatives compared.

Switch models without changing anything else

Set ANTHROPIC_MODEL to any of these model IDs, or unset it to use the model saved in the dashboard.

  • Nexum Router — nexum-router
  • DeepSeek V4.1 Flash — deepseek-v4.1-flash
  • Xiaomi Mimo 2.6 — xiaomi-mimo-2.6
  • Xiaomi Mimo 2.5 — xiaomi-mimo-2.5
  • Meta Muse Spark 1.2 — meta-muse-spark-1.2
  • Meta Muse Spark 1.3 — meta-muse-spark-1.3

Troubleshooting

  • 401 or invalid API key: the token must be your dgr_live_ key, set as ANTHROPIC_AUTH_TOKEN (ANTHROPIC_API_KEY works too).
  • "Model ... is not available on the Claude-compatible route": ANTHROPIC_MODEL names a model this endpoint does not serve. Pick an ID from the list above, or unset it.
  • "Set a Claude route model in the Nexum Router dashboard": no model could be served for your account. Save a Claude Code Model in the dashboard's model catalog; if that model is temporarily unavailable, the error then says so and another model or a retry fixes it.
  • Context too long: the router answers an over-window request with a context-length error so the client can compact; each model's window is listed at /router/v1/models.

More setup guides

The general Claude Code setup is at Claude Code API setup, and the same key runs DeepSeek in opencode: DeepSeek in opencode. Pricing, limits and the full model list are in the FAQ.

Does this give me Claude models?

No. Claude Code is the client. Nexum Router does not serve Anthropic's Claude models; the models above answer every request.