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:

  1. Register on the DeepSeek platform (platform.deepseek.com) and sign in to your account.
  2. Top up the balance. In DeepSeek's documentation, error 402 is explained as "balance ran out" and the fix is the top-up page.
  3. 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:

ParameterValue
base_url (OpenAI format)https://api.deepseek.com
base_url (Anthropic format)https://api.deepseek.com/anthropic
Chat endpointhttps://api.deepseek.com/chat/completions
Model namesdeepseek-flash, deepseek-v4-pro
Context1M 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.

  1. Register in the Zukko dashboard and top up the balance from $1.
  2. On the API keys page create a key. It looks like fetch_... and is shown once, so copy it immediately.
  3. If you like, set a daily and monthly dollar limit on the key and a list of allowed models.

Connection parameters:

ParameterValue
base_url (OpenAI format)https://api.zukko.pro/v1
Chat endpointhttps://api.zukko.pro/v1/chat/completions
AuthorizationAuthorization: Bearer fetch_...
DeepSeek modelsdeepseek-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 usebase_urlModel name
A key from the DeepSeek platformhttps://api.deepseek.comdeepseek-flash
A Zukko keyhttps://api.zukko.pro/v1deepseek-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):

bash
curl https://api.zukko.pro/v1/balance \
  -H "Authorization: Bearer $ZUKKO_API_KEY"

Then send a short request to a model:

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

bash
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

CodeCauseWhat to do
401wrong or truncated key, or a key used with the wrong addresscopy the whole key, check base_url
402the balance ran outtop up on the system whose key you use
403 model_not_allowed_for_key (Zukko)the model is not in the key's listadd the model in the key settings
404 model_not_found (Zukko)unknown model nametake the name from GET /v1/models
429a key limit or a restriction at the providerwait, lower the frequency, check the key's limits
503the provider is unavailable or the model is disabledretry 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):

ModelZukkoOfficial priceContextStrength index
deepseek-v4.1-flash0.013 / 0.0380.15 / 0.61M39
deepseek-v4-pro0.075 / 0.2250.66 / 1.981M36

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.

Get API keyDocumentation

api.zukko.pro · fetch_*

DeepSeek API key: how to get it and which base_url · Zukko