NewKimi K3.1 Pro is now availableTry it now
GuidePublished 7 min read

DeepSeek API Pricing: Live Rates, Caching Math, and Models

Live DeepSeek API pricing per 1M tokens for V4.1 Flash, V4 Pro, Cyber, and V3.2 on Inference.net, with prompt caching math and copy-paste code snippets.

Inference.net

Live DeepSeek API pricing on Inference.net

On Inference.net, DeepSeek API pricing starts at $0.08 per 1M input tokens, $0.635 per 1M output tokens, and $0.007 per 1M cached input reads for deepseek-v4.1-flash-1017 (1,040,000-token context window, vision and tool calling enabled). All standard DeepSeek routes expose OpenAI /v1/chat/completions, /v1/responses, and native Anthropic /v1/messages behind one API key with 0% markup pay-as-you-go billing.

Every model ID, context limit, and per-1M-token rate in the table below was verified directly from GET https://api.inference.net/v1/models on 2026-12-05:

Model IDContext windowMax outputInput ($/1M)Output ($/1M)Cached read ($/1M)Tools & modalitiesModel page
deepseek-v4.1-flash-10171,040,000393,216$0.08$0.635$0.007Tools, text + imageDeepSeek V4.1 Flash 1017
deepseek-v4.1-flash1,040,000393,216$0.103$0.60$0.007Tools, text + imageDeepSeek V4.1 Flash
deepseek-v4.1-flash-1017-cyber1,040,000393,216$0.30$1.00$0.007Tools, text + image (Privileged Access)DeepSeek V4.1 Flash 1017 Cyber
deepseek-v4-flash1,000,000384,000$0.23$0.62$0.0028Tools, textDeepSeek V4 Flash
deepseek-v4-flash-07311,048,5751,048,575$0.53$1.58$0.017Tools, textDeepSeek V4 Flash 0731
deepseek-v4-pro-08131,048,576131,072$1.32$3.96$0.044Tools, textDeepSeek V4 Pro 0813
deepseek-v4-pro1,048,576384,000$2.10$4.20$0.003625Tools, textDeepSeek V4 Pro
deepseek-v3.2163,84065,536$0.70$2.00$0.35Text only (supports_tools: false)DeepSeek V3.2

Note: You can fetch live pricing programmatically at any time without authentication using curl -s https://api.inference.net/v1/models (API prices are returned per token; multiply by 1,000,000 for per-1M-token rates). For a provider comparison against DeepSeek's direct first-party API, see Inference.net vs DeepSeek API.

Which DeepSeek model should you pick?

  • Default for coding agents, RAG, and general automation: deepseek-v4.1-flash-1017 ($0.08 / $0.635 / $0.007 cached). Lowest uncached input cost in the DeepSeek lineup, 1.04M context, image input, full reasoning effort control (none, low, high, max), default Zero Data Retention, and US-pinned routing via https://us.api.inference.net/v1.
  • General Flash alias when output volume dominates: deepseek-v4.1-flash ($0.103 / $0.60 / $0.007 cached) has slightly lower output pricing ($0.60 vs $0.635 per 1M). Note that standard deepseek-v4.1-flash routes via a third-party provider, so use deepseek-v4.1-flash-1017 when you need Inference.net's default ZDR and US-only host (us.api.inference.net).
  • Authorized AppSec, pentesting, and SOC triage: deepseek-v4.1-flash-1017-cyber ($0.30 / $1.00 / $0.007 cached). Abliterated for authorized security workflows to avoid false-positive refusals, hosted on US ZDR infrastructure, and gated by team-scoped Privileged Model Access.
  • Heavier reasoning on DeepSeek V4 Pro: deepseek-v4-pro-0813 ($1.32 / $3.96 / $0.044 cached) supports explicit low, high, and max reasoning efforts, while deepseek-v4-pro ($2.10 / $4.20 / $0.003625 cached) provides a larger 384K max output ceiling and ultra-low cached-read rates for long repeated contexts.
  • Legacy compatibility only: deepseek-v3.2 ($0.70 / $2.00) is priced higher than deepseek-v4.1-flash-1017, has a smaller 163K context window, and does not support tool calling (supports_tools: false). Migrate legacy V3.2 workloads to deepseek-v4.1-flash-1017.

Real workload cost calculations

Headline per-1M rates rarely tell the full story because prompt caching changes the input bill by an order of magnitude. Below are three concrete engineering workloads priced using the exact live rates above.

1. Coding-agent session with 90% prompt caching

A 30-turn coding session (Claude Code, OpenCode, or Cline) with 5,000,000 total prompt tokens (500K uncached + 4.5M cached reads) and 100K output tokens:

ModelUncached input (0.5M)Cached read (4.5M)Output (0.1M)Total session cost
deepseek-v4.1-flash-1017$0.0400$0.0315$0.0635$0.135
deepseek-v4.1-flash$0.0515$0.0315$0.0600$0.143
deepseek-v4-pro-0813$0.6600$0.1980$0.3960$1.254

Without prompt caching, those same 5M input tokens on deepseek-v4.1-flash-1017 would cost $0.40 instead of $0.0715, making the session 3.4x more expensive ($0.4635 vs $0.135).

2. Batch structured extraction (10,000 documents)

Extracting typed JSON from 10,000 documents where each request pairs a shared 1,500-token system prompt and JSON schema (15M cached reads across the run) with 2,500 fresh document tokens (25M uncached input) and 400 output tokens (4M output):

