Unable to use international Model Studio Embedding API in Dify #505

Closed
opened 2026-02-16 10:19:36 -05:00 by yindo · 3 comments
Owner

Originally created by @davidygp on GitHub (Aug 1, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.71

Cloud or Self Hosted

Cloud

Steps to reproduce

Issue: Invalid API key when using international Model Studio in Dify Knowledge Base

Image [tongyi] Error:PluginInvokeError: {"args":{"description":" [models] Error:Response output is missing or does not contain embeddings:{"status_codel": 401, ("request_id)": |"3e17afdd-bbd5-935e-bd79-fa55958a5a23\", \"code|":\"InvalidApiKey)", \"message)":\"Invalid API-key provided.)", ("output)": null, ("usage)":null}"},"error_type":"InvokeError" "message":"[models] Error:Response output is missing or does not contain embeddings:{l"status_code)": 401, ("request_id)": |"3e17afdd-bbd5-935e-bd79-fa55958a5a23\", \"code|":\"InvalidApiKey)", \"message)":\"Invalid API-key provided.)", ("'output)": null, \"usage)":null}"}

API key is taken from Model Studio international console:
Image

Key works when calling it directly with the international endpoint:
Image

text-embedding-v3 is selected:
Image

I believe it's because the endpoint is pointing towards the domestic Bailian embedding endpoint.
-> #NOTE: the URL pointing to the wrong endpoint was also there for the Tongyi plugin (we had to provide a button to select international or domestic endponts.)
-> #NOTE2: haven't been able to test any re-ranker model, might have the same issue

✔️ Expected Behavior

Expected it to smoothly call the embedding API and embed the chunks into the knowledge base.
(I tested it with an API key created from domestic Bailian and there's no issue. But it doesn't work with API key from international Model Studio.)

Actual Behavior

Image [tongyi] Error:PluginInvokeError: {"args":{"description":" [models] Error:Response output is missing or does not contain embeddings:{"status_codel": 401, ("request_id)": |"3e17afdd-bbd5-935e-bd79-fa55958a5a23\", \"code|":\"InvalidApiKey)", \"message)":\"Invalid API-key provided.)", ("output)": null, ("usage)":null}"},"error_type":"InvokeError" "message":"[models] Error:Response output is missing or does not contain embeddings:{l"status_code)": 401, ("request_id)": |"3e17afdd-bbd5-935e-bd79-fa55958a5a23\", \"code|":\"InvalidApiKey)", \"message)":\"Invalid API-key provided.)", ("'output)": null, \"usage)":null}"}
Originally created by @davidygp on GitHub (Aug 1, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, 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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.71 ### Cloud or Self Hosted Cloud ### Steps to reproduce Issue: Invalid API key when using international Model Studio in Dify Knowledge Base <img width="1130" height="1246" alt="Image" src="https://github.com/user-attachments/assets/edda1ae4-6509-4265-abbc-17672df9cf63" /> [tongyi] Error:PluginInvokeError: {"args":{"description":" [models] Error:Response output is missing or does not contain embeddings:{"status_codel": 401, ("request_id)": |"3e17afdd-bbd5-935e-bd79-fa55958a5a23\", \"code|":\"InvalidApiKey)", \"message)":\"Invalid API-key provided.)", ("output)": null, ("usage)":null}"},"error_type":"InvokeError" "message":"[models] Error:Response output is missing or does not contain embeddings:{l"status_code)": 401, ("request_id)": |"3e17afdd-bbd5-935e-bd79-fa55958a5a23\", \"code|":\"InvalidApiKey)", \"message)":\"Invalid API-key provided.)", ("'output)": null, \"usage)":null}"} API key is taken from Model Studio international console: <img width="2750" height="458" alt="Image" src="https://github.com/user-attachments/assets/c5dbddb2-70c8-4602-8ada-c4547f318709" /> Key works when calling it directly with the international endpoint: <img width="2560" height="1088" alt="Image" src="https://github.com/user-attachments/assets/21326ad7-3b46-455f-89d5-e9dede13cce2" /> text-embedding-v3 is selected: <img width="1796" height="1588" alt="Image" src="https://github.com/user-attachments/assets/99f96930-0a0f-4462-bddd-313ebeae58e2" /> I believe it's because the endpoint is pointing towards the domestic Bailian embedding endpoint. -> #NOTE: the URL pointing to the wrong endpoint was also there for the Tongyi plugin (we had to provide a button to select international or domestic endponts.) -> #NOTE2: haven't been able to test any re-ranker model, might have the same issue ### ✔️ Expected Behavior Expected it to smoothly call the embedding API and embed the chunks into the knowledge base. (I tested it with an API key created from domestic Bailian and there's no issue. But it doesn't work with API key from international Model Studio.) ### ❌ Actual Behavior <img width="1130" height="1246" alt="Image" src="https://github.com/user-attachments/assets/edda1ae4-6509-4265-abbc-17672df9cf63" /> [tongyi] Error:PluginInvokeError: {"args":{"description":" [models] Error:Response output is missing or does not contain embeddings:{"status_codel": 401, ("request_id)": |"3e17afdd-bbd5-935e-bd79-fa55958a5a23\", \"code|":\"InvalidApiKey)", \"message)":\"Invalid API-key provided.)", ("output)": null, ("usage)":null}"},"error_type":"InvokeError" "message":"[models] Error:Response output is missing or does not contain embeddings:{l"status_code)": 401, ("request_id)": |"3e17afdd-bbd5-935e-bd79-fa55958a5a23\", \"code|":\"InvalidApiKey)", \"message)":\"Invalid API-key provided.)", ("'output)": null, \"usage)":null}"}
yindo closed this issue 2026-02-16 10:19:36 -05:00
Author
Owner

@crazywoola commented on GitHub (Aug 1, 2025):

Please confirm your API key is accquired from the international aliyun platform.

@crazywoola commented on GitHub (Aug 1, 2025): Please confirm your API key is accquired from the international aliyun platform.
Author
Owner

@davidygp commented on GitHub (Aug 3, 2025):

Image

Yes it was, see the above screenshot showing it comes from International Model Studio.

I also used the following endpoint in the local vscode screenshot above:
https://dashscope-intl.aliyuncs.com/compatible-mode/v1

It comes from this documentation:
https://www.alibabacloud.com/help/en/model-studio/text-embedding-synchronous-api

@davidygp commented on GitHub (Aug 3, 2025): <img width="1736" height="550" alt="Image" src="https://github.com/user-attachments/assets/7b2b08a3-9b64-48fe-aafd-b786253366cb" /> Yes it was, see the above screenshot showing it comes from International Model Studio. I also used the following endpoint in the local vscode screenshot above: https://dashscope-intl.aliyuncs.com/compatible-mode/v1 It comes from this documentation: https://www.alibabacloud.com/help/en/model-studio/text-embedding-synchronous-api
Author
Owner

@dosubot[bot] commented on GitHub (Aug 20, 2025):

Hi, @davidygp. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported an "Invalid API key" error when using an API key from the international Model Studio console with Dify version 1.71 (cloud).
  • This error affects access to the Model Studio Embedding API, causing missing embeddings and issues with the Dify Knowledge Base.
  • The maintainer requested confirmation about the API key origin, which you provided, confirming it is from the international aliyun platform.
  • The problem seems related to API key validation specifically for the international Model Studio Embedding API.
  • The issue remains unresolved with no further updates.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here.
  • If I do not hear back within 5 days, this issue will be automatically closed.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 20, 2025): Hi, @davidygp. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported an "Invalid API key" error when using an API key from the international Model Studio console with Dify version 1.71 (cloud). - This error affects access to the Model Studio Embedding API, causing missing embeddings and issues with the Dify Knowledge Base. - The maintainer requested confirmation about the API key origin, which you provided, confirming it is from the international aliyun platform. - The problem seems related to API key validation specifically for the international Model Studio Embedding API. - The issue remains unresolved with no further updates. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here. - If I do not hear back within 5 days, this issue will be automatically closed. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#505