Unofficial guide. Not affiliated with Meta.

Last updated:

DeepSeek V4.1 Flash API: pricing, peak hours and code

The DeepSeek API serves V4.1 Flash as deepseek-flash, in both OpenAI and Anthropic formats. The price depends on when you call it: weekday peak windows cost twice the off-peak rate. This page shows the full price table, the peak hours in several time zones, what typical workloads cost, and working code.

Short version: Off-peak: $0.15 input, $0.60 output and $0.003 cached input per 1M tokens. Peak (Mon–Fri 01:00–04:00 and 06:00–10:00 UTC): double. Use base URL https://api.deepseek.com with any OpenAI SDK, or https://api.deepseek.com/anthropic for Anthropic SDKs and Claude Code. Batch jobs scheduled outside the peak windows pay half.

Official price per 1M tokens

Off-peak (USD)Peak (USD)Off-peak (CNY)Peak (CNY)
Input, cache hit$0.003$0.006¥0.02¥0.04
Input, cache miss$0.15$0.30¥1¥2
Output$0.60$1.20¥4¥8

Fees come out of your topped-up or granted balance (granted balance first). DeepSeek says prices may change.

Source: DeepSeek Models & Pricing

Peak hours in your time zone

Time zonePeak window 1Peak window 2
UTC01:00–04:0006:00–10:00
Beijing (UTC+8)09:00–12:0014:00–18:00
Tokyo / Seoul (UTC+9)10:00–13:0015:00–19:00
Berlin / Paris (CEST, UTC+2)03:00–06:00 *08:00–12:00 *
US Pacific (PDT, UTC-7)18:00–21:00 *23:00–03:00 *

* Summer time. After clocks change (Europe on October 25, the US on November 1, 2026) these windows start one hour earlier. Peak days are Monday to Friday in UTC, and Chinese public holidays are off-peak all day.

Source: DeepSeek Models & Pricing

What typical workloads cost

Two example workloads, priced at list rates with cache-write fees ignored. A: 1,000 calls of 20K input tokens (half cached) and 2K output. B: 100 long-context calls of 200K input tokens (90% cached) and 4K output.

ModelWorkload AWorkload B
DeepSeek V4.1 Flash, off-peak$2.73$0.59
DeepSeek V4.1 Flash, peak$5.46$1.19
Claude Haiku 5.5$2.10$2.90 (long-prompt rate)
Gemini 3.8 Flash (launch price)$15.75$4.35

Haiku 5.5 is cheaper for short prompts ($0.10 / $0.50 up to 100K tokens) but moves to $0.50 / $2.50 above that; DeepSeek has one rate for the whole 1M context and much cheaper cache hits. Token counts differ between tokenizers, so test on your own prompts.

Full comparison with Gemini 3.8 Flash and Haiku 5.5

Source: DeepSeek Models & Pricing

Source: Anthropic pricing doc

Source: Gemini API pricing

First call with curl

  1. Create an API key on the DeepSeek Platform and top up your balance.
  2. Save the key as DEEPSEEK_API_KEY.
  3. POST to https://api.deepseek.com/chat/completions with model deepseek-flash.
curl https://api.deepseek.com/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${DEEPSEEK_API_KEY}" \
  -d '{
        "model": "deepseek-flash",
        "messages": [
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "Hello!"}
        ],
        "thinking": {"type": "enabled"},
        "reasoning_effort": "high",
        "stream": false
      }'

Source: DeepSeek API docs: first call

Python (OpenAI SDK) and thinking mode

Thinking is on by default at high effort. reasoning_effort accepts low, high and max; in the OpenAI SDK the thinking switch goes inside extra_body. Turn thinking off for quick classification or extraction calls to save output tokens.

# pip install openai
import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["DEEPSEEK_API_KEY"], base_url="https://api.deepseek.com")

response = client.chat.completions.create(
    model="deepseek-flash",
    messages=[{"role": "user", "content": "Explain this stack trace in two sentences: ..."}],
    reasoning_effort="high",                      # low / high / max
    extra_body={"thinking": {"type": "enabled"}},  # "disabled" for fast, non-thinking replies
)
print(response.choices[0].message.content)

Source: DeepSeek thinking mode guide

Anthropic SDK

The same model is available in Anthropic’s Messages format at https://api.deepseek.com/anthropic. Model names that start with claude are remapped: claude-opus names go to deepseek-v4-pro, other claude names go to deepseek-flash; any other unknown name returns an error.

# pip install anthropic
# export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
# export ANTHROPIC_API_KEY=<your DeepSeek API key>
import anthropic

client = anthropic.Anthropic()
message = client.messages.create(
    model="deepseek-flash",
    max_tokens=1000,
    messages=[{"role": "user", "content": "Hi, how are you?"}],
)
print(message.content)

Source: DeepSeek Anthropic API guide

Use DeepSeek V4.1 Flash in Claude Code

DeepSeek publishes these environment variables for Claude Code (macOS and Linux; on Windows set the same names with $env: in PowerShell). Then run claude in your project folder.

export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API key>
export ANTHROPIC_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-flash
export CLAUDE_CODE_EFFORT_LEVEL=max
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=786432

cd /path/to/your-project
claude

Source: DeepSeek guide: Claude Code

Source: DeepSeek Models & Pricing

FAQ

What is the DeepSeek V4.1 Flash API model name?

deepseek-flash. The legacy names deepseek-v4-flash and deepseek-v4-flash-vision-exp still work and are billed at the same price.

How much is the DeepSeek V4.1 Flash API?

$0.15 / $0.60 per 1M input/output tokens off-peak, $0.30 / $1.20 at peak, and $0.003 / $0.006 for cache hits.

When is the DeepSeek API cheaper?

Outside 01:00–04:00 and 06:00–10:00 UTC on weekdays, all weekend and on Chinese public holidays. Those off-peak hours cost half the peak price.

Does DeepSeek V4.1 Flash work with the OpenAI SDK?

Yes. Set base_url to https://api.deepseek.com and model to deepseek-flash. Pass thinking settings through extra_body.

Can I use DeepSeek V4.1 Flash in Claude Code?

Yes. Set ANTHROPIC_BASE_URL to https://api.deepseek.com/anthropic, put your DeepSeek key in ANTHROPIC_AUTH_TOKEN and set the model variables to deepseek-flash, as DeepSeek’s guide lists.

What is the rate limit?

DeepSeek lists a concurrency limit of 2,500 requests for deepseek-flash.

Independent guide, not affiliated with DeepSeek, Google or Anthropic. Prices and model versions change often; check the linked official pages before you build on them.