Quick answer: In Dify, add a Model Provider of type OpenAI-API-compatible, set the API Base to https://321ai.cc/v1, paste an API key created in the 321AI console, then add model names (e.g. gpt-5.5, claude-sonnet-5, deepseek-v4-pro). Failed requests are not billed; per-model prices are listed on https://321ai.cc/pricing/openai.
Audience: developers running Dify (self-hosted or cloud) who want GPT / Claude / DeepSeek / Qwen models through one OpenAI-compatible endpoint.
A Dify instance (any recent version) with admin access to Settings → Model Provider; a 321AI API key (free credit on signup).
| Setting | Value | Note |
|---|---|---|
Provider type | OpenAI-API-compatible | Dify built-in provider type |
API Base | https://321ai.cc/v1 | must include /v1 |
API Key | your 321AI key | from the 321AI console |
Model ID | e.g. gpt-5.5 / claude-sonnet-5 | exact names from the 321AI model list |
curl https://321ai.cc/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{"model":"deepseek-v4-pro","messages":[{"role":"user","content":"hi"}],"max_tokens":20}'
Custom OpenAI-compatible providers require manual model IDs in Dify — add the exact model names sold on 321AI (see the full list at /models/).
The key must be pasted without extra spaces; confirm the key is enabled in the console and has remaining quota.
321AI bills at the market minimum across vendors, per model — see /pricing/openai, /pricing/claude and /pricing/deepseek for the live comparison against official prices.
Related: 中文版 Dify 接入教程 · GPT price table · all 165 models