How Do You Get a DeepSeek API Key?
A DeepSeek API key is generated from the API keys section of the DeepSeek platform console, and it is displayed exactly once at creation. Copy it at that moment or generate a replacement, because there is no way to read an existing key back out.
Two things surprise people immediately after that. There is no stated API free tier on DeepSeek's official pricing page, so a fresh key returns nothing until the account holds a balance. And the model name you paste from an older tutorial may no longer exist.
The API is OpenAI-compatible, so most SDKs work by changing the base URL and the key. That compatibility is also why stale tutorials survive: the code shape does not change, only the model string and the price do.
Four things worth doing in the first five minutes:
- Put the key in a secret manager before it touches a
.envfile you might commit - Generate a second key for staging so production revocation is not a two-service outage
- Confirm the exact model name you are calling against the current docs, not a blog post
- Decide whether your traffic runs at peak or off-peak hours, because that single choice doubles or halves the bill
For everything the key does not cover, AI Perks tracks $7.7M in credits across 194 companies, including the providers that do hand out free API balance.

What Does a DeepSeek API Key Actually Cost?
DeepSeek is the only major model vendor that charges by time of day. Peak hours are 01:00-04:00 and 06:00-10:00 UTC on weekdays, and everything outside those windows is off-peak at half the price.
Published rates, in USD per million tokens:
| Model and token type | Off-peak | Peak |
|---|---|---|
| DeepSeek-V4-Pro-0813 input, cache hit | $0.022 | $0.044 |
| DeepSeek-V4-Pro-0813 input, cache miss | $0.66 | $1.32 |
| DeepSeek-V4-Pro-0813 output | $1.98 | $3.96 |
| DeepSeek-V4.1-Flash input, cache hit | $0.003 | $0.006 |
| DeepSeek-V4.1-Flash input, cache miss | $0.15 | $0.30 |
Peak covers seven hours per weekday. That is 35 of the 168 hours in a week, so roughly 79% of the week is already off-peak (derived from the published windows). Most teams get the cheaper rate by accident and never learn why their cost per request moves.
Batch work is where this becomes a real lever. A nightly job scheduled at 05:00 UTC sits in the off-peak gap between the two peak windows and costs half of the same job at 07:00 UTC. No code changes, no model downgrade, one cron line.
Why the Cache Hit Matters More Than the Clock
Two multipliers stack on every DeepSeek call: off-peak halves the bill, and a cache hit is roughly 30x cheaper than a cache miss on V4-Pro. Together they produce a 60x spread on input tokens for the same model, from $0.022 per million cached off-peak to $1.32 per million uncached at peak.
Here is what that means for one concrete job, 10M input tokens and 2M output tokens on V4-Pro (arithmetic derived from the published rates above):
| Same job, different conditions | Total cost |
|---|---|
| Off-peak, cached input | $4.18 |
| Peak, cached input | $8.36 |
| Off-peak, cache miss | $10.56 |
| Peak, cache miss | $21.12 |
Identical work, a 5x spread. The clock alone is a clean 2x. The cache is the bigger prize, and it is the one you control in code by keeping a stable prefix at the front of every prompt.
If you are still comparing providers at this stage, the cheapest hour on DeepSeek is a different question from the cheapest provider overall. AI Perks covers where free balance exists so paid tokens are a last resort rather than a first one.

What Changed Since DeepSeek's Last Price List
On 16 August 2026 DeepSeek moved from flat per-token pricing to the peak and off-peak schedule, which means every DeepSeek cost estimate published before that date is wrong in both directions.
The sequence, for anyone reconciling old numbers:
- 24 April 2026: V4-Pro and V4-Flash preview, with a 1M-token context window, up to 384K output tokens, and switchable thinking and non-thinking modes
- 31 July 2026: DeepSeek-V4-Flash-0731, the stable Flash release. Last known pricing before the change was $0.14 per million cache-miss input and $0.28 per million output, which is historical context now, not a quotable rate
- 13 August 2026: DeepSeek-V4-Pro-0813 reaches general availability as the flagship reasoning and agent model
- 16 August 2026: peak and off-peak pricing takes effect
- Around 10 September 2026: DeepSeek-V4.1-Flash appears in the docs as DeepSeek-Flash
Our earlier DeepSeek pricing guide predates all of this. Treat any single flat input and output figure for DeepSeek as a snapshot of one half of one day.
The Endpoint Rename That Breaks Working Code
DeepSeek-V4.1-Flash quietly retired the deepseek-v4-flash and deepseek-v4-flash-vision-exp endpoint names. Code that still passes those model strings fails, and the failure looks like a bad key rather than a bad model name.
That is the trap. A rejected model string and an unfunded or revoked key both surface as an error at the same call site, so teams rotate the key, redeploy, and get the same failure. Check the model string first when a previously working DeepSeek integration stops responding.
Tutorials, Stack Overflow answers and copy-pasted starter repos still reference the retired names. Anything written before September 2026 is suspect, including code samples inside otherwise current articles.

