All Products
Search
Document Center

Alibaba Cloud Model Studio:Dify

Last Updated:Jun 12, 2026

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.

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.

Note
  • 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, try installing an earlier version of the TONGYI plugin.

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://dashscope.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

  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.

Chatflow and workflow

  1. Create a Chatflow or workflow

    In the workspace, create and open a Chatflow or workflow.

  2. Add an LLM node

    Add an LLM node to the canvas. Select the node to open its editing panel, then choose the model you need. For this example, select qwen-plus-2025-07-28(Qwen3) and enable thinking mode.

    If you are using a Qwen-VL or QVQ model, you must enable the Vision switch for the LLM node:

    At the bottom of the LLM node editing panel, find and enable the Vision switch. You can then set the Resolution to High or Low.

  3. Run the LLM node

    Click Add message. In the message field corresponding to USER, enter the question "Who are you?", and click the run button 20251127203142 in the top-right corner of the node.

    After the run completes, inspect the text field in the output. The thinking process is enclosed in ... tags, followed by the model's main response.

    The text field returned by the LLM node contains both the thinking process and the response. You can use a Dify code execution node with regular expressions to extract them separately.

Knowledge base

  1. Create a knowledge base

    Create and open a knowledge base.

  2. Select a data source

    Upload your knowledge base files.

  3. Text segmentation and cleaning

    Configure the embedding and rerank models from Model Studio. This example uses text-embedding-v4 and gte-rerank-v2. Adjust other parameters as needed.

    The gte-rerank-v2 model is supported only in the Beijing region.
    The multimodal-embedding-v1 model cannot currently be selected as an embedding model. Stay tuned for future updates.

FAQ

Q1: TONGYI plugin API key error

A: Common reasons:

  • The latest version of the plugin might be unstable. Try installing an earlier version.

  • 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: Using Qwen-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.