Dify Integration
Configure 1折AI using the official Dify OpenAI-API-compatible plugin, covering model setup, conversation testing, and troubleshooting the first call.
Dify users can configure 1折AI’s OpenAI-compatible endpoint through the official OpenAI-API-compatible model plugin. First verify a text model, then use it in workflows; there is no need to install unverified third-party plugins.
Prerequisites
Section titled “Prerequisites”- A Dify workspace where model plugins can be installed.
- Your own 1折AI API key, plus the model IDs that key is authorized to call. Check the console.
- Sufficient available balance in your account. The validation request when saving a model and application tests may incur normal API charges.
Do not send your full key to customer support, write it into workflow descriptions, screenshots, or public repositories. Store it only in Dify’s API Key field; if you use a third-party hosted Dify, that instance holds your key and forwards requests.
Adding a Model
Section titled “Adding a Model”- In the Dify plugin marketplace, find OpenAI-API-compatible and confirm the publisher is langgenius.
- Open the model providers in workspace settings, locate this plugin, and add an LLM model.
- Fill in the fields below and save. The interface labels may vary by Dify version.
| Field | How to fill it in |
|---|---|
| Model Name | Copy the full model ID from the 1折AI console; do not substitute the display name |
| API Key | Your own 1折AI key |
| API Base URL | https://1zheai.com/v1 |
| Completion mode | Chat |
| Model name in the API endpoint | Usually leave blank; if set, it must match the actual model ID |
| Model context size | Fill in according to the selected model’s actual capability; do not copy another model’s context length |
Here you need /v1. Do not enter the full /v1/chat/completions, and do not duplicate it as /v1/v1. Do not apply instructions from other clients that only require the root address.
Starting from the First Conversation
Section titled “Starting from the First Conversation”Create a blank chat app, select the model you just saved, and enter “Please introduce what you can do in one sentence in Chinese.” Once a complete text response is confirmed, verify streaming output next.
Check the corresponding request time, model, and result in the call logs of the 1折AI console. Do not rely solely on Dify’s “Saved successfully” as proof that the app is connected. Only after the first success should you configure tool calls, vision input, or knowledge base retrieval; these capabilities depend on the specific model and interface, and a successful text conversation does not mean everything is available.
Importing the Example Chatflow
Section titled “Importing the Example Chatflow”Download the keyless Chatflow template, then in Dify Studio choose Create → Import DSL file to upload it. The template is User Input → LLM → Answer, DSL version 0.7.0, using the official compatible plugin 0.0.68.
First add your own credentials following the steps above. After importing, open the LLM node and confirm your own provider and model are selected, not Dify’s trial model. The example model ID is claude-haiku-4-5-20251001; if it is unavailable to your account, switch to a model you have access to and check the capability settings. The template contains no API key and does not provide free call credits.
Troubleshooting
Section titled “Troubleshooting”| Symptom | What to check first |
|---|---|
| 503 / No available accounts | The current upstream may be rate-limited or out of capacity. Check the service status and call logs first, retry with backoff later or contact support; do not retry at high frequency continuously, and do not repeatedly regenerate keys |
| 401 / Invalid key | Whether there are extra spaces, whether the key has been revoked, and whether a key from another platform was used by mistake |
| 404 | Whether the Base URL is exactly https://1zheai.com/v1; whether the model ID exists |
| Model not permitted or insufficient balance | The model restrictions of the current key, the account’s available balance, and the selected model |
| Saved successfully, but the app cannot call | Whether the app selected the correct provider and model; whether the workspace server can reach the API |
| Normal responses work, streaming fails | Check the proxy’s SSE support, the plugin version, and the streaming usage setting; keep a redacted error for troubleshooting |
| Tool calls or vision fail | First confirm the selected model actually supports that capability; avoid forcing it on by only toggling plugin switches |
Requests from self-hosted Dify are sent by its server; the fact that your browser can open the official site does not mean the Dify server can connect to the API.
Getting Integration Help
Section titled “Getting Integration Help”Provide the Dify version, plugin version, model ID, error timestamp, request ID, and redacted error details through the official site’s online customer service. Do not send the full key, customer data, or private prompts from your workflows.
Verification Scope
Section titled “Verification Scope”On 2026-10-19, using the official plugin 0.0.68, Haiku text conversation and streaming calls were completed in Dify Cloud and matched against the gateway logs. The exported keyless DSL was imported into the same workspace as a new app. After import, a retest encountered a 503 caused by upstream rate limiting, so this round is not recorded as a post-import run passing.
This is an internal test with a defined time window, not a continuous availability guarantee. Fresh workspaces, older Dify versions, tool calls, vision, and knowledge base retrieval have not been verified; please complete your first test with your own rate-limited key.
Official plugin source · Dify plugin marketplace
English / Русский
Section titled “English / Русский”English: Install the official OpenAI-API-compatible plugin by langgenius. Set API Base URL to https://1zheai.com/v1, use your own API key and an exact model ID available to your account, and select Chat mode. Test a simple conversation before adding tools or vision. Text and streaming calls were verified in Dify Cloud on 2026-10-19. DSL import into a new app in the same workspace succeeded; its subsequent run encountered an upstream-capacity 503. Fresh-workspace import and advanced capabilities remain unverified. Never share your key with support.
Русский: Установите официальный плагин OpenAI-API-compatible от langgenius. Укажите API Base URL https://1zheai.com/v1, собственный API-ключ и точный ID модели, доступной вашему аккаунту; выберите режим Chat. Сначала проверьте простой диалог, затем потоковый вывод. Текстовые и потоковые вызовы проверены в Dify Cloud 19 октября 2026 года. Импорт DSL в новое приложение того же рабочего пространства прошёл, но повторный вызов вернул 503 из-за недоступной мощности upstream. Новое рабочее пространство и расширенные функции ещё не проверены. Не отправляйте ключ службе поддержки. Доступность из конкретной сети и способы оплаты проверяются отдельно.
