DEV Community

APIVAI
APIVAI

Posted on • Originally published at apivai.com

How to Connect Dify to APIVAI (Cheap Claude & GPT for LLM Apps)

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

  1. In Dify, open Settings → Model Providers.
  2. Choose OpenAI-API-compatible (add custom model).
  3. 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.
  4. 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"
Enter fullscreen mode Exit fullscreen mode

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 /v1 and 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)