I keep getting an error message when making API requests: "Incorrect API key provided." #3041

Closed
opened 2026-02-21 17:53:06 -05:00 by yindo · 0 comments
Owner

Originally created by @IT-weicheng on GitHub (May 8, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a quesion, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Pleas do not modify this template :) and fill in all the required fields.

Dify version

0.6.6

Cloud or Self Hosted

Cloud, Self Hosted (Docker)

Steps to reproduce

Request context :
curl --location --request POST 'https://api.dify.ai/v1/chat-messages'
--header 'Authorization: Bearer xxxxxx'
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)'
--header 'Content-Type: application/json'
--header 'Accept: /'
--header 'Host: api.dify.ai'
--header 'Connection: keep-alive'
--data-raw '{
"inputs": {},
"query": "waht?",
"response_mode": "blocking",
"user": "111111-123",
"files": [],
"conversation_id":""
}'

Response context:
{
"code": "completion_request_error",
"message": "Incorrect API key provided",
"status": 400
}

image

✔️ Expected Behavior

I developed the application strictly following the API documentation, and the API KEY was just generated, so it should be able to execute successfully.

Actual Behavior

I have generated many keys, but they all show this error message.

Originally created by @IT-weicheng on GitHub (May 8, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a quesion, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Pleas do not modify this template :) and fill in all the required fields. ### Dify version 0.6.6 ### Cloud or Self Hosted Cloud, Self Hosted (Docker) ### Steps to reproduce Request context : curl --location --request POST 'https://api.dify.ai/v1/chat-messages' \ --header 'Authorization: Bearer xxxxxx' \ --header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \ --header 'Content-Type: application/json' \ --header 'Accept: */*' \ --header 'Host: api.dify.ai' \ --header 'Connection: keep-alive' \ --data-raw '{ "inputs": {}, "query": "waht?", "response_mode": "blocking", "user": "111111-123", "files": [], "conversation_id":"" }' Response context: { "code": "completion_request_error", "message": "Incorrect API key provided", "status": 400 } ![image](https://github.com/langgenius/dify/assets/154573082/620dd557-749f-4bc3-851b-d8a7b28955e3) ### ✔️ Expected Behavior I developed the application strictly following the API documentation, and the API KEY was just generated, so it should be able to execute successfully. ### ❌ Actual Behavior I have generated many keys, but they all show this error message.
yindo added the 🐞 bug label 2026-02-21 17:53:06 -05:00
yindo closed this issue 2026-02-21 17:53:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#3041