How to Use DeepSeek R1 for Free: Step-by-Step Beginner Guide
The DeepSeek API gives you access to one of the most powerful reasoning models in the world. New accounts get 5 million free tokens on signup. Here's exactly how to set it up in under 10 minutes.
Most "API guides" assume you already know what an API is, what Python is, and why any of this matters. This one doesn't. I'm going to walk you through it from zero — account creation, API key, first working code call, and how to use it without ever paying a dollar unless you want to scale.
If you've read my full DeepSeek R1 review, you already know why this model is worth your time. Now let's put it to work.
Let's dive deep.
Table of Contents
- 1. What is the DeepSeek API (and why should you care)?
- 2. How Much Does It Cost? (Free Tier Explained)
- 3. Step 1 — Create Your DeepSeek Account
- 4. Step 2 — Get Your API Key
- 5. Step 3 — Make Your First API Call (No Code Experience Needed)
- 6. Step 4 — Use DeepSeek API with Python
- 7. Step 5 — Use DeepSeek R1 (Reasoning Model) via API
- 8. How to Stretch Your Free Credits Further
- 9. DeepSeek API vs OpenAI API — Real Cost Comparison
- 10. Final Tips & Common Mistakes to Avoid
1. What is the DeepSeek API (and Why Should You Care)?
An API (Application Programming Interface) is simply a way for your code — or tools you use — to talk to an AI model directly, without going through a chat interface. Instead of typing into a box, your application sends a request and gets a response back automatically.
Why does this matter? Because once you're using the API, you can:
- Build your own AI-powered tools and apps
- Automate content creation, research, and analysis
- Connect DeepSeek to other platforms like Notion, Google Sheets, or your website
- Run hundreds of AI queries in batch — at a fraction of the cost of ChatGPT
DeepSeek offers two main models through the API:
- DeepSeek-V3 (
deepseek-chat) — Fast, capable general model. Best for writing, summarization, content creation. - DeepSeek-R1 (
deepseek-reasoner) — Slow, deep reasoning model. Best for math, coding, logic, analysis. Read my full R1 review here.
💡 Good to know: DeepSeek's API is fully compatible with the OpenAI API format. This means if you've ever used ChatGPT's API — or any tool built for it — you can switch to DeepSeek by changing just two lines of code.
2. How Much Does It Cost? (Free Tier Explained)
Here's the honest breakdown of what's free and what costs money:
| Access Method | Cost | Limits | Best For |
|---|---|---|---|
| Web App (chat.deepseek.com) | Free forever | Daily reset limits | Personal daily use |
| API (new account) | 5M free tokens | Valid 30 days | Testing & prototyping |
| API (paid — V3) | $0.27–$1.10 / 1M tokens | None | Production apps |
| API (paid — R1) | $0.55 / 1M tokens | None | Reasoning & coding |
What does 5 million free tokens actually get you? A lot. One token is roughly ¾ of a word. Five million tokens = approximately 3.75 million words of AI-generated content. That's enough to write 15,000 blog posts, run thousands of code reviews, or process hundreds of research documents — all for free, within your first 30 days.
⚠️ Heads up: DeepSeek occasionally pauses new API registrations during high-traffic periods. If you hit a waitlist, try again the next day — pauses rarely last more than 24 hours.
Step 1 — Create Your DeepSeek Account
This takes less than 2 minutes.
- Go to platform.deepseek.com — this is the developer platform, separate from the chat app.
- Click "Sign Up" in the top right corner.
- Enter your email address and create a password.
- Check your inbox for a verification email — click the link inside.
- Log back into platform.deepseek.com with your new credentials.
Once you're in, you'll see your dashboard. You should automatically see your 5 million free trial tokens credited to your account. If you don't see them immediately, give it a few minutes — they appear in the billing or usage section.
💡 Privacy note: Your API account data routes through DeepSeek's servers in China. For personal projects and testing, this is fine. For sensitive business or client data, use a self-hosted version instead.
Step 2 — Get Your API Key
Your API key is what lets your code authenticate with DeepSeek. Think of it as a password that only your application uses.
- In the platform dashboard, click "API Keys" in the left sidebar.
- Click "Create new API key".
- Give it a name — something like
my-first-keyordevelopment. - Click Create.
- Copy the key immediately — it starts with
sk-and will only be shown once. If you miss it, you'll need to create a new one. - Paste it somewhere safe — a notes app, a password manager, or a local text file.
🔴 Security Rule — Never Do This:
Never paste your API key directly into code you share publicly — on GitHub, in a blog post, in a forum reply. Anyone who gets your key can use your credits. Always store keys in environment variables or a .env file that's excluded from version control.
Step 3 — Make Your First API Call (No Code Experience Needed)
Before we write any Python, let's prove the API works using a simple method anyone can run — a cURL command. If you're on Windows, use Git Bash or PowerShell. On Mac or Linux, use Terminal.
Open your terminal and paste this — replacing YOUR_API_KEY with your actual key:
curl https://api.deepseek.com/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "deepseek-chat",
"messages": [
{"role": "user", "content": "Explain what an API is in one sentence."}
]
}'
Hit Enter. Within a few seconds you'll see DeepSeek's response appear directly in your terminal. That's your first API call. Done.
If you see a response — congratulations. Your API key works and your free credits are active. If you see an error, double-check that you copied the full API key with no extra spaces.
Step 4 — Use DeepSeek API with Python
Python is the easiest language for working with AI APIs. If you don't have Python installed, download it free at python.org — takes 3 minutes.
Install the OpenAI library (yes, OpenAI's — DeepSeek uses the same format):
pip install openai
Now create a new file called deepseek_test.py and paste this:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY_HERE",
base_url="https://api.deepseek.com"
)
response = client.chat.completions.create(
model="deepseek-chat",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What are the top 3 benefits of using DeepSeek over ChatGPT?"}
]
)
print(response.choices[0].message.content)
Run it with:
python deepseek_test.py
You'll see DeepSeek's answer printed in your terminal. That's a live API call to a world-class AI model — running from your own machine, using your own key, at less than $0.001 per response.
💡 Notice the two lines that make this work differently from OpenAI:
api_key="YOUR_DEEPSEEK_KEY" — your DeepSeek key, not OpenAI's
base_url="https://api.deepseek.com" — points to DeepSeek's servers
Everything else is identical to OpenAI's SDK. That's the beauty of compatibility.
Step 5 — Use DeepSeek R1 (Reasoning Model) via API
DeepSeek R1 is the reasoning model — the one that scored 96.3% on AIME math benchmarks and outperformed OpenAI's o1. To use it instead of V3, change one line:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY_HERE",
base_url="https://api.deepseek.com"
)
response = client.chat.completions.create(
model="deepseek-reasoner", # ← This switches you to R1
messages=[
{"role": "user", "content": "A train travels 300km in 5.5 hours including a 30-minute stop. What is the average speed for the entire journey?"}
]
)
# R1 returns reasoning + final answer
print("Reasoning:", response.choices[0].message.reasoning_content)
print("Answer:", response.choices[0].message.content)
Notice something important: R1 returns two outputs — reasoning_content (the full chain-of-thought) and content (the final answer). This is the Think mode you see in the web app, accessible directly through the API. You can log the reasoning, display it to users, or use it to audit the model's logic before trusting the output.
For math problems, complex coding tasks, and multi-step analysis — always use deepseek-reasoner. For everything else — content generation, summarization, simple Q&A — use deepseek-chat (V3). It's faster and cheaper.
8. How to Stretch Your Free Credits Further
5 million tokens is generous but not infinite. Here's how to make them last:
1. Use V3 for simple tasks, R1 only for hard ones. R1's reasoning tokens cost more because the model thinks longer. Don't use a sledgehammer for a nail — use deepseek-chat for writing and summarization, reserve deepseek-reasoner for math, code, and logic.
2. Keep your system prompts short. Every word in your prompt costs tokens. A 500-word system prompt running 1,000 times costs 500,000 tokens before the model says a single word. Write tight, specific prompts.
3. Use context caching for repeated prompts. If you're sending the same long system prompt repeatedly (like a custom assistant with detailed instructions), DeepSeek's caching feature dramatically reduces costs. Cached input tokens cost up to 90% less than regular input tokens.
4. Set max_tokens limits. Add max_tokens=500 (or whatever you need) to your API calls. This prevents runaway responses that consume far more tokens than necessary.
5. Batch your requests during off-peak hours. DeepSeek's API applies steeper discounts during low-traffic windows (typically off-peak UTC hours). For non-urgent batch jobs, scheduling them overnight can meaningfully reduce costs once you move to paid.
9. DeepSeek API vs OpenAI API — Real Cost Comparison
Let's make this concrete. Say you're building a content tool that processes 100,000 words of input and generates 50,000 words of output every month.
| Model | Input Cost | Output Cost | Monthly Total |
|---|---|---|---|
| DeepSeek V3 | $0.27/1M | $1.10/1M | ~$0.09 |
| DeepSeek R1 | $0.55/1M | $2.19/1M | ~$0.18 |
| GPT-4o | $2.50/1M | $10.00/1M | ~$0.75 |
| OpenAI o1 | $15.00/1M | $60.00/1M | ~$4.50 |
At this usage level, DeepSeek V3 costs $0.09/month vs OpenAI o1 at $4.50/month. That's a 50x cost difference for comparable reasoning quality. At scale — 10x or 100x that volume — the savings become transformational for any indie builder or startup.
10. Final Tips & Common Mistakes to Avoid
✅ Do these:
- Store your API key in a
.envfile, never hardcoded in your script - Use
deepseek-chat(V3) for speed-sensitive tasks,deepseek-reasoner(R1) for accuracy-critical ones - Monitor your token usage in the platform dashboard weekly
- Test with small prompts before running large batch jobs
- Use the API via a VPN or self-hosted setup for sensitive data
❌ Avoid these:
- Never share your API key publicly — regenerate immediately if compromised
- Don't use R1 for every task — it's slower and costs more per token than V3
- Don't send sensitive personal or business data through the hosted API
- Don't forget your 30-day trial window — use your free tokens before they expire
- Don't write 500-word system prompts when 50 words will do the same job
Ready to get your free API key?
5 million tokens free on signup. No credit card required to start.
Get Your Free DeepSeek API Key →Related Articles
- DeepSeek R1 Review 2026: Better Than GPT-5? (Hands-On Test)
- 12 Best Free AI Tools March 2026 (Tested & Ranked)
- DeepSeek V3 vs ChatGPT-5 – Full Comparison
Want Weekly DeepSeek & AI Updates?
Join TechPulse Weekly →Fresh AI tools, reviews & guides delivered every week. No spam.