---
title: "DeepSeek in Claude Code — for a whole team · Selan"
description: "DeepSeek runs in Claude Code through any endpoint that speaks Anthropic's API. Run it for a team on Ollama Cloud or OpenRouter, with no key on a laptop."
url: https://selan.ai/guides/deepseek-in-claude-code
updated: 2026-10-19T06:54:39+00:00
---

Guide · Other models in Claude Code

# How do you run DeepSeek in Claude Code?

Point Claude Code at an endpoint that serves DeepSeek in Anthropic's API format, then name the model. DeepSeek publishes one such endpoint, and Ollama Cloud and OpenRouter serve DeepSeek V4.1 Flash and V4 Pro too. Through Selan, an owner connects the company's Ollama Cloud plan or OpenRouter key once. Each developer then runs `selan claude --model ollama:deepseek-v4.1-flash`.

## Why does DeepSeek work in Claude Code at all?

Claude Code sends every request in Anthropic's Messages format. It reaches another server when `ANTHROPIC_BASE_URL` is set to that server's address.

DeepSeek serves its models in that same format, at `https://api.deepseek.com/anthropic`. Ollama Cloud and OpenRouter answer in it too.

So unlike GPT, DeepSeek needs no translation in the middle. What it needs is the right model names, the right window and a key. How GPT differs is in [running GPT in Claude Code](https://selan.ai/guides/gpt-in-claude-code).

## How do you set up DeepSeek in Claude Code by hand?

DeepSeek's own guide sets nine environment variables before you start Claude Code:

-   the base URL above, and your DeepSeek API key as `ANTHROPIC_AUTH_TOKEN`
-   `deepseek-flash[1m]` as the main model, and as the Opus and Sonnet model
-   `deepseek-flash` as the Haiku model and the subagent model
-   `CLAUDE_CODE_AUTO_COMPACT_WINDOW` at `786432`, and the effort level at `max`

DeepSeek's endpoint maps Claude names too. A name starting with `claude-opus` runs on DeepSeek V4 Pro, at V4 Pro's price. Any other Claude name runs on DeepSeek Flash.

Its Anthropic format has gaps. It ignores `cache_control` and `mcp_servers`, and it does not take documents such as PDFs.

That works for one person. On a team, it is one DeepSeek key and one set of variables per laptop, and no shared view of what DeepSeek costs. Why a key on every laptop is the expensive part is in [keeping API keys off laptops](https://selan.ai/guides/claude-code-without-api-keys).

## How do you run DeepSeek in Claude Code through Selan?

An owner connects an Ollama Cloud plan or an OpenRouter key in Selan. DeepSeek V4.1 Flash and V4 Pro are models Selan lists, so an owner also switches each one on at that provider under [Settings → Models](https://control.selan.ai/settings/models).

Developers install the `selan` CLI, sign in as themselves and name the model:

```bash
selan claude --model ollama:deepseek-v4.1-flash
```

The part before the first colon is the provider. Everything after it is that provider's own model id, passed through as it is.

With `--model`, Selan tells Claude Code the model's real context window. Selan lists DeepSeek V4.1 Flash at 1,048,576 tokens and V4 Pro at 1,000,000, so a session compacts there and not at 200K. If an owner set a lower context limit for your company, it compacts at that instead.

Both start at `high` effort, and Selan offers `low`, `high` and `max` for them. V4.1 Flash reads images. V4 Pro takes text only.

To skip the flag, an owner adds DeepSeek to Claude Code's picker under [Settings → Model pickers](https://control.selan.ai/settings/pickers). It then appears in `/model`. The details are in [Run any model](https://selan.ai/docs#any-model).

## Which account does a DeepSeek turn run on?

| Route | How it bills | Name it as |
| --- | --- | --- |
| An Ollama Cloud plan | One flat monthly price, no per-token bill | `ollama:deepseek-v4.1-flash`  
`ollama:deepseek-v4-pro:0813` |
| An OpenRouter key | Per token, on your OpenRouter invoice | `openrouter:deepseek/deepseek-v4.1-flash`  
`openrouter:deepseek/deepseek-v4-pro-0813` |

A DeepSeek turn runs on the provider its name points at, and on no other.

If that account is out of quota, the request fails rather than moving to the other one.

Selan does not connect DeepSeek's own API. It reaches DeepSeek through Ollama Cloud and OpenRouter. All of this is on [Providers and models](https://selan.ai/docs/providers).

## What does a team get beyond the model?

-   **One usage record.** DeepSeek turns land beside Claude turns, per person and per repository. [Usage per developer](https://selan.ai/guides/claude-code-usage-per-developer) shows what an owner sees.
-   **One spend limit.** An OpenRouter turn is metered, so it counts against a member's limit. A turn on an Ollama flat plan does not. See [spend limits](https://selan.ai/solutions/spend).
-   **No DeepSeek or OpenRouter key on a laptop.** Keys stay on the gateway. A developer holds a Selan session you can revoke.
-   **Codex on the same accounts.** `selan codex --model ollama:deepseek-v4.1-flash` uses the same route. Without the provider in front, Codex means the model itself, and Selan falls through your accounts for it. See [Codex](https://selan.ai/docs/codex#model).

## What should you check before switching a team to DeepSeek?

-   **Effort and spend.** DeepSeek thinks before it answers. On OpenRouter, the thinking is metered too.
-   **The model must be switched on.** A model your company cannot use is refused before Claude Code starts, not at the first request.
-   **Pick the model by the job.** V4 Pro has no image input, so a screenshot in a session needs V4.1 Flash.

**Good to know:** Anthropic doesn't support routing Claude Code to non-Claude models through any gateway, Selan included. A DeepSeek session is the gateway's to answer for, not Anthropic's.

[Start for free](https://selan.ai/pricing)

Free for up to three seats, and the Free plan needs no card.

### The short version

-   DeepSeek is served in Anthropic's API format, so Claude Code reaches it with no translation.
-   By hand, that is nine variables and a DeepSeek key on every laptop.
-   Through Selan, a developer runs `selan claude --model ollama:deepseek-v4.1-flash`, at the model's own window.
-   DeepSeek runs on your Ollama Cloud plan or OpenRouter key, with one usage record and no key on a laptop.

The manual setup is DeepSeek's guide to Claude Code and its Anthropic API page, and Anthropic's position is its LLM gateway docs, all as read on 19 October 2026. What Selan does is its model list, its CLI and its providers, Codex and getting-started docs as they stood on the same day.