How to Secure a DeepSeek API Key
A leaked model API key is a spending vulnerability before it is a data one, and it is usually leaked by your own repository rather than by the provider. The defences are boring and they work.
Never ship the key to a client. Browser bundles, mobile apps and desktop Electron builds are all readable. Route every call through a backend you control, even for a prototype.
One key per environment and per service. Revocation should be surgical. A single shared key means killing a leaked credential takes down production, staging and the internal tool at once.
Scan git history, not just the working tree. Removing a key in a later commit leaves it in the history and in every fork and clone. Rotate rather than delete.
Rotate on a schedule and on every departure. Quarterly is a reasonable floor. Anyone who has ever had the key keeps it until it is revoked.
Set a spend alarm, not just a budget. Check whether your account balance is prepaid or postpaid and size the held balance accordingly, because the exposure from a leaked key is bounded by whichever model your account uses.
Keep keys out of third-party playgrounds. Browser extensions, chat wrappers and "test your prompt" sites are a common exfiltration path, and the key you paste there inherits your full balance.
Does DeepSeek Give Out Free API Credits?
The DeepSeek chat app is free to use, but there is no stated API free tier on the official pricing page, and DeepSeek runs no dedicated startup credit program. Both facts matter for anyone budgeting a launch.
Claims of free API credits for new DeepSeek accounts circulate widely and are inconsistently reported. They are not confirmed on the official pricing page, so plan as if they do not exist and treat any balance you receive as a bonus.
Third-party hosts are the other route. Baseten lists DeepSeek V4.1 Flash input at $0.30 per million and has a standing $30 new-workspace trial credit, though that input figure matches DeepSeek's own peak cache-miss rate and is double the off-peak one. OpenRouter, Together and Fireworks also host DeepSeek models. Verify any hosted price yourself before budgeting against it, because the routing convenience usually carries a margin.
The absence of a DeepSeek startup program is a genuine gap for founders. The providers that do run one give out real balance, and AI Perks tracks $7.7M across 194 companies so a cheap paid default like DeepSeek sits underneath a stack of free credits rather than replacing it.
See what is available at getaiperks.com →

Frequently Asked Questions
Is there a free DeepSeek API key?
No. The DeepSeek chat app is free, but the official pricing page states no API free tier, so a new key needs a funded balance. Reports of free credits for new accounts are inconsistent and unconfirmed. Providers that do offer free API balance are tracked at getaiperks.com.
What are DeepSeek's peak hours?
Peak is 01:00-04:00 and 06:00-10:00 UTC on weekdays. Everything else, including all weekend hours, is off-peak at half the price. That is 35 of the 168 hours in a week, or roughly 21% at peak rates (derived from the published windows), so scheduled batch work should simply avoid those two windows.
Why did my DeepSeek API call suddenly stop working?
Check the model string before the key. DeepSeek-V4.1-Flash retired the deepseek-v4-flash and deepseek-v4-flash-vision-exp endpoint names, and a rejected model name produces an error that looks like an authentication failure. Older tutorials and starter repos still reference the retired names, so update the model string and redeploy before touching your credentials.
How much cheaper is a DeepSeek cache hit?
On DeepSeek-V4-Pro-0813, cached input costs $0.022 per million off-peak against $0.66 per million for a cache miss, about 30x. Combined with off-peak timing, the spread against a peak cache miss at $1.32 per million reaches 60x on the same model.
Does DeepSeek have a startup credit program?
No. DeepSeek runs no dedicated startup credit program, which makes it a cheap paid default rather than a free one. Most major AI and cloud providers do run programs, and AI Perks tracks $7.7M in credits across 194 companies covering the ones that do.
Should I use DeepSeek directly or through a hosting provider?
Direct access gets you the off-peak and cache-hit pricing, which hosted routes generally do not reproduce. Hosts like OpenRouter, Together, Fireworks and Baseten add failover, unified billing and a single key across models, at a margin. Verify any hosted price before budgeting against it.
Pay DeepSeek prices for the cheap tier. Pay nothing for the rest.