---
url: 'https://docs.byesu.com/en/clients/dify.md'
description: >-
  Connect Dify to byesu API via OpenAI-API-compatible or Anthropic plugin: run
  Claude 5.5, GPT-6.2, Gemini 4, and DeepSeek V4 in RAG & Agent workflows.
---

# Connect Dify to byesu API

Connect **Dify** (Cloud or self-hosted Community Edition) to **byesu** so your RAG pipelines, Chatflows, and Agent workflows can call Claude, GPT, Gemini, DeepSeek, and Grok models with a single pay-as-you-go API key.

::: tip Quick configuration

* **OpenAI-API-compatible Endpoint URL**: `https://byesu.com/v1` (all vendors under one plugin)
* **Anthropic Plugin API URL**: `https://byesu.com` (native `/v1/messages` + `0.1x` Prompt Caching)
* **API Key**: your byesu token (`sk-...`, created in the default `auto` group)
* **Recommended models**: `claude-sonnet-5-5`, `claude-opus-5-5`, `gpt-6.2-sol`, `deepseek-v4-pro`, `gemini-4-argon`
  :::

## Option 1: OpenAI-API-compatible Plugin (All Models)

Use Dify's **OpenAI-API-compatible** plugin when you want to register Claude, GPT, Gemini, DeepSeek, and Grok models side by side with one credential shape.

1. Create an `sk-...` token in the [byesu Console](https://byesu.com) under the default **`auto`** group (see [Choosing a Group](/en/guide/groups)).
2. In Dify, open **Settings → Model Providers**, search the Marketplace for **OpenAI-API-compatible**, and install it.
3. Click **Add Model** under **OpenAI-API-compatible** and configure:
   * **Model Type**: `LLM`
   * **Model Name**: exact model ID from the console, e.g. `claude-sonnet-5-5`, `deepseek-v4-pro`, or `gpt-6.2-sol`
   * **API Key**: your `sk-...` token
   * **API Endpoint URL**:
     ```text
     https://byesu.com/v1
     ```
   * **Model Context Size**: `1000000` (or match the target model window)
   * **Upper Bound for Max Tokens**: `64000`
   * **Function Calling**: `Tool Call`
   * **Stream Mode**: Enabled
4. Click **Save**, then click **Add Model** again for additional models (`claude-opus-5-5`, `claude-haiku-5-5`, `gpt-6.2-astra`, `gpt-6.1-sol`, `gemini-4-argon`, `gemini-3.8-flash`, `deepseek-v4.1-flash`, `grok-4.7`).

## Option 2: Anthropic Plugin (Native `/v1/messages` & `0.1x` Caching)

If your Dify workflows rely heavily on Claude models with large system instructions or RAG context blocks, you can also install the **Anthropic** model provider plugin:

1. Go to **Settings → Model Providers → Anthropic → Setup**.
2. Paste your `sk-...` token into **API Key**.
3. Set **API URL** to:
   ```text
   https://byesu.com
   ```
   *(Do not append `/v1/messages` — the Anthropic plugin appends the path automatically.)*
4. Save to unlock native Anthropic Messages routing, including prompt cache reads billed as low as **`0.1x`** on repeated prefixes (see [Prompt Caching](/en/guide/prompt-caching)).

## Production Engineering Notes

* **Reasoning model timeouts in Agent & Workflow nodes**: Deep-thinking models (`gpt-6.2-sol`, `claude-opus-5-5`, `deepseek-v4-pro`) spend extra seconds reasoning before emitting final output. Keep **Streaming** enabled on LLM nodes, and on self-hosted Dify deployments increase `API_TOOL_DEFAULT_TIMEOUT` and workflow node timeouts to **≥ 120s** (for example `API_TOOL_DEFAULT_TIMEOUT=180` and `TEXT_GENERATION_TIMEOUT_MS=180000` in `.env`) so p95 thinking latency never triggers a premature timeout.
* **Dedicated model groups**: The `auto` group covers Claude, GPT, Gemini, DeepSeek, and Grok. To call `glm-5.3`, `kimi-k3`, or image generation models (`gpt-image-2`, `gemini-3.1-flash-image-ultra`), create separate tokens in the `Glm`, `Kimi`, or `media` group.
* **Pay-as-you-go billing**: Usage is billed per token with no monthly subscription; live per-model rates are displayed in the [byesu Console](https://byesu.com) after sign-in.

## Troubleshooting & Benchmarks

* **401 invalid\_api\_key / authentication\_error**: confirm `https://byesu.com/v1` is used for OpenAI-API-compatible and `https://byesu.com` for Anthropic ([OpenAI 401 fix](/en/errors/openai-api-401-invalid-api-key), [Claude 401 fix](/en/errors/claude-api-401-authentication-error)).
* **404 / no available channel**: verify the **Model Name** matches the console model ID character for character and matches your token's group ([no available channel](/en/errors/no-available-channel-error)).
* **Workflow node timeout or dropped stream**: enable streaming and raise Dify / reverse-proxy read timeouts ≥ 120s ([Anthropic timeout](/en/errors/anthropic-api-timeout), [streaming connection dropped](/en/errors/streaming-connection-dropped)).
* **429 / latency data**: see [OpenAI 429 rate limit vs quota](/en/errors/openai-api-429-rate-limit-vs-quota) and [live production benchmarks](https://byesu.com/benchmarks).
