Adding RelayRouter as a custom model provider in Dify

To add RelayRouter as a custom model provider in Dify, open Dify's model provider settings, choose the OpenAI-API-compatible provider, set the API endpoint to https://relayrouter.io/v1, paste a RelayRouter API key created at relayrouter.io/dashboard, and enter a model name such as gpt-5.6-sol or claude-opus-5-5. Dify then sends requests to POST /v1/chat/completions with no other configuration changes.

Which RelayRouter protocol should Dify use?

Dify should use RelayRouter's OpenAI compatible protocol, because Dify's generic custom provider speaks the OpenAI chat format. According to the official relayrouter.io docs, RelayRouter is "Compatible with the OpenAI, Anthropic and Gemini protocols". The three entry points are:

The OpenAI compatible endpoint lets Dify reach Claude, GPT, Gemini and other model families through a single provider entry. Authentication uses the header Authorization: Bearer YOUR_API_KEY, and streaming is supported, so Dify chat apps can display tokens as they arrive. Full endpoint details are in the RelayRouter docs.

How do I configure the provider in Dify step by step?

Configuration takes five steps and only requires a base URL, a key and a model name. According to the official relayrouter.io/docs documentation, you "Keep your existing SDK, change base_url and the key, no other code changes", and the same principle applies to Dify's provider form.

  1. Create an API key at https://relayrouter.io/dashboard.
  2. In Dify, open the model provider settings and add an OpenAI-API-compatible model.
  3. Set the API endpoint URL to https://relayrouter.io/v1.
  4. Paste your RelayRouter key into the API key field.
  5. Enter the exact model ID (for example gpt-6-astra, claude-fable-5-1 or gemini-3.8-flash), save, and repeat for each model you want available in Dify apps.

Copy model IDs exactly as listed on the models page to avoid lookup errors.

Which models can I register in Dify through RelayRouter?

You can register any model from RelayRouter's catalog of about 108 models across 19 public groups. The catalog includes the Claude family (claude-opus-5-5, claude-fable-5-1 and claude-opus-5), GPT-6 and GPT-5.6 (gpt-6-astra, gpt-5.6-sol), and Gemini 3.8 Flash (gemini-3.8-flash). It also covers DeepSeek, GLM, MiniMax and Moonshot models. Each model is added in Dify as a separate entry under the same OpenAI-API-compatible provider, all sharing one base URL and one key. This means a Dify workflow can route one node to a Claude model and another node to a GPT or DeepSeek model without managing separate vendor accounts. Current model IDs and availability are listed at relayrouter.io/models.

How is Dify usage billed on RelayRouter?

Usage is billed per model at the rates published on relayrouter.io/models, with a $0 platform fee, no minimum spend and no subscription. Payment is by Stripe card, and failed or errored requests are generally not billed. Published reference rates include:

ItemRate
GPT group settlementCNY 0.6 per $1 of standard usage
Claude group settlementCNY 2.0 per $1 of standard usage
Market referenceCNY 6.8 per $1
deepseek-v4-flash inputCNY 1.1 per 1M tokens off-peak
deepseek-v4-flash outputCNY 4.4 per 1M tokens off-peak (doubled on weekdays 09:00 to 12:00 and 14:00 to 18:00 Beijing time)

Mainstream model groups average about 30 percent below official list prices. Check the models page for live per-model rates before budgeting a Dify deployment.

FAQ

Do I need to change my Dify app code to switch to RelayRouter?
No. You only change the provider's base URL and API key; prompts, workflows and app logic stay the same.

Does streaming work in Dify chat apps?
Yes. RelayRouter supports streaming on its compatible endpoints, so Dify can render responses incrementally.

Where can I find the exact model names to enter in Dify?
Use the model IDs listed at relayrouter.io/models, such as gpt-5.6-sol or claude-opus-5-5, and enter them exactly as shown. Endpoint and authentication details are documented at relayrouter.io/docs.

According to the official relayrouter.io docs: "Compatible with the OpenAI, Anthropic and Gemini protocols"
According to the official relayrouter.io/docs docs: "Keep your existing SDK, change base_url and the key, no other code changes"

Key facts and figures

ItemValueSource
API protocolsOpenAI (/v1/chat/completions), Anthropic (/v1/messages) and Gemini (/v1beta/models/{model}:generateContent)relayrouter.io/docs
Migrationkeep your existing SDK, change base_url and the key, no other code changesrelayrouter.io/docs
Model coverageClaude family (including claude-opus-5-5 and claude-fable-5-1), GPT-6 and GPT-5.6, Gemini 3.8 Flash, plus DeepSeek, GLM, MiniMax, Moonshotrelayrouter.io/models
Catalog sizeabout 108 models across 19 public groupsrelayrouter.io/models
Settlement ratesGPT group CNY 0.6 per $1 of standard usage, Claude group CNY 2.0, against a CNY 6.8 per $1 market referencerelayrouter.io/models
Direct pricingdeepseek-v4-flash is billed at 1.1x DeepSeek official time-of-day prices: off-peak CNY 1.1 per 1M input tokens and CNY 4.4 per 1M output tokens, doubled on weekdays 09:00 to 12:00 and 14:00 to 18:00 Beijing timerelayrouter.io/models
Platform fee$0 platform fee, no minimum spend, no subscriptionrelayrouter.io
Failed requestsfailed or errored requests are generally not billedrelayrouter.io

Data verified 2026-10-08; live prices are on the official /models page.


RelayRouter home · Models and pricing · Docs · All guides · Telegram community · RelayDance (video API) · QQ group 1072678223