DeepSeek API key: how to get one and which base_url to use
Two ways to a DeepSeek key: the official platform and the Zukko gateway. API addresses, model names, checking the key and common connection errors.
5 min · · API keys · models
A DeepSeek API key is what you need to call DeepSeek models from code, an editor or a chat client. You can get one in two ways: on the official DeepSeek platform, or through an API gateway where one key works for several vendors. Below is what to do in each case, which base_url and model name to use, how to verify in a minute that the key works, and how not to mix up the addresses.
Path 1. A key on the official DeepSeek platform
The order is the same as on most API platforms:
- Register on the DeepSeek platform (platform.deepseek.com) and sign in to your account.
- Top up the balance. In DeepSeek's documentation, error 402 is explained as "balance ran out" and the fix is the top-up page.
- Create a key in the API keys section of the account and store it in a password manager or an environment variable.
Menu item names and the registration and payment methods are defined by the platform itself and may change, so check against what you see on the site. If you are in Russia and the official route does not suit you, the second option, through a gateway, is described below.
The official parameters according to DeepSeek's documentation at the time of writing:
| Parameter | Value |
|---|---|
base_url (OpenAI format) | https://api.deepseek.com |
base_url (Anthropic format) | https://api.deepseek.com/anthropic |
| Chat endpoint | https://api.deepseek.com/chat/completions |
| Model names | deepseek-flash, deepseek-v4-pro |
| Context | 1M tokens |
Note that the official address has no /v1 suffix, and the fast model is named deepseek-flash. The documentation also says older model names are still accepted but served by the newer model. DeepSeek's prices depend on the time of day (there is a peak and an off-peak rate), so see the current table on the pricing page of its documentation.
Path 2. A DeepSeek key through the Zukko gateway
If you need access from Russia with payment via SBP, MasterCard or crypto, or want DeepSeek together with Claude, GPT, Gemini, Qwen and GLM on one balance, a gateway fits. It is not an official DeepSeek service: you work with your own Zukko key and a Zukko address.
- Register in the Zukko dashboard and top up the balance from $1.
- On the API keys page create a key. It looks like
fetch_...and is shown once, so copy it immediately. - If you like, set a daily and monthly dollar limit on the key and a list of allowed models.
Connection parameters:
| Parameter | Value |
|---|---|
base_url (OpenAI format) | https://api.zukko.pro/v1 |
| Chat endpoint | https://api.zukko.pro/v1/chat/completions |
| Authorization | Authorization: Bearer fetch_... |
| DeepSeek models | deepseek-v4.1-flash, deepseek-v4-pro |
The model list is always available through GET https://api.zukko.pro/v1/models (see the models documentation). The key goes in the Authorization: Bearer header; the Anthropic SDK sends it as x-api-key, which also works.
Which addresses and model names not to mix
The most common mistake is to take the base_url from one place and the model name from another.
| You use | base_url | Model name |
|---|---|---|
| A key from the DeepSeek platform | https://api.deepseek.com | deepseek-flash |
| A Zukko key | https://api.zukko.pro/v1 | deepseek-v4.1-flash |
A key from one system will not fit the address of the other: you will get a 401. A model name from someone else's documentation gives a model_not_found (404) error.
How to check that the key works
First check the key with a balance request. It spends no tokens, and a wrong key gives 401 at once (the model list is not suitable for this: it is open and does not validate the key):
curl https://api.zukko.pro/v1/balance \
-H "Authorization: Bearer $ZUKKO_API_KEY"Then send a short request to a model:
curl https://api.zukko.pro/v1/chat/completions \
-H "Authorization: Bearer $ZUKKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"messages": [{"role": "user", "content": "Answer with one word: working"}]
}'The same in Python with the official openai library:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.zukko.pro/v1",
api_key=os.environ["ZUKKO_API_KEY"],
)
response = client.chat.completions.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Answer with one word: working"}],
)
print(response.choices[0].message.content)
print(response.usage)For the official platform only base_url="https://api.deepseek.com", the key and the model name deepseek-flash change. Keep the key in an environment variable rather than in code: see storing API keys safely. If a key still ended up in a public repository, revoke it at once and create a new one.
What the errors mean
| Code | Cause | What to do |
|---|---|---|
| 401 | wrong or truncated key, or a key used with the wrong address | copy the whole key, check base_url |
| 402 | the balance ran out | top up on the system whose key you use |
403 model_not_allowed_for_key (Zukko) | the model is not in the key's list | add the model in the key settings |
404 model_not_found (Zukko) | unknown model name | take the name from GET /v1/models |
| 429 | a key limit or a restriction at the provider | wait, lower the frequency, check the key's limits |
| 503 | the provider is unavailable or the model is disabled | retry later or take another model |
A closer look at 401 is in the article error 401 Invalid API key.
What it costs
Prices per 1M tokens as of October 18, 2026 (input / output):
| Model | Zukko | Official price | Context | Strength index |
|---|---|---|---|---|
deepseek-v4.1-flash | 0.013 / 0.038 | 0.15 / 0.6 | 1M | 39 |
deepseek-v4-pro | 0.075 / 0.225 | 0.66 / 1.98 | 1M | 36 |
The official prices in the table match DeepSeek's off-peak rate; during peak hours the platform's own prices are higher, so check its pricing page.
An example: 1,000 requests with 2,000 input and 500 output tokens each, that is 2M input and 0.5M output. On deepseek-v4.1-flash in Zukko: 2 × $0.013 + 0.5 × $0.038 = $0.026 + $0.019 = $0.045. At the official prices from the table: 2 × $0.15 + 0.5 × $0.6 = $0.60. On deepseek-v4-pro in Zukko: 2 × $0.075 + 0.5 × $0.225 = $0.2625, at official prices: 2 × $0.66 + 0.5 × $1.98 = $2.31. For DeepSeek models in Zukko, a cache read costs the same as input, so count all input at the input price. The strength index is the Intelligence Index from Artificial Analysis; whether a model suits your task, test on your own examples. More about the cheapest model in the article DeepSeek V4.1 Flash via API.
Top-up via SBP: the payment page adds 8.5% on top, and the balance receives the dollar amount you requested. Cryptocurrency and MasterCard cards are also available (fee of about 13%, amounts $2 to $594).
FAQ
Where can I get a DeepSeek API key for free?
We do not promise free access. The official platform's terms (including any starting credit) are set by the platform and change: check on its site. Zukko credits nothing for registration itself; there is $0.50 for subscribing to the @zukkopro channel, once per Telegram account.
Which DeepSeek API URL should I use?
For the official platform, https://api.deepseek.com (OpenAI format) or https://api.deepseek.com/anthropic (Anthropic format). For a Zukko key, https://api.zukko.pro/v1.
Can I use one key for chat and for code?
Yes. A Zukko key works in the OpenAI and Anthropic formats and fits editors, SDKs and scripts. Which format to pick depends on the tool: OpenAI SDK clients use /v1/chat/completions, Claude Code and the Anthropic SDK use /v1/messages.
How do I find out which DeepSeek models are available now?
Call GET /v1/models or open the "Models" page in the dashboard: the set and prices change.
To get a Zukko key, open the API keys page.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- xAI Grok API: Connecting Grok 4.7, Price and the 256K ContextHow to call grok-4.7 through an OpenAI-compatible API, what to do about the 256K context limit and what typical requests cost. Plus a comparison with Grok 4.6.
- Grok API from Russia: connecting without a foreign cardStep by step connection to Grok 4.7, 4.6 and 4.5 through a gateway: key, address, first request in curl and Python, streaming, images and payment by SBP or crypto.
- Claude Sonnet 5.5 via API: connection, prices and cache at October 18, 2026How to call claude-sonnet-5-5 from Python and curl, what a typical request costs with and without cache, and how it differs from Sonnet 5 and Sonnet 4.6.
- Claude on Android in Russia: what to do if the app won't installIf the official Claude app won't install on Android in Russia, you can still use the model from your phone: through the gateway's web chat or a client with your own key.