ModelUncached input (25M)Cached read (15M)Output (4M)Total for 10,000 docsCost per 1,000 docs
deepseek-v4.1-flash-1017$2.00$0.105$2.54$4.65 ($4.645)$0.46
deepseek-v4.1-flash$2.575$0.105$2.40$5.08$0.51
deepseek-v4-pro-0813$33.00$0.66$15.84$49.50$4.95

3. Authorized AppSec repository sweep (250K-token codebase, 20 checks)

Running 20 targeted security checks (authz, SSRF, SQLi, secrets, IAM) against one frozen 250,000-token service snapshot on deepseek-v4.1-flash-1017-cyber ($0.30 / $1.00 / $0.007 cached), with 2,000 fresh prompt tokens and 1,500 output tokens per check:

  • Cold pass (check 1): 252K uncached input tokens = $0.0756
  • Warm passes (checks 2-20): 4.75M cached tokens ($0.03325) + 38K fresh check tokens ($0.0114) = $0.04465
  • Output (all 20 checks): 30K output tokens = $0.0300
  • Total 20-check repository audit: $0.15 ($0.15025), compared to $1.54 without prefix caching (a 90.3% cost reduction).

Plug your own token counts and cache hit rates into the LLM Pricing Calculator or Prompt Cache Calculator.

How to maximize automatic prompt cache hits on DeepSeek

DeepSeek V4.1 Flash (deepseek-v4.1-flash-1017, deepseek-v4.1-flash, deepseek-v4.1-flash-1017-cyber) and DeepSeek V4 Pro (deepseek-v4-pro, deepseek-v4-pro-0813) routes on Inference.net use automatic (implicit) prefix caching:

  1. Omit prompt_cache_key on DeepSeek V4.1 Flash and V4 Pro routes. Prefix matching is automatic on byte-identical token prefixes across those models, so leave prompt_cache_key unset. Check each model's /models/* page for caching guidance on earlier DeepSeek snapshots.
  2. Keep everything before the split point byte-identical. Place your system instructions, tool schemas (with deterministic JSON key ordering), and static documents or repository files first. Never inject timestamps, UUIDs, or per-request counters into the system prompt.
  3. Append variable input at the end. Put the changing user message, diff, or document in the final message and verify usage.prompt_tokens_details.cached_tokens in every response.
  4. Control thinking mode when needed. deepseek-v4.1-flash-1017 thinks by default. If you need strict temperature: 0 determinism for classification or JSON extraction, pass reasoning_effort: "none" (see Reasoning docs).

Copy-paste API examples (cURL and Python)

Streaming cURL with usage and cached-token accounting

Create an API key on API keys (or register), then run:

bash
export INFERENCE_API_KEY="inf_sk_..."

curl -N https://us.api.inference.net/v1/chat/completions \
  -H "Authorization: Bearer $INFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash-1017",
    "stream": true,
    "stream_options": {"include_usage": true},
    "messages": [
      {
        "role": "system",
        "content": "You are a concise backend engineer. Answer with runnable code."
      },
      {
        "role": "user",
        "content": "Write a TypeScript exponential backoff helper with jitter."
      }
    ]
  }'

Python OpenAI SDK (measuring cached tokens and cost)

python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://us.api.inference.net/v1",
    api_key=os.environ["INFERENCE_API_KEY"],
)

MODEL = "deepseek-v4.1-flash-1017"
RATES_PER_1M = {"input": 0.08, "cached": 0.007, "output": 0.635}


def call_deepseek(static_context: str, task: str, deterministic: bool = False) -> None:
    kwargs: dict[str, object] = {}
    if deterministic:
        kwargs["reasoning_effort"] = "none"
        kwargs["temperature"] = 0

    stream = client.chat.completions.create(
        model=MODEL,
        stream=True,
        stream_options={"include_usage": True},
        messages=[
            {"role": "system", "content": "Extract concrete findings strictly from the provided context."},
            # Keep this prefix byte-identical across calls to hit $0.007/1M cached reads
            {"role": "user", "content": f"Reference context:\n{static_context}"},
            {"role": "user", "content": f"Task:\n{task}"},
        ],
        **kwargs,
    )

    for chunk in stream:
        if chunk.choices and chunk.choices[0].delta.content:
            print(chunk.choices[0].delta.content, end="", flush=True)
        if chunk.usage:
            prompt_tokens = chunk.usage.prompt_tokens
            cached_tokens = getattr(chunk.usage.prompt_tokens_details, "cached_tokens", 0) or 0
            uncached_tokens = max(0, prompt_tokens - cached_tokens)
            output_tokens = chunk.usage.completion_tokens
            cost_usd = (
                (uncached_tokens * RATES_PER_1M["input"])
                + (cached_tokens * RATES_PER_1M["cached"])
                + (output_tokens * RATES_PER_1M["output"])
            ) / 1_000_000
            print(
                f"\n[usage] uncached={uncached_tokens} cached={cached_tokens} "
                f"output={output_tokens} est_cost=${cost_usd:.6f}"
            )

Rate limits, privacy, and live benchmarks

  • Rate limits: New teams start with 500 RPM on the Free tier and 1,000 RPM on Paid tiers, with custom per-team overrides available for high-volume workloads. Request bodies and non-streaming responses cap at 32 MiB, so keep stream: true enabled on large outputs (see Rate limits).
  • Zero Data Retention and US residency: Direct Inference.net DeepSeek routes (deepseek-v4.1-flash-1017, deepseek-v4.1-flash-1017-cyber) run with Zero Data Retention enabled by default under SOC 2 Type II controls and support the US-only host https://us.api.inference.net/v1.
  • Live speed telemetry: Check rolling 15-minute TTFT and decode throughput across DeepSeek and peer open-weight models on Live Benchmarks.

Related reading & models

Back to all guides