Canonical docs: https://apidoc.cometapi.com/integrations/dify
Use this guide to connect Dify to CometAPI by setting the base URL, API key, and model or provider options. Dify is an open-source LLM application development platform. By connecting it to CometAPI, you can use current CometAPI model IDs inside Dify's workflow, chatbot, and agent builders.
- A CometAPI account with an active API key — sign in to get one
- A Dify account — cloud or self-hosted
The easiest way to connect. Dify Marketplace provides an official CometAPI plugin that handles the integration automatically.
Log in to the CometAPI dashboard. Click Add API Key and copy your key.
In Dify, go to Plugins → Install Plugin → Marketplace. Search for cometapi and install it.
Go to Settings → Model Provider → CometAPI → Open Settings. Paste your CometAPI API key and click Save.
Enter a model ID from the CometAPI Models page and click Add.
Create a chatbot or workflow and select a CometAPI model. Send a test message — a successful response confirms the integration is working.
Use this method to add models not covered by the CometAPI plugin, such as Claude, Grok, or Gemini — or to use custom model names.
Go to Settings → Model Provider → OpenAI-API-compatible → Add Model.
Fill in the following fields:
| Field | Value |
|---|---|
| Model type | LLM |
| Model name | Model ID from CometAPI (must match exactly) |
| API key | Your CometAPI API key |
| API base URL | https://api.cometapi.com/v1 |
Click Save.
Tip For model identifiers, refer to the CometAPI Models page. The model ID in Dify must exactly match the identifier used in CometAPI.
Confirm that the API key is correct and has available balance.
Confirm that the model ID matches exactly what CometAPI expects.
Confirm that the API base URL includes /v1 for the OpenAI-compatible method.
Visit the CometAPI support page.








