Dify
Use cheapaimodel models in Dify apps and workflows through the OpenAI-API-compatible model provider.
Dify connects to OpenAI-compatible services through the OpenAI-API-compatible model provider plugin. You add each model by hand, and every app in the workspace can then use it.
| Dify setting | Value | |
|---|---|---|
| Base URL | API Base URL | https://api.cheapaimodel.ai/v1 |
| API key | API Key | Your key from the console's API Keys page |
| Model ID | Model Name | deepseek-v4-1-flash, or any ID from the catalog |
Set it up
Install the provider
As a workspace owner or admin, open Integrations → Model Provider. Find OpenAI-API-compatible under Install model providers, or in the Dify Marketplace, and install it.
Add a model
On the OpenAI-API-compatible card, select Add Model and fill in:
| Field | Value |
|---|---|
| Model Type | LLM |
| Model Name | deepseek-v4-1-flash |
| API Key | Your cheapaimodel key |
| API Base URL | https://api.cheapaimodel.ai/v1 |
| Completion mode | Chat |
| Model context size | The context length on the model's page, for example /models/deepseek-v4-1-flash |
| Upper bound for max tokens | The maximum output tokens on the same page |
Both size fields start at 4096, so set them from the model page. Leave model name for API endpoint empty and API Type on Chat Completions API (/chat/completions). The capability fields, such as Function Call Type and Vision Support, start off; turn one on only for what you've confirmed the model handles.
Select Save. Dify sends a short test request to the model before saving, so a wrong field fails here instead of in your app. Repeat for each model ID you want.
Use it
Pick the model in an app's or LLM node's model selector, or make it the workspace default with Default Models → System Reasoning Model.
Knowledge bases
cheapaimodel has no embeddings models yet. Don't add a Text Embedding model that points at cheapaimodel; set Default Models → Embedding Model to another provider for your knowledge bases.
Common mistakes
- Save fails with
Credentials validation failed with status code 404and a body offault filter abort. API Base URL is missing/v1. Sethttps://api.cheapaimodel.ai/v1. - Save fails with status code
404andInvalid URL (POST /v1/chat/completions/chat/completions)in the body. API Base URL includes the endpoint path. Dify appends/chat/completionsitself; sethttps://api.cheapaimodel.ai/v1. - Save fails with status code
401. The key is wrong, expired or out of budget. Check it in the console. - Save fails with status code
503andmodel_not_found. Model Name must be a catalog ID, spelled exactly. Put a friendlier label in Model display name instead.