Dify
Dify can call OdiRouter through an OpenAI-API-compatible model provider. Use this for Dify chat apps, agents, and workflows that need OdiRouter LLM models.
Requirements
Section titled “Requirements”| Requirement | Value |
|---|---|
| Dify | Cloud or self-hosted workspace with model provider access |
| Provider type | OpenAI-API-compatible |
| API endpoint | https://www.odirouter.ai/v1 |
| API Key | OdiRouter API key |
| Model name | An OdiRouter LLM model ID |
Add OdiRouter Provider
Section titled “Add OdiRouter Provider”- Open Dify.
- Go to model provider settings.
- Add a provider of type
OpenAI-API-compatible. - Set the API endpoint or Base URL to
https://www.odirouter.ai/v1. - Paste your OdiRouter API key.
- Add an OdiRouter model ID, such as
gpt-5.5. - Save and test the provider.
Use In An App
Section titled “Use In An App”- Open a Dify app.
- Go to model settings.
- Select the OdiRouter provider.
- Select the configured model.
- Run a short test prompt.
Example prompt:
Reply with one sentence confirming that Dify is using OdiRouter.Read LLM Output
Section titled “Read LLM Output”When Dify calls OdiRouter as an LLM provider, the app node usually passes the model text as that node’s output to downstream nodes. If you call chat completions directly from an HTTP request node, the assistant text is at:
choices[0].message.contentIn workflows, save this field as a clear variable such as answer, summary, or model_output, then pass it to condition nodes, templates, database writes, or webhook responses.
Multimodal Queue Workflows
Section titled “Multimodal Queue Workflows”For OdiRouter asynchronous image, video, audio, or 3D models, use Dify’s HTTP request capability instead of the OpenAI-compatible LLM provider:
| Step | Endpoint |
|---|---|
| Create task | POST https://www.odirouter.ai/model/v1/queue/{endpoint} |
| Poll status | GET {status_url} |
| Fetch result | GET {response_url} |
After creating the task, save these fields:
| Field | Purpose |
|---|---|
request_id | Keep the task ID for logs, debugging, and business records |
status_url | Pass to a loop or scheduled HTTP node to poll status |
response_url | Fetch the final result after completion |
Poll status_url until status is COMPLETED, then call response_url. The final result shape depends on the model type and usually contains image, video, audio, 3D file URLs, or text fields. Map the needed URL or text field into a workflow variable before passing it downstream.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Fix |
|---|---|
| Provider test fails with 401 | Recreate the OdiRouter API key |
| Model not found | Add the exact model ID returned by /models |
| Dify expects a full OpenAI endpoint | Use https://www.odirouter.ai/v1, not /chat/completions, unless Dify explicitly asks for the full chat endpoint |
| Multimodal model does not work in LLM provider | Use HTTP workflow nodes and the /model/v1/queue/{endpoint} API |