How to get a DeepSeek API key

DeepSeek API keys are made on the DeepSeek Platform at platform.deepseek.com: sign up, top up a balance, create a key on the API keys page and copy it. The key works with the OpenAI SDK at https://api.deepseek.com.

· Zurelay guides · Prices update live

Get a key from DeepSeek, step by step

  1. Sign up on the DeepSeek Platform at platform.deepseek.com.
  2. 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.
  3. 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:

terminal
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:

ModelInputOutputOn 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:

terminal
export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="$DEEPSEEK_API_KEY"
claude

DeepSeek 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:

deepseek.py
from openai import OpenAI
client = 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.

Every model on one OpenAI-compatible key, below list price. Credit from $10, no subscription.Get your API key

FAQ

Questions people ask

Anything else? Ask our team and we’ll answer by email.

Where do I get a DeepSeek API key?

On the API keys page of the DeepSeek Platform, platform.deepseek.com/api_keys. Sign up, top up a balance, then create a key and copy it.

What is the DeepSeek API base URL?

https://api.deepseek.com for OpenAI's Chat Completions format (the docs give it without /v1), and https://api.deepseek.com/anthropic for Anthropic's Messages format, which Claude Code uses.

How do I pay for the DeepSeek API?

Top up a prepaid balance on the DeepSeek Platform by PayPal, bank card, Alipay or WeChat Pay. Topped-up balance doesn't expire, and unused balance can be refunded.

Why does DeepSeek cost less at some hours?

Since August 16, 2026, DeepSeek bills half its peak price outside 01:00 to 04:00 and 06:00 to 10:00 UTC on weekdays, and on Chinese public holidays.

Can I use DeepSeek with Claude Code?

Yes. Set ANTHROPIC_BASE_URL to https://api.deepseek.com/anthropic and ANTHROPIC_AUTH_TOKEN to your DeepSeek key, then run claude. DeepSeek maps Claude model names to its own models.

More guides

Stop paying list price.
Start saving today.

Create a key in seconds, point the SDK you already use at Zurelay, and every request costs up to 90% less from the first token.