[GH-ISSUE #82] API returning 401 error #69

Closed
opened 2026-10-26 21:12:55 +00:00 by bsakaguchi · 6 comments
Owner

Originally created by @efijoon on GitHub (Jan 26, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/82

There was no official github repo for the api so i post this here. lmk if i should post it somewhere else.
The issue is i had created my api key via https://platform.deepseek.com/api_keys and put it in my code. (I had charged my account for 2$ also before i create the api key). But when i want to request to the api it returns a response with 401 status which is:

{
    "error": {
        "message": "Authentication Fails (no such user)",
        "type": "authentication_error",
        "param": null,
        "code": "invalid_request_error"
    }
}

My request object is:

curl --location 'https://api.deepseek.com/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer sk-40b7a17adc70******83215c69cebc2f' \
--data '{
    "model": "deepseek-chat",
    "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"}
    ],
    "stream": false
}'

I had tried waiting for a couple of hours and also creating new api keys but it will not work at all!
Please lmk if i made any mistake during connecting to the api.

Originally created by @efijoon on GitHub (Jan 26, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/82 There was no official github repo for the api so i post this here. lmk if i should post it somewhere else. The issue is i had created my api key via https://platform.deepseek.com/api_keys and put it in my code. (I had charged my account for 2$ also before i create the api key). But when i want to request to the api it returns a response with 401 status which is: ```json { "error": { "message": "Authentication Fails (no such user)", "type": "authentication_error", "param": null, "code": "invalid_request_error" } } ``` My request object is: ```bash curl --location 'https://api.deepseek.com/chat/completions' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer sk-40b7a17adc70******83215c69cebc2f' \ --data '{ "model": "deepseek-chat", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello!"} ], "stream": false }' ``` I had tried waiting for a couple of hours and also creating new api keys but it will not work at all! Please lmk if i made any mistake during connecting to the api.
Author
Owner

@scottdeift commented on GitHub (Jan 27, 2025):

https://status.deepseek.com/

Monitoring
V3 api is recovering...
Posted 30 minutes ago. Jan , - CST 27202512:02
Update
R1 api is working,V3 api is recovering...
Posted 32 minutes ago. Jan , - CST 27202512:00
Identified
The issue has been identified and a fix is being implemented.
Posted 33 minutes ago. Jan , - CST 27202511:58
Update
R1 api is working,V3 api is recovering...
Posted 1 hour ago. Jan , - CST 27202511:32
Update
We are continuing to investigate this issue.
Posted 1 hour ago. Jan , - CST 27202511:20
Investigating
We are currently investigating this issue.
Posted 2 hours ago. Jan , - CST 27202510:55

<!-- gh-comment-id:2614833578 --> @scottdeift commented on GitHub (Jan 27, 2025): https://status.deepseek.com/ Monitoring V3 api is recovering... Posted 30 minutes ago. Jan , - CST 27202512:02 Update R1 api is working,V3 api is recovering... Posted 32 minutes ago. Jan , - CST 27202512:00 Identified The issue has been identified and a fix is being implemented. Posted 33 minutes ago. Jan , - CST 27202511:58 Update R1 api is working,V3 api is recovering... Posted 1 hour ago. Jan , - CST 27202511:32 Update We are continuing to investigate this issue. Posted 1 hour ago. Jan , - CST 27202511:20 Investigating We are currently investigating this issue. Posted 2 hours ago. Jan , - CST 27202510:55
Author
Owner

@TomaKatzarov commented on GitHub (Jan 27, 2025):

Hello Team, I am still experiencing high amount of api request fails . Example : invalid response body while trying to fetch https://api.deepseek.com/v1/chat/completions: read ECONNRESET

<!-- gh-comment-id:2615068421 --> @TomaKatzarov commented on GitHub (Jan 27, 2025): Hello Team, I am still experiencing high amount of api request fails . Example : invalid response body while trying to fetch https://api.deepseek.com/v1/chat/completions: read ECONNRESET
Author
Owner

@Kakad3v commented on GitHub (Jan 28, 2025):

There was no official github repo for the api so i post this here. lmk if i should post it somewhere else. The issue is i had created my api key via https://platform.deepseek.com/api_keys and put it in my code. (I had charged my account for 2$ also before i create the api key). But when i want to request to the api it returns a response with 401 status which is:

{
"error": {
"message": "Authentication Fails (no such user)",
"type": "authentication_error",
"param": null,
"code": "invalid_request_error"
}
}
My request object is:

curl --location 'https://api.deepseek.com/chat/completions'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer sk-40b7a17adc70******83215c69cebc2f'
--data '{
"model": "deepseek-chat",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"stream": false
}'
I had tried waiting for a couple of hours and also creating new api keys but it will not work at all! Please lmk if i made any mistake during connecting to the api.

I had the same issue but for for me I had not paid. Once I paid, I deleted the old API KEY and created a new. Remember to change it on your code too.

<!-- gh-comment-id:2618020500 --> @Kakad3v commented on GitHub (Jan 28, 2025): > There was no official github repo for the api so i post this here. lmk if i should post it somewhere else. The issue is i had created my api key via https://platform.deepseek.com/api_keys and put it in my code. (I had charged my account for 2$ also before i create the api key). But when i want to request to the api it returns a response with 401 status which is: > > { > "error": { > "message": "Authentication Fails (no such user)", > "type": "authentication_error", > "param": null, > "code": "invalid_request_error" > } > } > My request object is: > > curl --location 'https://api.deepseek.com/chat/completions' \ > --header 'Content-Type: application/json' \ > --header 'Authorization: Bearer sk-40b7a17adc70******83215c69cebc2f' \ > --data '{ > "model": "deepseek-chat", > "messages": [ > {"role": "system", "content": "You are a helpful assistant."}, > {"role": "user", "content": "Hello!"} > ], > "stream": false > }' > I had tried waiting for a couple of hours and also creating new api keys but it will not work at all! Please lmk if i made any mistake during connecting to the api. I had the same issue but for for me I had not paid. Once I paid, I deleted the old API KEY and created a new. Remember to change it on your code too.
Author
Owner

@miguroi commented on GitHub (Feb 18, 2025):

I had the same issue and couldn't resolve it even after deleting my old API key and created a new one. Any updates?

<!-- gh-comment-id:2665053391 --> @miguroi commented on GitHub (Feb 18, 2025): I had the same issue and couldn't resolve it even after deleting my old API key and created a new one. Any updates?
Author
Owner

@Ziqiao-git commented on GitHub (Feb 26, 2025):

How did you guys fix the problem?

<!-- gh-comment-id:2683967112 --> @Ziqiao-git commented on GitHub (Feb 26, 2025): How did you guys fix the problem?
Author
Owner

@efijoon commented on GitHub (Feb 26, 2025):

So the issue was at that time deepseek servers was under attack and therefore it didnt work. But when it got up again. I just deleted the old api key and created a new and its now working all fine.

<!-- gh-comment-id:2683971638 --> @efijoon commented on GitHub (Feb 26, 2025): So the issue was at that time deepseek servers was under attack and therefore it didnt work. But when it got up again. I just deleted the old api key and created a new and its now working all fine.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepSeek-R1#69
No description provided.