Prerequisites
- A CometAPI account with an active API key — sign in to get one
- A Dify account — cloud or self-hosted
Method 1: CometAPI Plugin (Recommended)
The easiest way to connect. Dify Marketplace provides an official CometAPI plugin that handles the integration automatically.Get your CometAPI API key
Install the CometAPI plugin in Dify
In Dify, go to Plugins → Install Plugin → Marketplace. Search for 

cometapi and install it.

Add your API key
Go to Settings → Model Provider → CometAPI → Open Settings. Paste your CometAPI API key and click Save.
Add models
Method 2: OpenAI-Compatible Provider
Use this method to add models not covered by the CometAPI plugin, such as Claude, Grok, or Gemini — or to use custom model names.Troubleshooting
If a call fails, check:- The API key is correct and has available balance
- The model name matches exactly what CometAPI expects
- The API endpoint URL includes
/v1(required for the OpenAI-compatible method)






