Get a key from DeepSeek, step by step
- Sign up on the DeepSeek Platform at platform.deepseek.com.
- Top up a balance. DeepSeek takes PayPal, bank cards, Alipay and WeChat Pay. Topped-up balance doesn't expire, and unused balance can be refunded. Any granted balance on your account is spent first.
- Create a key on the API keys page, copy it and store it somewhere safe.
Test the key
DeepSeek speaks OpenAI's Chat Completions format at https://api.deepseek.com. Its current model names are deepseek-flash (now V4.1 Flash 1017) and deepseek-v4-pro:
export DEEPSEEK_API_KEY="your-key"curl https://api.deepseek.com/chat/completions \ -H "Authorization: Bearer $DEEPSEEK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "deepseek-flash", "messages": [{"role": "user", "content": "Say hello"}]}'In the OpenAI SDK, set base_url="https://api.deepseek.com" and use the DeepSeek key.
What it costs: peak and off-peak
Since August 16, 2026, DeepSeek bills by time of day. Peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday; the rest of the week, and Chinese public holidays, cost half. Peak list prices per 1M tokens:
| Model | Input | Output | On Zurelay (in / out) |
|---|---|---|---|
| DeepSeek V4.1 Flash 1017 | $0.30 | $1.20 | $0.03 / $0.12 |
| DeepSeek V4 Pro 0813 | $1.32 | $3.96 | $0.23 / $0.62 |
Cache hits, the repeated start of a prompt, cost a small fraction of the input price, so agents and chat apps pay far less than these figures suggest.
DeepSeek in Claude Code
DeepSeek also serves Anthropic's Messages format, so Claude Code can run on a DeepSeek key. Set two variables before running claude:
export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"export ANTHROPIC_AUTH_TOKEN="$DEEPSEEK_API_KEY"claudeDeepSeek maps Claude model names to its own and ignores some Anthropic fields, so check its Anthropic-compatible notes if a feature misbehaves. To use models that only speak OpenAI's format, or several providers at once, see Claude Code Router.
Is there a free DeepSeek API key?
The key is free, but requests are paid from your balance. DeepSeek's pricing page spends a granted balance first when an account has one, without saying who gets one. The chat app at chat.deepseek.com is free, but it's not the API.
Another way: DeepSeek on one key with every other model
On Zurelay, DeepSeek is a model name on the same OpenAI-compatible key as Claude, GPT and Gemini, with DeepSeek V4.1 Flash 1017 at $0.03 in and $0.12 out per 1M tokens, 90% below DeepSeek's peak list price, at any hour:
from openai import OpenAIclient = OpenAI(base_url="https://api.zurelay.com/v1", api_key="YOUR_ZURELAY_KEY")reply = client.chat.completions.create( model="deepseek-v4.1-flash-1017", messages=[{"role": "user", "content": "Say hello"}],)print(reply.choices[0].message.content)Credit starts at $10 by card. See DeepSeek API pricing for every DeepSeek model.
Steps, top-up and prices read from DeepSeek's API docs, pricing, Anthropic API guide and FAQ on October 28, 2026.