Integration guides
Using Dify
Add an OpenAI-API-compatible model in Dify's model providers with your Tutujin API key, the API endpoint URL https://open.tutujin.com/v1 and a model name, and use GPT, Claude, DeepSeek and more in apps and knowledge bases.
Dify connects to Tutujin API through the "OpenAI-API-compatible" model provider: when you add a model, enter your Tutujin API key, the API endpoint URL https://open.tutujin.com/v1 and the model name. Add each model once and it is available in app orchestration, workflows and knowledge bases.
The steps follow the Dify 1.x interface. Dify changes quickly, so menu names and field positions may differ slightly in your version; the values you enter stay the same.
Step 1: Install OpenAI-API-compatible
- In Dify, open Settings → Model Provider.
- If "OpenAI-API-compatible" is not listed, find it in the plugin marketplace and install it. Since Dify 1.0, model providers ship as plugins.
Step 2: Add a chat model
Click "Add model" on OpenAI-API-compatible and fill in:
| Field | Value |
|---|---|
| Model type | LLM |
| Model name | A model name from the model hub, e.g. deepseek-v4.1-flash |
| API Key | Your Tutujin API key |
| API endpoint URL | https://open.tutujin.com/v1 |
| Completion mode | Chat |
| Context size, max tokens | The values the model's vendor publishes |
| Function calling, Vision | Turn on only if the model supports them |
After saving, the model appears in your apps' model picker. Add one entry per model name for each model you want.
Step 3: Add an embedding model (for knowledge bases)
Dify knowledge bases need an embedding model. Click "Add model" again:
| Field | Value |
|---|---|
| Model type | Text Embedding |
| Model name | e.g. text-embedding-3-small |
| API Key | Your Tutujin API key |
| API endpoint URL | https://open.tutujin.com/v1 |
Then make it the default embedding model under System Model Settings. If your Dify version supports the Rerank type for this provider, add a rerank model the same way, for example qwen3-reranker-8b.
Do not switch embedding models casually once a knowledge base exists. Vectors from different models are not compatible, and switching means re-embedding every document.
GPT-only setups
If you only use OpenAI models, you can configure Dify's built-in "OpenAI" provider instead: put your Tutujin key in API Key and https://open.tutujin.com/v1 in API Base. For other vendors' models, OpenAI-API-compatible is the better fit.
Testing and billing
Send a message from an app's debug panel; a normal reply means the setup works. Every call then shows up under Usage in the Tutujin console, billed at the key's group price. Consider a dedicated key for Dify with a spending limit — see Authentication and base URL.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| Validation fails when saving the model | Check the API endpoint URL is https://open.tutujin.com/v1 and the model name matches the model hub |
| 401 | Wrong or invalid key |
503 with model_not_found | The key's group lacks this model — see Choosing a group |
| Truncated answers | Raise the model's max tokens |
Still stuck? Add our WeChat support JsnonoChat and send the request id from the error message, and we will look into it.