mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
Error reported when uploading a model using OpenAI-API-compatible #614
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Nolan-Yin on GitHub (Sep 4, 2025).
Self Checks
Dify version
1.6.0
Plugin version
OpenAI-API-compatible==0.0.19
Cloud or Self Hosted
Cloud
Steps to reproduce
Use the 'openai'api_compatible' plugin to upload the model, and the upload is successful (the successful model is displayed in the frontend list).
Then when creating the application, an error message ''' Use the "openai'api_compatible" plugin to upload a model, which shows that the upload was successful (the model is successfully displayed in the frontend list). Then, when creating an application, select the model and try running it, an error message will appear with the error message "[openai'api_compatible] Error: PluginInvoke Error: {" rgs ": {" description ":" [models] Error: API request failed with status code 401: {\ "error ": {\ "message ": \ "Incorrect API key provided. " code \ ": " invalid_mapi_key \ "}, " request_id \ ": " 99eb87a4-50d6-9c0e-b667-08d6a53e5ee5 \ "}"}, "err_type": "Invoke Error", "message":"[models] Error: API request failed with status code 401: {"error":{"message":"Incorrect API key provided. ","type":"invalid_request_error","param":null,"code":"invalid_api_key"},"request_id":"99eb87a4-50d6-9c0e-b667-08d6a53e5ee5"}"}''', Display 'model xxxxx credentials is not initialized' when 'go to chat' on the application.
It is worth mentioning that when using admin tenants to perform the above operations, this situation was not encountered. And when using other plugins (通义千问) to upload the same model, it can also be used normally.
✔️ Error log
'''
[openai_api_compatible] Error: PluginInvokeError: {"args":{"description":"[models] Error: API request failed with status code 401: {"error":{"message":"Incorrect API key provided. ","type":"invalid_request_error","param":null,"code":"invalid_api_key"},"request_id":"99eb87a4-50d6-9c0e-b667-08d6a53e5ee5"}"},"error_type":"InvokeError","message":"[models] Error: API request failed with status code 401: {"error":{"message":"Incorrect API key provided. ","type":"invalid_request_error","param":null,"code":"invalid_api_key"},"request_id":"99eb87a4-50d6-9c0e-b667-08d6a53e5ee5"}"}
'''
/////
'''' Model qwen-plus-latest credentials is not initialized '''
@dosubot[bot] commented on GitHub (Sep 4, 2025):
Hi @Nolan-Yin! I'm Dosu and I’m helping the dify-official-plugins team.
The "Incorrect API key provided" and "credentials is not initialized" errors with the OpenAI-API-compatible plugin are almost always caused by missing, invalid, or improperly configured API keys in the model provider settings. For non-admin tenants, credentials must be explicitly initialized and linked to each model/provider—admin tenants often bypass this due to global or default credential access, which is why they don't see the issue. Recent Dify updates have introduced more granular, per-model credential management and new UI flows for credential selection, especially for non-admins. If credentials are not properly set or selected during model upload, you'll see these errors in the UI and logs. Make sure the API key is correctly entered in the provider settings, and that the credential is explicitly initialized and selected for the model you want to use. If your Dify Cloud instance has recently updated, you may need to revisit the credential setup for each model to ensure compatibility with the new multi-credential system and UI flows. More details and similar issues are discussed here and here. Recent PRs like #24451 and #24994 have changed credential handling, so reviewing your credential setup is recommended.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
