DeepSeek API pricing
What does the DeepSeek API cost?
DeepSeek API tokens cost between $0.003 and $3.96 per 1 million tokens depending on whether you pick the flash or pro model, whether your prompt hits the cache, and the time of day your request lands. Input cache hits on deepseek-flash cost $0.003 per million tokens off-peak, while peak output on deepseek-v4-pro runs up to $3.96 per million tokens.
You pay for what you process out of a prepaid balance rather than paying a monthly subscription or receiving an invoice at the end of the month. Both available models give you a 1M token context length and a maximum output of 384K tokens, but your actual invoices depend heavily on prompt caching efficiency and off-peak execution windows.
Token pricing across deepseek-flash and deepseek-v4-pro
DeepSeek API model prices are listed in units of per 1 million (1M) tokens. In their system, a token is the smallest unit of text recognized by the model and can be a word, a number, or a punctuation mark. DeepSeek bills model usage based on the total number of input and output tokens processed by the model, separating prompt inputs into cache hits and cache misses.
The API offers two production models in its pricing table: deepseek-flash and deepseek-v4-pro. The flash model serves as the fast, low-cost option, while the pro model handles heavier workloads at a higher token rate.
Here is how the rates break down across both models for cache hits, cache misses, and generation:
| Metric | deepseek-flash (Off-peak) | deepseek-flash (Peak) | deepseek-v4-pro (Off-peak) | deepseek-v4-pro (Peak) |
|---|---|---|---|---|
| 1M Input Tokens (Cache Hit) | $0.003 | $0.006 | $0.022 | $0.044 |
| 1M Input Tokens (Cache Miss) | $0.15 | $0.3 | $0.66 | $1.32 |
| 1M Output Tokens | $0.6 | $1.2 | $1.98 | $3.96 |
| Concurrency Limit | 2500 | 2500 | 500 | 500 |
Input cache hits give you a massive price drop on both tiers. On deepseek-flash, a cache hit during off-peak hours drops your input cost from $0.15 down to $0.003 per million tokens. Output tokens are consistently the most expensive part of your request, costing $1.20 per million on flash during peak hours and reaching $3.96 per million on pro.
You should always pass deepseek-flash as your model parameter in your application code. The docs note that legacy names deepseek-v4-flash and deepseek-v4-flash-vision-exp are still accepted for backwards compatibility, but those models are retired and incoming calls route automatically to DeepSeek-V4.1-Flash-1017 at regular flash prices.
How off-peak discounts and schedules work
DeepSeek off-peak rates are exactly 50% (half) of the peak rates across all token categories. If you run batch jobs, backfills, or asynchronous processing, targeting the off-peak window cuts your bill directly in half.
Peak hours run in two separate blocks Monday through Friday:
- 01:00 to 04:00 UTC
- 06:00 to 10:00 UTC
All hours outside of those two windows are billed at off-peak rates. That means any request landing between 04:00 and 06:00 UTC, between 10:00 and 01:00 UTC, or at any time during full weekends gets the 50% discount automatically. Chinese public holidays are also treated as full off-peak days, so weekday peak hours don't apply when those holidays occur.
Can you schedule heavy background worker queues around those UTC hours? If your architecture allows queuing tasks until off-peak hours begin, your input cache misses on deepseek-flash drop from $0.30 to $0.15 per million tokens, and your output drops from $1.20 to $0.60 per million tokens without changing any code.
Model specs, endpoints, and feature support
The underlying model version behind deepseek-flash is DeepSeek-V4.1-Flash-1017, and the underlying version behind deepseek-v4-pro is DeepSeek-V4-Pro-0813. Both models give you a 1M token context length and a maximum output ceiling of 384K tokens per response.
Both models support non-thinking and thinking modes, with thinking mode set as the default configuration. When you integrate with the API, DeepSeek provides two format-compatible base URLs depending on which client SDK you prefer:
- OpenAI format:
https://api.deepseek.com - Anthropic format:
https://api.deepseek.com/anthropic
Both deepseek-flash and deepseek-v4-pro support JSON Output, Tool Calls, Responses API, Anthropic API, and Chat Prefix Completion (Beta). However, there are two distinct feature splits between the two models that affect how you architect your pipeline:
- Vision is supported on deepseek-flash, but vision is not supported on deepseek-v4-pro.
- FIM Completion (Beta) is supported in non-thinking mode only on both deepseek-flash and deepseek-v4-pro.
Concurrency is also tied to the model you pick. DeepSeek sets a concurrency limit of 2500 parallel requests on deepseek-flash, while deepseek-v4-pro is capped at 500 concurrent requests.
Standalone Search and Fetch APIs
DeepSeek also provides standalone utility endpoints designed to feed external information into your workflows. Search and Fetch are standalone APIs billed per request rather than by processed tokens.
Pricing for both endpoints is uniform:
- DeepSeek Search API: $0.75 per 1,000 successful requests
- DeepSeek Fetch API: $0.75 per 1,000 successful requests
You aren't charged for failed calls; billing applies strictly to successful completions. If you make 10,000 successful search lookups to gather source material before sending a summary request to deepseek-flash, you will incur $7.50 from the Search API on top of your model token usage.
Balance deductions and a worked expense example
For model usage, the expense is calculated as the number of tokens multiplied by the price. DeepSeek requires you to top up your account balance before making calls, and usage fees are deducted directly from your topped-up balance or granted balance. When both balances are available in your account, the system uses your granted balance first until it runs out, then draws against your paid balance.
To see how this works in practice, suppose your application runs a batch of documents through deepseek-flash during off-peak hours:
- 10 million input tokens total (8 million hit the cache, 2 million are cache misses)
- 1 million output tokens generated
The math follows the official formula:
- Cache hit input: 8M tokens * $0.003 per 1M = $0.024
- Cache miss input: 2M tokens * $0.15 per 1M = $0.30
- Output tokens: 1M tokens * $0.60 per 1M = $0.60
- Total expense: $0.024 + $0.30 + $0.60 = $0.924
If that identical run occurs during peak hours on a Tuesday at 02:00 UTC, every rate doubles:
- Cache hit input: 8M tokens * $0.006 per 1M = $0.048
- Cache miss input: 2M tokens * $0.30 per 1M = $0.60
- Output tokens: 1M tokens * $1.20 per 1M = $1.20
- Total expense: $0.048 + $0.60 + $1.20 = $1.848
DeepSeek reserves the right to adjust product prices and recommends topping up based on actual usage rather than keeping large idle reserves. If you also use providers like OpenAI or Moonshot AI in your stack, you can compare how their rates scale in our guides on what the OpenAI API costs per million tokens and what the Kimi (Moonshot AI) API costs.
Tracking your DeepSeek balance with Costbrake
Because DeepSeek requires a prepaid balance, tracking spend means monitoring how quickly that balance drops over time. Costbrake watches what you spend across 23 cloud, AI, and SaaS providers (including AWS, OpenAI, Anthropic, and DeepSeek) and alerts you on spending spikes, budget thresholds, and month-end forecasts.
For DeepSeek specifically, Costbrake reads your account balance and counts drops as spend. DeepSeek only reports the total account balance, so spend is calculated as the drop in balance between checks, spread evenly over those hours. You can inspect your current balance right from your terminal:
curl -fsS https://api.deepseek.com/user/balance -H "Authorization: Bearer $DEEPSEEK_API_KEY"DeepSeek has no read-only keys and no per-key spending limits, which means any working key can call models and there is no killswitch. If a key leaks, you have to delete it manually on platform.deepseek.com. Every key in your account shares the exact same balance, so one key covers all your calls, though only USD balances are tracked right now (CNY is not supported yet).
You can connect your key in a couple minutes by telling your AI coding assistant to handle the agent setup, or add it manually in the dashboard. If you want a deeper walkthrough on catching sudden drops before your workers halt, see our guide on how to track DeepSeek API spend and get warned before the balance runs out.
Questions and answers
Is the DeepSeek API free?
No, the DeepSeek API is not free. You must top up your balance or have a granted promotional balance in your account before making API calls, and model requests are deducted based on total tokens processed.
How much does DeepSeek cost per million tokens?
On the deepseek-flash model, input cache hits cost between $0.003 and $0.006 per 1M tokens, cache misses cost between $0.15 and $0.30, and output costs between $0.60 and $1.20. On deepseek-v4-pro, input cache hits run from $0.022 to $0.044 per 1M tokens, cache misses cost between $0.66 and $1.32, and output costs between $1.98 and $3.96.
Does DeepSeek have off-peak pricing?
Yes, DeepSeek offers off-peak pricing that cuts peak rates by 50%. Off-peak rates apply outside of 01:00 - 04:00 UTC and 06:00 - 10:00 UTC on weekdays, as well as all day on weekends and Chinese public holidays.
What is the context length and output limit for DeepSeek models?
Both deepseek-flash and deepseek-v4-pro feature a 1M token context length and allow a maximum output length of up to 384K tokens per request.
How are the Search and Fetch APIs billed?
Search and Fetch are standalone APIs billed per request rather than per token. Both the Search API and the Fetch API cost $0.75 per 1,000 successful requests.
Sources
Updated