Configure GitHub Copilot CLI to use DeepSeek V4 models via BYOK (Bring Your Own Key) with the Anthropic-compatible endpoint.
Important: Use
anthropicas the provider type. Theopenaitype triggers a400error:The reasoning_content in the thinking mode must be passed back to the API.— DeepSeek requiresreasoning_contentto be echoed back on subsequent requests, which Copilot CLI's OpenAI integration does not support. The Anthropic Messages API endpoint avoids this issue entirely.
npm install -g @github/copilotRequires Node.js 22 or later. See the official getting-started guide for details.
- Go to DeepSeek Platform and create an API key.
- Copy the key (it starts with
sk-).
Linux / Mac:
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-proWindows (PowerShell):
$env:COPILOT_PROVIDER_TYPE="anthropic"
$env:COPILOT_PROVIDER_BASE_URL="https://api.deepseek.com/anthropic"
$env:COPILOT_PROVIDER_API_KEY="sk-your-deepseek-api-key"
$env:COPILOT_MODEL="deepseek-v4-pro"Available models: deepseek-v4-pro, deepseek-v4-flash. Switch by changing COPILOT_MODEL.
copilotFull agent mode, tool calling, and MCP support — all powered by DeepSeek.
Since deepseek-v4-pro is not in Copilot CLI's built-in model catalog, configure the token limits explicitly:
Linux / Mac:
export COPILOT_PROVIDER_MAX_PROMPT_TOKENS=840000
export COPILOT_PROVIDER_MAX_OUTPUT_TOKENS=128000Windows (PowerShell):
$env:COPILOT_PROVIDER_MAX_PROMPT_TOKENS="840000"
$env:COPILOT_PROVIDER_MAX_OUTPUT_TOKENS="128000"Run copilot help providers for all available environment variables.
Linux / Mac:
export COPILOT_OFFLINE=trueWindows (PowerShell):
$env:COPILOT_OFFLINE="true"Note: your prompts still go to api.deepseek.com — offline mode only blocks GitHub's API calls.