321AI Model MarketplaceLive marketplace →

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.

Dify: OpenAI-Compatible API Setup via 321AI

Audience: developers running Dify (self-hosted or cloud) who want GPT / Claude / DeepSeek / Qwen models through one OpenAI-compatible endpoint.

Prerequisites

A Dify instance (any recent version) with admin access to Settings → Model Provider; a 321AI API key (free credit on signup).

Configuration

SettingValueNote
Provider typeOpenAI-API-compatibleDify built-in provider type
API Basehttps://321ai.cc/v1must include /v1
API Keyyour 321AI keyfrom the 321AI console
Model IDe.g. gpt-5.5 / claude-sonnet-5exact names from the 321AI model list

Steps

  1. Create an API key. Sign up at 321AI and create a key in the console (free credit included for new users).
  2. Add a Model Provider in Dify. Settings → Model Provider → search "OpenAI-API-compatible" → Add.
  3. Fill endpoint and key. API Base: https://321ai.cc/v1 (must include /v1). API Key: paste your key.
  4. Add model names. Dify does not auto-list models for custom providers — add the model IDs you need, e.g. gpt-5.5, claude-sonnet-5, deepseek-v4-pro.
  5. Test in a demo app. Create a blank chat app, select your provider/model, send a test message.

Verify with curl (same endpoint Dify uses)

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}'

Troubleshooting

Model list is empty in Dify

Custom OpenAI-compatible providers require manual model IDs in Dify — add the exact model names sold on 321AI (see the full list at /models/).

Requests fail with 401

The key must be pasted without extra spaces; confirm the key is enabled in the console and has remaining quota.

Which price applies?

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

All model pricesFeatured · 321AI communityFeatured · Open-source toolsFeatured · Advertise with usFeatured