granted_balance: 0.00 and any call returns 402 Insufficient Balance. The current models are V4-Flash and V4-Pro (V3/R1 were retired 2026-07-24), it's OpenAI-SDK compatible, and it remains among the cheapest frontier APIs once you top up — but you must top up first. Want DeepSeek models at $0? NVIDIA NIM hosts DeepSeek V4 Flash free.
DeepSeek is the budget pick among low-cost AI APIs: near-frontier quality at the lowest price, with a switchable "thinking" mode most rivals charge extra for. Below: the free trial, calling V4-Flash and V4-Pro in Python (chat, thinking mode, streaming, function calling), wiring it into OpenClaw, and how it compares to Gemini, Groq, and Alibaba Bailian.
Models & Pricing
| Model | API Name | Context | Best For |
|---|---|---|---|
| DeepSeek-V4-Flash | deepseek-v4-flash | 1M | General chat, coding, high-volume tasks (default) |
| DeepSeek-V4-Pro | deepseek-v4-pro | 1M | Agents, math, complex step-by-step reasoning |
Both models support a switchable thinking effort (low / high / max), so a single model can answer fast or reason deeply. The legacy deepseek-chat and deepseek-reasoner names were discontinued on 2026-07-24 — update any old code to the deepseek-v4-* IDs.
| Details | |
|---|---|
| Free trial | None — granted_balance is 0.00 on new accounts (checked 2026-08-31, re-checked 2026-09-01) |
| V4-Flash input / output | ~$0.14 / ~$0.28 per 1M |
| V4-Pro input / output | ~$0.435 / ~$0.87 per 1M |
| Prompt caching | Cache hits ~98% cheaper than the standard input rate |
At ~$0.14 per 1M input tokens vs $5.00 for GPT-4o a small top-up goes a long way — but you have to top up first; there is no starting balance. Prices shift — check DeepSeek's pricing page before you budget.
We checked: the free trial is gone
Plenty of guides — this one included, until we retested — say new DeepSeek accounts receive 5M free tokens for 30 days. We verified that against a real account on 2026-08-31. It does not hold.
A normal chat request returns:
HTTP 402
{"error":{"message":"Insufficient Balance","type":"unknown_error",
"code":"invalid_request_error"}}
And the account's own balance endpoint confirms nothing was granted:
curl https://api.deepseek.com/user/balance -H "Authorization: Bearer $DEEPSEEK_API_KEY"
{"is_available": false,
"balance_infos": [{"currency":"CNY",
"total_balance":"0.00",
"granted_balance":"0.00", <-- no free credit
"topped_up_balance":"0.00"}]}
granted_balance: 0.00 is the decisive field: it's where promotional credit would appear, and it's empty. Run that command against your own key before planning around a free tier — it takes one second and beats any blog post, including this one.
Where to get DeepSeek models for free instead
- NVIDIA NIM hosts
deepseek-ai/deepseek-v4-flash-0731on its free tier, no card. We measured it at 27 tok/s — not fast, but free. - OpenRouter carries DeepSeek models, some with
:freevariants. - For raw speed on any free model at all, Groq ran 20× quicker in our cross-platform benchmark.
Getting an API Key
- Sign up at platform.deepseek.com and verify your email — no credit card.
- Open API Keys in the left sidebar, click Create new API key, and copy it.
- Add credit before your first call — new keys start at a 0.00 balance and return HTTP 402. (The chat app at chat.deepseek.com stays free for individual use.)
Using the API with Python
DeepSeek is fully OpenAI SDK-compatible — install openai, set the base_url, no separate package.
pip install openai
Basic chat (DeepSeek-V4-Flash)
from openai import OpenAI
client = OpenAI(
api_key="YOUR_DEEPSEEK_API_KEY",
base_url="https://api.deepseek.com"
)
response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": "Write a Python function to find all prime numbers up to N using the Sieve of Eratosthenes"}
]
)
print(response.choices[0].message.content)
Reasoning (DeepSeek-V4-Pro, thinking mode)
V4-Pro thinks before answering; read the chain-of-thought via reasoning_content, the final answer via content.
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[
{"role": "user", "content": "A train travels 120km in 1.5 hours, then 80km in 45 minutes. What is the average speed for the whole journey?"}
]
)
print("Thinking:", response.choices[0].message.reasoning_content)
print("Answer:", response.choices[0].message.content)
Streaming
stream = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Explain how neural networks learn"}],
stream=True
)
for chunk in stream:
delta = chunk.choices[0].delta
if delta.content:
print(delta.content, end="", flush=True)
Function calling
Both V4 models support tool/function calling, making them a solid agent backend.
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"}
},
"required": ["location"]
}
}
}
]
response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],
tools=tools,
tool_choice="auto"
)
tool_call = response.choices[0].message.tool_calls[0]
print("Function called:", tool_call.function.name)
print("Arguments:", tool_call.function.arguments)
Connect DeepSeek to OpenClaw (Free AI Agent)
Pair DeepSeek with OpenClaw for a free autonomous agent that searches the web, runs code, manages files, and messages on WhatsApp or Telegram. Onboard the quick way:
npm install -g openclaw@latest
openclaw onboard
Choose OpenAI-compatible, enter https://api.deepseek.com as the base URL, and paste your key. Or configure manually in ~/.openclaw/openclaw.json:
{
"models": {
"mode": "merge",
"providers": {
"deepseek": {
"baseUrl": "https://api.deepseek.com",
"apiKey": "YOUR_DEEPSEEK_API_KEY",
"api": "openai-completions",
"models": [
{
"id": "deepseek-v4-flash",
"name": "DeepSeek V4 Flash",
"reasoning": false,
"input": ["text"],
"contextWindow": 1000000,
"maxTokens": 8192
},
{
"id": "deepseek-v4-pro",
"name": "DeepSeek V4 Pro",
"reasoning": true,
"input": ["text"],
"contextWindow": 1000000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "deepseek/deepseek-v4-flash"
},
"models": {
"deepseek/deepseek-v4-flash": {}
}
}
}
}
Use deepseek-v4-flash for everyday tasks and switch to deepseek-v4-pro for complex multi-step problems.
DeepSeek vs Other Free AI APIs
| Feature | DeepSeek | Google Gemini | Groq | Alibaba Bailian |
|---|---|---|---|---|
| Best Model | DeepSeek-V4-Pro | Gemini 2.5 Pro | Llama 3.3 70B | Qwen 3.6-Plus |
| Free Tier | None (top-up required) | Published limits withdrawn | 1,000 RPD / 200K TPD on the free models | 1M tokens/model |
| Paid Pricing | Cheapest (~$0.14/1M) | Moderate | Very low | Very low |
| Reasoning | Yes (thinking mode) | 2.5 Pro (thinking) | No | QwQ (limited) |
| Context Window | 1M | 1M | 128K | 1M |
| OpenAI Compatible | Yes | Yes | Yes | Yes |
| Speed | Moderate | Fast | Ultra-fast | Fast |
| Multimodal | No | Yes | No | Yes |
When to Use It — and When Not To
Reach for DeepSeek when: you're coding or debugging (V4-Flash), solving math/logic step by step (V4-Pro), running cost-sensitive high-volume apps, migrating off OpenAI with zero code changes, or building tool-using agents.
Look elsewhere when:
- You need multimodal — DeepSeek is text-only; use Gemini for image/audio/video.
- You want a free tier at all — DeepSeek no longer has one; for ongoing free quotas look at Groq, or run DeepSeek models free on NVIDIA NIM.
- You cannot prepay — access starts only after a top-up, though pricing stays very low.
- Streaming with thinking —
reasoning_contentarrives before the final answer; handle both in your loop.
Frequently Asked Questions
Is DeepSeek free?
The chat app at chat.deepseek.com is free for individual use. The API is not: new accounts get no starting balance (granted_balance 0.00) and calls return HTTP 402 until you top up. Paid pricing is still very low — ~$0.14/1M input on V4-Flash, up to 30× cheaper than GPT-4o. (Verified 2026-09-01.)
Is it really OpenAI SDK-compatible?
Yes — install the openai package and point base_url at https://api.deepseek.com. It's a drop-in replacement with no code rewrite.
What's the difference between V4-Flash and V4-Pro?
V4-Flash (deepseek-v4-flash) is the fast, cheap default for coding and chat. V4-Pro (deepseek-v4-pro) is tuned for agents and reasoning. Both support a switchable thinking effort (low/high/max); in thinking mode they expose a chain-of-thought via reasoning_content before answering.
What happened to V3 and R1?
The V3 and R1 model names — and the deepseek-chat/deepseek-reasoner API aliases — were retired on 2026-07-24, replaced by the V4 line. Update any old code to deepseek-v4-flash or deepseek-v4-pro.
How does it compare to Groq and Gemini?
Groq is faster; Gemini wins on multimodal. But for the best mix of reasoning capability and cost, DeepSeek V4 leads on price among frontier APIs in 2026.
Get started: platform.deepseek.com