---
title: "DeepSeek API Pricing: Live Rates, Caching Math, and Models | Inference.net"
description: "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."
url: "https://inference.net/guides/deepseek-api-pricing/"
---

Guide Published December 05, 2026 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**](https://inference.net/company/)

## Run DeepSeek V4.1 Flash at $0.08/1M

Call deepseek-v4.1-flash-1017 with 1M context, $0.007/1M automatic cached input reads, 500 RPM Free-tier headroom, and default Zero Data Retention.

## 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 ID | Context window | Max output | Input ($/1M) | Output ($/1M) | Cached read ($/1M) | Tools & modalities | Model page |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `deepseek-v4.1-flash-1017` | 1,040,000 | 393,216 | `$0.08` | `$0.635` | `$0.007` | Tools, text + image | [DeepSeek V4.1 Flash 1017](https://inference.net/models/deepseek-v4-1-flash-1017/) |
| `deepseek-v4.1-flash` | 1,040,000 | 393,216 | `$0.103` | `$0.60` | `$0.007` | Tools, text + image | [DeepSeek V4.1 Flash](https://inference.net/models/deepseek-v4-1-flash/) |
| `deepseek-v4.1-flash-1017-cyber` | 1,040,000 | 393,216 | `$0.30` | `$1.00` | `$0.007` | Tools, text + image (Privileged Access) | [DeepSeek V4.1 Flash 1017 Cyber](https://inference.net/models/deepseek-v4-1-flash-1017-cyber/) |
| `deepseek-v4-flash` | 1,000,000 | 384,000 | `$0.23` | `$0.62` | `$0.0028` | Tools, text | [DeepSeek V4 Flash](https://inference.net/models/deepseek-v4-flash/) |
| `deepseek-v4-flash-0731` | 1,048,575 | 1,048,575 | `$0.53` | `$1.58` | `$0.017` | Tools, text | [DeepSeek V4 Flash 0731](https://inference.net/models/deepseek-v4-flash-0731/) |
| `deepseek-v4-pro-0813` | 1,048,576 | 131,072 | `$1.32` | `$3.96` | `$0.044` | Tools, text | [DeepSeek V4 Pro 0813](https://inference.net/models/deepseek-v4-pro-0813/) |
| `deepseek-v4-pro` | 1,048,576 | 384,000 | `$2.10` | `$4.20` | `$0.003625` | Tools, text | [DeepSeek V4 Pro](https://inference.net/models/deepseek-v4-pro/) |
| `deepseek-v3.2` | 163,840 | 65,536 | `$0.70` | `$2.00` | `$0.35` | Text only (`supports_tools: false`) | [DeepSeek V3.2](https://inference.net/models/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](https://inference.net/compare/inference-net-vs-deepseek-api/)._

## Which DeepSeek model should you pick?

- **Default for coding agents, RAG, and general automation:** [`deepseek-v4.1-flash-1017`](https://inference.net/models/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](https://inference.net/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`](https://inference.net/models/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`](https://inference.net/models/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](https://inference.net/privileged-access/).
- **Heavier reasoning on DeepSeek V4 Pro:** [`deepseek-v4-pro-0813`](https://inference.net/models/deepseek-v4-pro-0813/) (`$1.32` / `$3.96` / `$0.044` cached) supports explicit `low`, `high`, and `max` reasoning efforts, while [`deepseek-v4-pro`](https://inference.net/models/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`](https://inference.net/models/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:

| Model | Uncached 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):

| Model | Uncached input (25M) | Cached read (15M) | Output (4M) | Total for 10,000 docs | Cost 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](https://inference.net/tools/llm-pricing-calculator/) or [Prompt Cache Calculator](https://inference.net/tools/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](https://inference.net/docs/api/reasoning/)).

## Copy-paste API examples (cURL and Python)

### Streaming cURL with usage and cached-token accounting

Create an API key on [API keys](https://inference.net/dashboard/api-keys/) (or [register](https://inference.net/register/)), then run:

bash

```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

```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](https://inference.net/docs/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](https://inference.net/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](https://inference.net/benchmarks/).

## Related DeepSeek models and guides

- **Live DeepSeek model specs:** [DeepSeek V4.1 Flash 1017](https://inference.net/models/deepseek-v4-1-flash-1017/) · [DeepSeek V4.1 Flash](https://inference.net/models/deepseek-v4-1-flash/) · [DeepSeek V4.1 Flash 1017 Cyber](https://inference.net/models/deepseek-v4-1-flash-1017-cyber/) · [DeepSeek V4 Flash](https://inference.net/models/deepseek-v4-flash/) · [DeepSeek V4 Flash 0731](https://inference.net/models/deepseek-v4-flash-0731/) · [DeepSeek V4 Pro](https://inference.net/models/deepseek-v4-pro/) · [DeepSeek V4 Pro 0813](https://inference.net/models/deepseek-v4-pro-0813/) · [DeepSeek V3.2](https://inference.net/models/deepseek-v3-2/)
- **Comparisons & calculators:** [Inference.net vs DeepSeek API](https://inference.net/compare/inference-net-vs-deepseek-api/) · [DeepSeek V4.1 Flash vs GLM-5.3 Flash](https://inference.net/compare/deepseek-v4-1-flash-vs-glm-5-3-flash/) · [LLM Pricing Calculator](https://inference.net/tools/llm-pricing-calculator/) · [Prompt Cache Calculator](https://inference.net/tools/prompt-cache-calculator/)
- **Workflow guides:** [Claude Code Alternatives](https://inference.net/guides/claude-code-alternatives/) · [OpenRouter Alternatives](https://inference.net/guides/openrouter-alternatives/) · [DeepSeek V4.1 Flash Cyber API Guide](https://inference.net/guides/deepseek-v4-1-flash-cyber-api-guide/)

### Start calling DeepSeek V4.1 Flash with $0.007/1M cached reads

Create a free Inference.net API key to access DeepSeek V4.1 Flash 1017, V4 Pro, and Cyber over OpenAI and Anthropic endpoints with default Zero Data Retention.

[Create API key](https://inference.net/register/)

Estimate Your Inference Bill

## Calculate your monthly LLM API & prompt-cache spend

Compare live input, cached-read, and output token pricing across every open-weight and frontier model on Inference.net with 0% markup.

[Open pricing calculator](https://inference.net/tools/llm-pricing-calculator/) [Explore model catalog](https://inference.net/models/)

## Related reading & models

[Back to all guides](https://inference.net/guides/)

[Article February 21, 2026 **LLM API Pricing Comparison 2026: Live Rates** Compare 2026 LLM API pricing across DeepSeek V4.1 Flash ($0.103/$0.60), Kimi K3.1 Pro, GLM-5.3, GPT, and Claude, plus $0.007/1M prompt cache savings. Read more](https://inference.net/content/llm-api-pricing-comparison/) [Guide December 04, 2026 **DeepSeek V4.1 Flash Cyber API Guide: AppSec & Security Agents** Use the DeepSeek V4.1 Flash 1017 abliterated API (deepseek cyber) for authorized AppSec, pentesting, and security agents with 1M context, ZDR, and caching. Read more](https://inference.net/guides/deepseek-v4-1-flash-cyber-api-guide/) [Blog December 04, 2026 **Benchmarking DeepSeek V4.1 Flash & Kimi K3: Live Speed & Open Harness** Live 15-minute production speed, TTFT, and pricing for DeepSeek V4.1 Flash and Kimi K3 on Inference.net, plus a zero-dependency Python benchmark script. Read more](https://inference.net/blog/benchmarking-deepseek-v4-1-flash-kimi-k3-serverless-inference/) [Blog October 23, 2026 **MiniMax M3.1 Flash is live on Inference: Day 0** Run MiniMax M3.1 Flash on Inference.net on Day 0 — a 428B MoE model for coding and agents on our serverless API at $0.10 / $0.50 per million tokens. Read more](https://inference.net/blog/minimax-m3-1-flash-day-0/)

[**Explore serverless models** Compare open-weight and frontier models, context windows, and per-token pricing.](https://inference.net/models/) [**Inference Pass plans** Predictable monthly access for coding agents and high-volume OpenAI-compatible API workloads.](https://inference.net/subscription/)
