DeepSeek API · independent guide

DeepSeek API pricing, V4 models, and setup

A practical, non-official guide to DeepSeek API pricing, cache-aware token costs, OpenAI and Anthropic compatibility, API key setup, and the V4 Flash versus Pro decision.

Current snapshot: Official docs list 1M context, V4 Flash and V4 Pro, separate cache-hit/cache-miss input rates, and no separately published “peak” multiplier. Prices can change; last checked July 26, 2026.

Keyword research: “deepseek api” US 14.8K volume, 62% KD, $3.02 CPC; “deepseek api pricing” US 2.9K volume, 38% KD, $3.44 CPC. These are supplied market snapshots, not official DeepSeek metrics. Google Trends pricing exact-term interest was approximately 0, so this page does not call it a stable upward trend.

DeepSeek API pricing

V4 Flash and V4 Pro rates per 1M tokens

Official rate card · 2026-07-26

DeepSeek bills input and output tokens separately. Cache hit is materially cheaper than cache miss; the calculator below lets you model the difference without making a live API request.

ModelCache-hit inputCache-miss inputOutputConcurrencyGood starting fit
deepseek-v4-flashDeepSeek-V4-Flash · 1M context · max 384K output$0.0028/M$0.14/M$0.28/M2,500High-throughput coding, routing, and everyday agent calls
deepseek-v4-proDeepSeek-V4-Pro · 1M context · max 384K output$0.003625/M$0.435/M$0.87/M500Harder reasoning, larger refactors, and quality-first tasks

Official Models & Pricing · The official page says product prices may vary. The current rate card does not list a separate peak-hour surcharge; peak demand can still affect latency, concurrency, or availability.

Token cost calculator

Estimate one request or a monthly workload

Input cache state
Estimated request cost$0.168
Input$0.140Output$0.028
Estimate only. Actual usage comes from the API response usage fields; this page does not call DeepSeek.

Compatible request formats

Copy a safe starter without exposing your key

curl https://api.deepseek.com/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEEPSEEK_API_KEY" \
  -d '{
    "model": "deepseek-v4-pro",
    "messages": [{"role":"user","content":"Review this function for edge cases."}],
    "thinking": {"type":"enabled"},
    "reasoning_effort": "high",
    "stream": false
  }'

No live API call is made. This guide only copies the example locally.

Official first API call · Anthropic compatibility guide

DeepSeek API key setup

Four steps before the first request

01

Create the key

Use the official DeepSeek platform to create an API key. Do not paste it into a browser tool, repository, issue, or client-side bundle.

Open the official platform
02

Store it server-side

Set DEEPSEEK_API_KEY in your local secret manager or deployment environment. Rotate it if it appears in logs or commits.

03

Pick the model

Use deepseek-v4-flash or deepseek-v4-pro. The old deepseek-chat and deepseek-reasoner aliases are listed for deprecation at the official cutover date.

04

Measure the response

Record model, input/output token usage, cache state, latency, HTTP status, and retries. Avoid logging prompts that contain secrets.

Operational notes

What the price table does not promise

Not a free API

“Is DeepSeek API free?” depends on credits, promotions, and account state. The API is metered; verify balance and current terms before production use.

Aliases can move

Pin a current model ID and read the changelog. Compatibility aliases may map to a mode today and be removed later.

Cache is workload-specific

Do not assume a cache hit. Estimate both hit and miss paths, then compare with returned usage and billing records.

FAQ

Questions to check before you ship a key

How much does the DeepSeek API cost?

The reviewed official rate card lists V4 Flash at $0.0028 per 1M cache-hit input tokens, $0.14 per 1M cache-miss input tokens, and $0.28 per 1M output tokens. V4 Pro lists $0.003625, $0.435, and $0.87 respectively. Prices may change, so check the official pricing page before budgeting.

Is the DeepSeek API free?

The API is metered. Credits, promotions, balance, and account terms can change; do not assume the API is permanently free. Use the official platform and pricing page for current account details.

What is the difference between deepseek-v4-flash and deepseek-v4-pro?

The official snapshot lists both with 1M context and up to 384K output. Flash has lower token rates and a higher listed concurrency limit; Pro costs more and is positioned for harder reasoning. Actual quality and latency depend on your task and route.

Can I use DeepSeek with the OpenAI or Anthropic SDK?

Yes. The official docs list https://api.deepseek.com for OpenAI-compatible requests and https://api.deepseek.com/anthropic for Anthropic-compatible requests. Configure the base URL and server-side key, then use a current DeepSeek model ID.

Are deepseek-chat and deepseek-reasoner still safe to use?

The current official quickstart lists those aliases for deprecation on July 24, 2026 at 15:59 UTC and maps them to V4 Flash modes. Pin deepseek-v4-flash or deepseek-v4-pro and check the changelog instead of building new integrations around old aliases.

Does the calculator make a live DeepSeek request?

No. It calculates input and output token costs locally from the reviewed official rate card. It does not accept or transmit API keys and cannot predict exact billing without the API response usage fields.