DeepSeek API
DeepSeek bills its API per 1M tokens, with a peak and an off-peak price. DeepSeek V4.1 Flash 1017 is $0.15 input and $0.60 output per 1M tokens off-peak, $0.30 and $1.20 at peak. DeepSeek V4 Pro 0813 is $0.66 input and $1.98 output off-peak, $1.32 and $3.96 at peak. From DeepSeek's pricing page, checked 25 November 2026. [1]
Updated
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.straitly.ai/v1",
api_key=os.environ["STRAITLY_API_KEY"],
)
reply = client.chat.completions.create(
model="deepseek/deepseek-v4-1-flash-1017",
messages=[{"role": "user",
"content": "Hello"}],
)What does the DeepSeek API cost?
DeepSeek's own prices per 1M tokens: off-peak, and peak, which is twice off-peak [1].
USD per 1M tokens, input / output
| Model | DeepSeek off-peak | DeepSeek peak |
|---|---|---|
DeepSeek V4.1 Flash 1017· deepseek/deepseek-v4-1-flash-1017 | $0.15 / $0.60 | $0.30 / $1.20 |
DeepSeek V4 Pro 0813· deepseek/deepseek-v4-pro-0813 | $0.66 / $1.98 | $1.32 / $3.96 |
Newest first: the models DeepSeek sells on its own API. Prices are its cache miss input and its output, from DeepSeek's pricing page, checked 25 November 2026; “Off-peak rates are half of the peak rates.” [1]. DeepSeek lists a 1M context length and a 384K max output for its API models [1]. Each model's rate on Straitly is on its own page.
Cache hit prices
Cache hit (cache read), USD per 1M tokens
| Model | DeepSeek cache hit off-peak | DeepSeek cache hit peak |
|---|---|---|
| DeepSeek V4.1 Flash 1017 | $0.003 | $0.006 |
| DeepSeek V4 Pro 0813 | $0.022 | $0.044 |
DeepSeek bills input it already holds in its cache at the cache hit price, from its pricing page, checked 25 November 2026 [1].
When are DeepSeek peak hours?
“Peak hours are 01:00 - 04:00 and 06:00 - 10:00 UTC, Monday through Friday, excluding Chinese public holidays.” “All other hours are off-peak, including weekends and Chinese public holidays in full.” [1]
| Window | Hours (UTC) | Days | Price |
|---|---|---|---|
| Peak | 01:00 to 04:00 and 06:00 to 10:00 | Monday to Friday, except Chinese public holidays | DeepSeek's peak price |
| Off-peak | All other hours | Every day; weekends and Chinese public holidays in full | Half the peak price |
| Straitly | Every hour | Every day | One rate per model |
How do I get a DeepSeek API key?
Four steps, from DeepSeek's own docs [1-3]. Or use one Straitly key for DeepSeek and all 117 models [8][10].
Sign in to the DeepSeek Platform
Create a key
Top up a balance
Fees are deducted from a topped-up or granted balance [1].
Set DEEPSEEK_API_KEY
Base URL https://api.deepseek.com, model deepseek-flash (DeepSeek-V4.1-Flash-1017) or deepseek-v4-pro (DeepSeek-V4-Pro-0813) [1][2].
On Straitly: sign up, create a key, then set the base URL to https://api.straitly.ai/v1 and the model to deepseek/deepseek-v4-1-flash-1017, as in the sample at the top. The quickstart has the steps [10].
What happened to DeepSeek V4 Flash 0731?
DeepSeek released V4 Flash 0731 on 31 July 2026 and has since retired V4 Flash [5]. New code calls deepseek-flash [1][2], and the old names still work: “The legacy names deepseek-v4-flash and deepseek-v4-flash-vision-exp are still accepted, but the corresponding models have been retired, their requests are served by the DeepSeek-V4.1-Flash-1017 model and billed at the Flash price.” [1]
| Old API name | Served by | Billed at | On Straitly |
|---|---|---|---|
deepseek-v4-flash | DeepSeek-V4.1-Flash-1017 | Flash price | deepseek/deepseek-v4-1-flash-1017 |
deepseek-v4-flash-vision-exp | DeepSeek-V4.1-Flash-1017 | Flash price | deepseek/deepseek-v4-1-flash-1017 |
What else do people ask about the DeepSeek API?
Ask a question- DeepSeek V4.1 Flash 1017 lists at $0.15 input and $0.60 output per 1M tokens off-peak, and $0.30 and $1.20 at peak. DeepSeek V4 Pro 0813 lists at $0.66 input and $1.98 output per 1M tokens off-peak, and $1.32 and $3.96 at peak. Those are DeepSeek's prices, matched on its pricing page on 25 November 2026. On Straitly you pay one rate per model at every hour; each model's rate is on its own page. [1][8]
- No. Zero data retention is on by default for every Straitly account and key: prompts and completions are never written to disk or logs and never used for training. Only billing metadata is kept: timestamp, model, key, token counts, latency, status and the amount charged [11].
Sources
Last updated: . DeepSeek changes prices and model versions often. If something here is out of date, tell us at straitly.ai/contact. Other price lists: the LLM API price index, Qwen API and Kimi API.
- [1]DeepSeek API docs: Models & Pricing
- [2]DeepSeek API docs: Your First API Call
- [3]DeepSeek Platform: API keys
- [4]DeepSeek API docs: Integrate with Claude Code
- [5]DeepSeek API docs: Change Log
- [6]Claude Code docs: LLM gateways
- [7]Straitly model catalog
- [8]Straitly models
- [9]Straitly pricing
- [10]Straitly docs: quickstart
- [11]Straitly data retention
What each source says
- DeepSeek API docs: Models & Pricing
- DeepSeek's per-model prices per 1M tokens (cache hit, cache miss and output, off-peak and peak), peak hours, base URLs, context and output limits, and the retired V4 Flash names.
- DeepSeek API docs: Your First API Call
- The DeepSeek API uses an OpenAI and Anthropic compatible format; the base URLs, model names and the DEEPSEEK_API_KEY variable.
- DeepSeek Platform: API keys
- Where DeepSeek's first-call guide sends you to apply for an API key.
- DeepSeek API docs: Integrate with Claude Code
- DeepSeek's own steps for running Claude Code on its Anthropic-format endpoint with ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.
- DeepSeek API docs: Change Log
- The 31 July 2026 entry releases DeepSeek-V4-Flash-0731 on the API. The 10 September 2026 entry retires V4 Flash and names deepseek-flash for V4.1 Flash.
- Claude Code docs: LLM gateways
- Anthropic does not support routing Claude Code to non-Claude models through any gateway.
- Straitly model catalog
- Every model Straitly serves, with its maker's own price. The model names and release days on this page are the catalog's on 25 November 2026.
- Straitly models
- All 117 models on one Straitly key, with ids, context windows and each model's current rate.
- Straitly pricing
- Billed per token from prepaid credits. Nothing is added on top. A failed request costs nothing. No subscription and no minimum.
- Straitly docs: quickstart
- Create a Straitly key and make a first call with the OpenAI or Anthropic SDK.
- Straitly data retention
- Zero data retention on by default for every account and key; prompts and completions never written to disk or logs and never used for training; only billing metadata is kept.
Start with one request.
Prepaid, per token, no subscription and no minimum.