> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixroute.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Dify

> Dify 平台集成 MixRoute 指南

## 一、产品简介

Dify 是「可视化 + 插件化」的 AI 应用搭建平台，零代码基础也能轻松用大模型，快速搭建专属 AI 工具（比如对话机器人、文本处理工具等）。

通过集成 **MixRoute API**，您可以在 Dify 中使用成本更低的大模型服务，使用效果却几乎无差。

## 二、集成步骤

### 第一步：准备 API 账号

先注册一个 [MixRoute ](https://api.mixroute.ai/)账号，步驟可參考[快速开始](/zh-hans/quickstart)：

### 第二步：进入 Dify 模型供应商设置

1. 打开 Dify 平台，登录后找到「设置」页面
2. 左侧菜单中选中「模型供应商」，进入插件安装界面

<img src="https://mintcdn.com/personal-a5418d9f/iZ6FhpT4JV2kTLlz/images/dify-en-1.png?fit=max&auto=format&n=iZ6FhpT4JV2kTLlz&q=85&s=b0ca81e0c52f8b18aa25d4bc02ad6bb8" alt="Dify En 1" width="3118" height="1732" data-path="images/dify-en-1.png" />

<img src="https://mintcdn.com/personal-a5418d9f/iZ6FhpT4JV2kTLlz/images/dify-en-2.png?fit=max&auto=format&n=iZ6FhpT4JV2kTLlz&q=85&s=7ecb0bb376f20a233ea6e9eab37e0d90" alt="Dify En 2" width="3120" height="1735" data-path="images/dify-en-2.png" />

### 第三步：安装兼容插件

1. 下滑页面，找到「OpenAI-API-compatible」插件
2. 这款插件支持对话、文本嵌入、语音转文字等多种功能，能让 Dify 无缝对接第三方大模型
3. 点击「安装」即可

<img src="https://mintcdn.com/personal-a5418d9f/iZ6FhpT4JV2kTLlz/images/dify-en-2-1.png?fit=max&auto=format&n=iZ6FhpT4JV2kTLlz&q=85&s=7db6ad3e8803e8c36ef9db7e2503d818" alt="Dify En 2 1" width="3120" height="1735" data-path="images/dify-en-2-1.png" />

### 第四步：配置关键参数（重点！）

安装完成后，点击「增加模型」，需要配置 3 个核心参数：

#### 1. 获取 API Key

* 打开 [MixRoute 控制台](https://api.mixroute.ai/)，进入「API 密钥」页面
* 复制页面生成的密钥，粘贴到 Dify 参数的「API Key」字段

<img src="https://mintcdn.com/personal-a5418d9f/iZ6FhpT4JV2kTLlz/images/dify-en-get-key.png?fit=max&auto=format&n=iZ6FhpT4JV2kTLlz&q=85&s=29517f723398ca9647ac5e16e57e1481" alt="Dify En Get Key" width="2281" height="883" data-path="images/dify-en-get-key.png" />

#### 2. 获取模型名称

* 在控制台的「模型中心」页面，选你需要的模型（比如 Gemini、GPT 系列）
* 点击复制模型名称
* 把复制的名称，分别填入 Dify 的「模型名称」和「API endpoint 中的模型名称」

<Warning>
  两个字段要填写一致！
</Warning>

<img src="https://mintcdn.com/personal-a5418d9f/iZ6FhpT4JV2kTLlz/images/dify-en-model-2.png?fit=max&auto=format&n=iZ6FhpT4JV2kTLlz&q=85&s=5cde19213993256860e5596e08bf8582" alt="Dify En Model 2" width="962" height="448" data-path="images/dify-en-model-2.png" />

<img src="https://mintcdn.com/personal-a5418d9f/iZ6FhpT4JV2kTLlz/images/dify-en-4-1.png?fit=max&auto=format&n=iZ6FhpT4JV2kTLlz&q=85&s=0500850febee2e43494350a56a30cae8" alt="Dify En 4 1" width="1431" height="570" data-path="images/dify-en-4-1.png" />

#### 3. 填写 API 地址

在 Dify 的「API endpoint」字段中填入：

```text theme={null}
https://api.mixroute.ai/v1
```

<img src="https://mintcdn.com/personal-a5418d9f/iZ6FhpT4JV2kTLlz/images/dify-en-5-1.png?fit=max&auto=format&n=iZ6FhpT4JV2kTLlz&q=85&s=4bc580c83a53d021f908773dbf23ec83" alt="Dify En 5 1" width="1429" height="1377" data-path="images/dify-en-5-1.png" />

## 三、配置汇总

| 配置项 | 值 |
| - | - |
| API Key | 从 MixRoute 控制台获取 |
| 模型名称 | 如 `gpt-5.5`、`gemini-3.5-flash` |
| API endpoint | `https://api.mixroute.ai/v1` |

## 四、测试效果

### 测试步骤

1. 打开你在 Dify 创建的工作流任务
2. 把原有模型替换成刚接入的第三方模型
3. 点击「开始运行」，等待执行结果

按照步骤操作，几分钟就能搞定低成本大模型接入！

<img src="https://mintcdn.com/personal-a5418d9f/iZ6FhpT4JV2kTLlz/images/dify-en-6.png?fit=max&auto=format&n=iZ6FhpT4JV2kTLlz&q=85&s=67e53b7bcb392684d867ad6b02282cee" alt="Dify En 6" width="1598" height="1493" data-path="images/dify-en-6.png" />

## 五、优势总结

<CardGroup cols={2}>
  <Card title="成本优势" icon="coins">
    价格更有竞争力
  </Card>

  <Card title="性能稳定" icon="gauge">
    响应速度和官方无差
  </Card>

  <Card title="易于集成" icon="plug">
    通过 OpenAI-API-compatible 插件轻松接入
  </Card>

  <Card title="功能完整" icon="check">
    支持对话、文本嵌入、语音转文字等
  </Card>
</CardGroup>

## 六、注意事项

<Tip>
  * 确保「模型名称」和「API endpoint 中的模型名称」两个字段保持一致
  * API 地址统一使用：`https://api.mixroute.ai/v1`
  * 建议先在测试环境验证配置，确认无误后再用于生产环境
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.