Connect Dify to APIVAI
Dify is a popular open-source platform for building LLM apps, agents, and
workflows. It supports OpenAI-compatible model providers, so you can power your Dify apps with
APIVAI's Claude and GPT models at a fraction of list price — no code.
Add APIVAI as a model provider
- In Dify, open Settings → Model Providers.
- Choose OpenAI-API-compatible (add custom model).
- Set:
-
API endpoint / Base URL:
https://api.apivai.com/v1 - API Key: your APIVAI key
-
Model name: a name APIVAI serves (e.g.
gpt-5.5,claude-sonnet-4-6) - Model type: LLM; set context length / max tokens to match the model.
-
API endpoint / Base URL:
- Save. The model is now selectable in your apps, agents, and workflows.
Confirm the model name
curl -s https://api.apivai.com/v1/models -H "Authorization: Bearer $APIVAI_API_KEY"
Use a returned name.
Use it
Pick the APIVAI model in a Chatbot, Agent, or Workflow node. Build RAG apps, tool-using agents, or
multi-step flows — all running on cheaper Claude/GPT through APIVAI.
Troubleshooting
-
Connection failed — verify the Base URL ends with
/v1and the key is correct. -
model_not_found— use an exact name from/v1/models. - Wrong context length — set it to the model's real context window.
FAQ
Does Dify work with APIVAI? Yes — add it as an OpenAI-API-compatible provider with base URL
https://api.apivai.com/v1, your key, and a model name.
Which model should I use? GPT-5.5 for fast/cheap chat and translation; Claude Sonnet for code,
long context, and reasoning.
Do I need code? No — it's a model-provider setting in Dify's UI.
Get started
Add APIVAI as a model provider in Dify and build your app on a model from /v1/models. Examples:
APIVAI examples repo.
Top comments (0)