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

# Dify

> Dify 平台集成 LeapX API 指南

## 一、产品简介

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

通过集成 **LeapX API**，您可以在 Dify 中使用成本仅为官方 1/5 甚至更低的大模型服务，使用效果却几乎无差，高频使用者直接省出奶茶钱～

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/1.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=5639763088298f0563afdc6a2f95a2a9" alt="Dify 平台界面" width="1080" height="530" data-path="images/1.png" />

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/2.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=b25dc64d314e52f14d8d1937924927b4" alt="Dify 功能展示" width="1080" height="509" data-path="images/2.png" />

## 二、集成步骤

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

先注册一个 LeapX API 服务商账号：

👉 [https://leapx-hub.com](https://leapx-hub.com)

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/3.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=46bb4972c5130ff7d80f488872038336" alt="注册页面1" width="1080" height="575" data-path="images/3.png" />

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/4.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=0adc1f89e06a3c0530a3aaba95ca77a2" alt="注册页面2" width="1080" height="577" data-path="images/4.png" />

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/5.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=f910ebbe131c0bb24ca6fa1b084290b8" alt="注册页面3" width="1080" height="570" data-path="images/5.png" />

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

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

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/6.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=e0bf5374049be22cc11904c63eb85346" alt="模型供应商设置" width="1080" height="526" data-path="images/6.png" />

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

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

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/7.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=68da7e9eba698389663db17291967e0b" alt="安装插件" width="1080" height="633" data-path="images/7.png" />

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

安装完成后，点击「增加模型」，需要从 [https://leapx-hub.com](https://leapx-hub.com) 获取 3 个核心参数，一步步来：

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/7.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=68da7e9eba698389663db17291967e0b" alt="配置参数1" width="1080" height="633" data-path="images/7.png" />

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/8.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=dd32e6f343828939c4e726dbee6ba53e" alt="配置参数2" width="859" height="457" data-path="images/8.png" />

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/9.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=a057a63e806dda088dc0f4582047ecef" alt="配置参数3" width="641" height="825" data-path="images/9.png" />

#### 1. 获取 API Key（📝 复制粘贴就行）

* 打开 [https://leapx-hub.com，点击顶部导航「令牌」](https://leapx-hub.com，点击顶部导航「令牌」)
* 复制页面生成的「令牌」，粘贴到 Dify 参数的「API Key」字段

#### 2. 获取模型名称（⚠️ 两个字段要一致）

* 回到 [https://leapx-hub.com，进入「账户」页面](https://leapx-hub.com，进入「账户」页面)
* 页面下方蓝色「模型列表」中，选你需要的模型（比如 Gemini、GPT 系列），点击复制名称
* 把复制的名称，分别填入 Dify 的「模型名称」和「API endpoint 中的模型名称」（别填错！）

#### 3. 填写 API 地址（直接抄作业！）

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

```
https://api.leapx-hub.com/v1
```

#### 4. 保存配置

所有参数填完，点击「保存」—— 搞定！第三方模型成功接入 Dify～

## 三、测试效果与成本对比

### 测试步骤

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

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

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/10.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=3927a1b6fa99bcb637760dad53a54460" alt="测试效果1" width="643" height="832" data-path="images/10.png" />

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/11.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=b16f2db52bc1119d67c0d3190503c569" alt="测试效果2" width="1080" height="668" data-path="images/11.png" />

### 惊喜结果

✅ **调用成功！** 任务顺利执行，响应速度和官方无差

💰 **成本炸裂！** 打开 [https://leapx-hub.com](https://leapx-hub.com) 后台查看：调用 Gemini 最新模型，消耗 8 万 + Token，仅花了 0.1 元！（对比官方价格，直接省了 80%+，高频使用太香了～）

<img src="https://mintcdn.com/leapxintelligencetechlimited/X-g5RXsiKme_zara/images/12.png?fit=max&auto=format&n=X-g5RXsiKme_zara&q=85&s=040ee48588a56c0c6551a1e7450f2c0a" alt="成本对比" width="475" height="707" data-path="images/12.png" />

## 四、优势总结

* 💰 **成本优势**：价格仅为官方的 1/5 甚至更低
* ⚡ **性能稳定**：响应速度和官方无差
* 🔧 **易于集成**：通过 OpenAI-API-compatible 插件轻松接入
* 🌟 **功能完整**：支持对话、文本嵌入、语音转文字等多种功能
* 📊 **透明计费**：后台实时查看调用量和费用

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