Help! How to get credential id for model authentication? #30064
Replies: 1 comment
-
|
To get the credential ID for model authentication in Dify (for example, after adding an LLM provider like Aliyun that registers many models), you have a few options: 1. Dify UI: 2. Programmatically (API/backend): const { data: modelProviders } = useModelProviders()
const availableCredentials = modelProviders
?.find(p => p.provider === model?.provider)
?.custom_configuration?.available_credentials || []Each credential object has a 3. Database (manual): SELECT id, credential_name FROM provider_model_credentials WHERE provider_name = 'aliyun';
SELECT credential_id FROM provider_models WHERE provider_name = 'aliyun';If you have migration or upgrade issues (e.g., missing or mismatched credential IDs), you may need to manually repair the database by ensuring each model's Let me know if you need step-by-step SQL or Python scripts for your setup! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
Assume you add a llm provider like aliyun, dify will add 100+ models but not give you the credential id back, Is there a way to get the credential id? Thank you
2. Additional context or comments
No response
Beta Was this translation helpful? Give feedback.
All reactions