Give every Dify app one model provider
Dify is one of the most widely used platforms for building LLM apps and agent workflows. Each app you ship needs a model provider behind it — and juggling one vendor account per family means separate keys, bills, and failure modes. Registering Router One once as an OpenAI-API-compatible provider puts the whole catalog behind a single credential, with every app call traced for cost.
Configuration
In Dify, open Settings → Model Provider → add an OpenAI-API-compatible model, then fill in the model ID, base URL, and key:
# Dify → Settings → Model Provider → OpenAI-API-compatible Model Name: <model-id-from-/models> API endpoint: https://api.router.one/v1 API Key: sk-your-router-one-key
Pick a model
Copy the exact model ID from the /models page — IDs are case-sensitive, and the page lists each model's context window, capabilities, and current per-token rates. Create a dedicated API key per tool with its own maxSpend cap, so one runaway tool can't affect other workloads.
Verify and observe
After your first request, open Dashboard → Logs to see its full trace: model, tokens, cost, latency, and status code. From here every Dify call has a ledger and a trail instead of being a black box.
FAQ
- Which provider type do I pick in Dify?
- Choose "OpenAI-API-compatible" in the model-provider list. Add one entry per model you want to expose, using the exact model ID from /models — each becomes selectable in your Dify apps.
- Which models can Dify use through the gateway?
- Any chat-capable model in the catalog — GPT, Claude, Gemini, DeepSeek, and Mistral families. The /models page is the source of truth for model IDs and per-token rates.
- Does this work from Mainland China?
- Yes. The gateway is reachable from Mainland China without a VPN, and the configuration is identical to the global setup.
- How do I debug a 401/403/429?
- Open Dashboard → Logs first to see whether requests reached the gateway and with what status, then walk the error-codes reference to check env vars, key status, and limits.