Skip to main content
Clients and Developer Tools

Dify

Dify is an open-source platform for building AI applications. You can build applications using model APIs from Alibaba Cloud Model Studio.

Prerequisites

You need to get an API key and activate the required model services in Model Studio.
Dify is a workflow and automation platform, so it does not support Token Plan Personal Edition, Token Plan Team Edition, or Coding Plan. These plans support only AI programming tools and OpenClaw-type agents. For more information, see Unsupported tool types.Use a pay-as-you-go API key with Dify. Using a plan API key for calls outside the permitted scope will be considered a violation or abuse, and may result in subscription suspension or API key ban.

1. Configure the model

1.1. Install the model provider

Go to the Dify Marketplace. Under Model, find Qwen and install the latest version of the plugin.
  • The TONGYI plugin is maintained by Dify, not Alibaba Cloud. If you encounter an error when installing the latest version, try installing an earlier version.
  • To use DeepSeek models from Model Studio, you must also use the Qwen plugin.

1.2. Configure the API key

In the top-right corner of the page, click your profile picture → Settings. Under Model Providers, find the Qwen card and click Settings.
  • If you use a model from the Singapore region, go to the API-KEY Settings section, enter the API key for that region, and set Use International Endpoint to Yes.
  • If you use a model from the Beijing region, go to the API-KEY Settings section, enter the API key for the Beijing region, and set Use International Endpoint to No.
If you receive an Invalid API key provided error during configuration, see the note about plugin versions in 1.1. Install the model provider.
20251127172111

1.3. Select a model

On the Qwen card, click to show the model list, then enable the switch for the models you need.
If the plugin does not include the latest Qwen model, you can install the OpenAI-API-compatible plugin. In the plugin settings, set the API endpoint URL to one of the following: https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1 (Singapore region) or https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1 (Beijing region). Replace WorkspaceId with your actual Get the Workspace ID.

2. Get started

Dify supports several application types. Select yours for instructions.
  • Chat assistant and agent
  • Chatflow and workflow
  • Knowledge base
  1. Create a chat assistant or agent In the workspace, click Create blank app. Under Beginner-Friendly, create and open a chat assistant or agent.
  2. Select a model In the top-right corner of the application page, select a model. For example, under Qwen, select qwen-plus-latest(Qwen3), then enable thinking mode.
  3. Test the conversation Enter "Who are you?" The model responds after its thinking process is complete. You can also use a Qwen-VL or QVQ model to ask questions about images. After selecting a vision model, a Vision switch appears on the left. Enable it to upload images in the chat window on the right.

FAQ

Q1: TONGYI plugin API key error

A: Common reasons:
  • The latest version of the plugin might be unstable. See the note about plugin versions in 1.1. Install the model provider.
  • You are using an API key from a sub-workspace. Version 0.0.41 of the TONGYI plugin validates invocation permissions for the qwen-turbo model. You must grant invocation permission for qwen-turbo.
    The TONGYI plugin is not maintained by Alibaba Cloud, and its validation policies may change in future versions. Use an API key from the default workspace.
  • The endpoint setting is incorrect. Set Use International Endpoint correctly based on the region of your API key.

Q2: UsingQwen-Omni and Qwen-OCR models

A: These models cannot be configured directly in Dify. You can integrate them using an HTTP node in a Chatflow or workflow. For integration details, refer to the cURL command examples in the model's documentation.
To reduce the risk of timeouts in the HTTP node, use streaming output for API calls.

Q3: Using Wan models

A: Dify does not offer a dedicated plugin for Wan models. However, you can achieve text-to-image and text-to-video generation using nodes in a Dify Chatflow or workflow. Follow these steps:
  1. Download and import a workflow template Download one of our pre-built templates: Wan - Text-to-Image Demo.yml or Wan - Text-to-Video Demo.yml. In the workspace, click Import DSL File and select the template you downloaded.
  2. Configure environment variables On the workflow page, find the environment variables icon image.png, and change the value of DASHSCOPE_API_KEY to your API key.
  3. Test the output Click the Run button to generate the output. For example, entering "a small cat" in the text-to-image workflow produces an image.
    The text-to-video workflow returns a URL for the generated video.
    Text-to-video generation typically takes five minutes or more.
  4. Publish as a tool (optional) To use these capabilities in other applications, click Publish in the top-right corner and select Publish as tool.
The templates use models from the Singapore region: wan2.2-t2i-flash (text-to-image) and wan2.1-t2v-turbo (text-to-video). You can change the model in the STEP1 node and modify the region-specific API endpoint in the STEP1 and STEP3 nodes.

Q4: Private deployment of Dify

A: The Dify cloud service has several limitations, such as a maximum of five applications. For a private deployment, see the Alibaba Cloud solution for Dify deployment.
Token Plan
Model Playground
  • Music generation
Statistics and Monitoring
Support