dify uses free deepseek v3.1 through openrouter

Update 20251203:

In fact, even if you top up, the free models have many restrictions, and it’s easy to hit usage limits.
The relevant documentation states the following: 20 requests per minute, which can be easily exceeded.

There are a few rate limits that apply to certain types of requests, regardless of account status:

  1. Free usage limits: If you’re using a free model variant (with an ID ending in :free), you can make up to 20 requests per minute. The following per-day limits apply:
  • If you have purchased less than 10 credits, you’re limited to 50 :free model requests per day.
  • If you purchase at least 10 credits, your daily limit is increased to 1000 :free model requests per day.
  1. DDoS protection: Cloudflare’s DDoS protection will block requests that dramatically exceed reasonable usage.

API Rate Limits | Configure Usage Limits in OpenRouter | OpenRouter | Documentation

Update 20251020:

OpenRouter is not unlimited free (of course), without recharging, you will quickly reach the free quota (I don’t know the exact amount).

At this point, requests will report errors:

Job exception: {"error":{"message":"Rate limit exceeded: free-models-per-day. Add 10 credits to unlock 1000 free model requests per day","code":429,"metadata":{"headers":{"X-RateLimit-Limit":"50","X-RateLimit-Remaining":"0","X-RateLimit-Reset":"xxxxx"},"provider_name":null}},"user_id":"user_xxxxx"}

If you recharge $10, you can then make 1000 free model requests per day again.

Introduction to OpenRouter

Through OpenRouter, you can use various large models on the market, all with one key.
For details about OpenRouter, see: Essential Tools for Individual Developers: OpenRouter Makes Market Large Models Accessible

Currently, OpenRouter provides the free quota for deepseek v3.1, which is sufficient for daily testing needs.

Introduction to dify

Dify is an AI agent construction tool, allowing you to easily create your own AI agents.
Learn more about dify here: Getting Started with AI Agents: dify Super Fast AI Agent Construction - Zhihu

Using OpenRouter’s free deepseek v3.1 in dify

Open settings in dify

Select model provider, and search for openrouter

Fill in the key obtained from OpenRouter, click here to get it

After configuring, you’ll see a large number of models supported by OpenRouter

But note, among these default models, deepseek v3.1 is paid.

You need to add manually

Copy this model name: deepseek/deepseek-chat-v3.1:free
Use the key you previously applied for.
Keep other settings as default; don’t change if unsure.

Verify

It works normally in dify

Cost in OpenRouter shows 0

Done :tada:

More

OpenRouter provides many free models, such as qwen3, kimi k2, etc., with similar usage processes.
See details: Models: ‘free’ | OpenRouter

There is also a free embedding service available at 免费的embedding服务