Updated 2026-06-16

DeepSeek GitHub Copilot CLI setup: use the official Anthropic route and stop fighting the wrong provider type

DeepSeek now documents a first-party GitHub Copilot CLI setup path in its own API docs, and the key detail is not cosmetic. The official page says teams should use the Anthropic-compatible endpoint, not the OpenAI provider type, because the OpenAI path can trigger a `400` error when Copilot CLI fails to pass `reasoning_content` back on subsequent requests. That makes this a strong long-tail guide for developers who want DeepSeek inside Copilot CLI without trial-and-error endpoint debugging.

1. Why DeepSeek tells Copilot CLI users to choose the Anthropic route

DeepSeek's official Copilot CLI page is unusually explicit: use `anthropic` as the provider type. This is not a preference tip. It is the documented way to avoid a real request-shape mismatch.

The same page says the `openai` provider path triggers a `400` error because Copilot CLI's OpenAI integration does not echo `reasoning_content` back on later requests. DeepSeek's Anthropic Messages endpoint avoids that entire problem.

Sources checked

2. Install Copilot CLI and confirm the runtime baseline

DeepSeek's page installs GitHub Copilot CLI with `npm install -g @github/copilot` and says Node.js 22 or later is required. Start there before you debug provider wiring.

If the binary is already installed but a teammate copied an older setup note, confirm the Node.js version and the binary path before changing environment variables. The official DeepSeek page assumes a modern Copilot CLI baseline.

npm install -g @github/copilot
node --version
copilot --version

3. The official DeepSeek environment contract

DeepSeek's documented Linux and macOS setup is straightforward: set `COPILOT_PROVIDER_TYPE=anthropic`, point `COPILOT_PROVIDER_BASE_URL` at `https://api.deepseek.com/anthropic`, pass a DeepSeek API key, and set `COPILOT_MODEL` to `deepseek-v4-pro`.

The same page says `deepseek-v4-flash` is also available. Treat Pro as the documented baseline and Flash as the cheaper lane when the workload is broader, faster, or more repetitive.

export COPILOT_PROVIDER_TYPE=anthropic
export COPILOT_PROVIDER_BASE_URL=https://api.deepseek.com/anthropic
export COPILOT_PROVIDER_API_KEY=sk-your-deepseek-api-key
export COPILOT_MODEL=deepseek-v4-pro

copilot

4. Why the token-limit settings matter

DeepSeek's page adds one detail that many generic tutorials miss: because `deepseek-v4-pro` is not in Copilot CLI's built-in catalog, the docs tell users to set token ceilings explicitly.

The official values are `840000` max prompt tokens and `128000` max output tokens. Those numbers matter for correctness as much as for UX, because a custom model route is only stable when the client understands the model's bounds.

export COPILOT_PROVIDER_MAX_PROMPT_TOKENS=840000
export COPILOT_PROVIDER_MAX_OUTPUT_TOKENS=128000

Sources checked

5. What offline mode does and does not do

DeepSeek's docs also publish an offline mode flag: `COPILOT_OFFLINE=true`. The name can mislead teams if they do not read the note carefully.

The page says offline mode only blocks GitHub API calls. Your prompts still go to `api.deepseek.com`. That means offline mode is about reducing GitHub-side dependencies, not about local model execution or air-gapped inference.

export COPILOT_OFFLINE=true

6. When to use Pro versus Flash in Copilot CLI

DeepSeek's official examples start with `deepseek-v4-pro`, which is the right documented baseline for quality-sensitive coding-agent work. Use that when you are validating a new setup or need more careful reasoning.

Switch to `deepseek-v4-flash` when the Copilot CLI session is mostly repeated shell help, broad repo exploration, or lower-cost everyday coding. The important rule is to keep the provider and endpoint contract unchanged while you benchmark model choice.

If your team also uses the VS Code chat extension, compare this page with `/guides/deepseek-github-copilot-chat` because the extension flow and the CLI BYOK flow are related but not identical.

FAQ

Why does DeepSeek say to use `anthropic` in GitHub Copilot CLI?

Because DeepSeek's official docs say the OpenAI provider path can trigger a `400` error when Copilot CLI does not pass `reasoning_content` back on later requests, while the Anthropic-compatible route avoids that problem.

Which base URL should Copilot CLI use for DeepSeek?

Use `https://api.deepseek.com/anthropic`, which is the official base URL on DeepSeek's Copilot CLI page.

Can I use DeepSeek V4 Flash instead of Pro?

Yes. DeepSeek's page lists both `deepseek-v4-pro` and `deepseek-v4-flash`. Start from Pro as the documented baseline, then switch to Flash for cheaper everyday traffic when the workflow still behaves well.

What token limits should I set?

DeepSeek's official page lists `840000` max prompt tokens and `128000` max output tokens for the custom DeepSeek route in Copilot CLI.

Does offline mode mean prompts stay on my machine?

No. The official docs say offline mode only blocks GitHub API calls. Prompts still go to `api.deepseek.com`.

The practical DeepSeek Copilot CLI rule is simple: do not brute-force the OpenAI path. Use the official Anthropic-compatible endpoint, keep the documented token limits in place, and treat Pro versus Flash as a routing choice after the baseline configuration is already stable.

Related model comparisons

Continue from this guide into structured DeepSeek-first comparison pages with model tables, routing advice, and pricing context.