github / github/copilot-cli

Can´t use DeepSeek API

Open
#2,995 8 comments 9 reactions 0 assignees View on GitHub
area:configuration area:models
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

### Describe the bug

When I run the following command:

```bash
export COPILOT_PROVIDER_BASE_URL="https://api.deepseek.com" \
export COPILOT_PROVIDER_API_KEY="...." \
export COPILOT_PROVIDER_TYPE="openai" \
export COPILOT_MODEL="deepseek-v4-pro" \
copilot
```

When I make a question to the copilot, I get this answer back:

```
● Request failed (transient_bad_request). Retrying...
● Request failed (transient_bad_request). Retrying...
✗ 400 The `reasoning_content` in the thinking mode must be passed back to the API.
```

I confirm that the DeepSeek API needs the entire reasoning_content field to be returned back to the API every time. In my own code I had the same problem and could rapidly fix the issue by sending back the the entire conversation.

### Affected version

_No response_

### Steps to reproduce the behavior

I run the following command:

```bash
export COPILOT_PROVIDER_BASE_URL="https://api.deepseek.com" \
export COPILOT_PROVIDER_API_KEY="...." \
export COPILOT_PROVIDER_TYPE="openai" \
export COPILOT_MODEL="deepseek-v4-pro" \
copilot
```

Ensure to have a valid api key for the DeepSeek endpoint

### Expected behavior

I expect the request to be fulfilled.

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue through the `copilot` entry point with the documented DeepSeek environment variables and inspect how the request conversation is assembled. The fix is done when the complete `reasoning_content` is passed back to the DeepSeek API and the request succeeds without the 400 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.