> ## 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 Platform Integration Guide with LeapX API

## Introduction

Dify is a "visual + plugin-based" AI application building platform. Even with zero coding experience, you can easily use large language models to quickly build custom AI tools (such as chatbots, text processing tools, etc.), making it accessible for beginners!

By integrating **LeapX API**, you can use large model services in Dify at a cost that's only 1/5 or even lower than official prices, with almost the same performance. High-frequency users can save significantly!

<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 Platform Interface" 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 Features" width="1080" height="509" data-path="images/2.png" />

## Integration Steps

### Step 1: Prepare Third-Party API Account

First, register a LeapX API service account:

👉 [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="Registration Page 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="Registration Page 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="Registration Page 3" width="1080" height="570" data-path="images/5.png" />

### Step 2: Access Dify Model Provider Settings

1. Open the Dify platform and log in, then navigate to the "Settings" page
2. Select "Model Provider" from the left menu to enter the plugin installation interface

<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="Model Provider Settings" width="1080" height="526" data-path="images/6.png" />

### Step 3: Install Compatible Plugin

1. Scroll down the page and find the "OpenAI-API-compatible" plugin
2. This plugin is super useful! It supports chat, text embedding, speech-to-text, and many other features, enabling seamless integration of third-party large models with Dify. Click "Install"

<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="Install Plugin" width="1080" height="633" data-path="images/7.png" />

### Step 4: Configure Key Parameters (Important!)

After installation, click "Add Model". You need to obtain 3 core parameters from [https://leapx-hub.com](https://leapx-hub.com), step by step:

<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="Configuration 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="Configuration 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="Configuration 3" width="641" height="825" data-path="images/9.png" />

#### 1. Get API Key (📝 Just copy and paste)

* Open [https://leapx-hub.com](https://leapx-hub.com), click "Token" in the top navigation
* Copy the generated "Token" from the page and paste it into the "API Key" field in Dify parameters

#### 2. Get Model Name (⚠️ Both fields must match)

* Go back to [https://leapx-hub.com](https://leapx-hub.com) and enter the "Account" page
* In the blue "Model List" at the bottom of the page, select the model you need (such as Gemini, GPT series), and click to copy the name
* Paste the copied name into both "Model Name" and "Model Name in API endpoint" fields in Dify (don't make mistakes!)

#### 3. Fill in API Address (Copy directly!)

In Dify's "API endpoint" field, enter:

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

#### 4. Save Configuration

After filling in all parameters, click "Save" — Done! The third-party model is successfully connected to Dify～

## Testing Results and Cost Comparison

### Testing Steps

1. Open the workflow task you created in Dify
2. Replace the original model with the newly integrated third-party model
3. Click "Start Run" and wait for the execution results

Follow these steps, and you can complete the low-cost large model integration in just a few minutes!

<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="Test Results 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="Test Results 2" width="1080" height="668" data-path="images/11.png" />

### Surprising Results

✅ **Success!** The task executed smoothly with response speed comparable to official services

💰 **Cost Savings!** Check the [https://leapx-hub.com](https://leapx-hub.com) backend: Using Gemini's latest model, consuming 80,000+ tokens, cost only 0.1 yuan! (Compared to official prices, saving over 80% — great for high-frequency use!)

<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="Cost Comparison" width="475" height="707" data-path="images/12.png" />

## Advantages Summary

* 💰 **Cost Advantage**: Price is only 1/5 or even lower than official prices
* ⚡ **Stable Performance**: Response speed is comparable to official services
* 🔧 **Easy Integration**: Easy access through OpenAI-API-compatible plugin
* 🌟 **Complete Features**: Supports chat, text embedding, speech-to-text, and many other features
* 📊 **Transparent Billing**: Real-time viewing of usage and costs in the backend

<Tip>
  - Ensure that "Model Name" and "Model Name in API endpoint" fields are consistent
  - API address should be: `https://api.leapx-hub.com/v1`
  - It's recommended to verify the configuration in a test environment first, then use it in production after confirmation
</Tip>
