DeepSeek API pricing

deepseek-flash peak prices are $0.30 cache-miss input, $0.006 cache-hit input, and $1.20 output per million tokens. Off-peak is half. The full table is on the official pricing page.

Apps, API Integration & Economics

Access official portals, OpenAI SDK compatibility configurations with dynamic reasoning effort parameters, verified model identifiers, and interactive cost comparison models.

API Gateway & Standard Header

DeepSeek offers an OpenAI-compatible API gateway. Point your SDK to https://api.deepseek.com and pass your bearer token to immediately run V4.1-Flash with dynamic reasoning effort.

Base URL
https://api.deepseek.com
Header
Authorization: Bearer <KEY>
OpenAI SDK Compatibility Snippet with Dynamic Reasoning Effort
Standard OpenAI SDK drop-in configuration with baseURL, stream handling, and dynamic reasoning effort control.
import OpenAI from 'openai';

// Initialize OpenAI client pointing to DeepSeek API
const openai = new OpenAI({
  baseURL: 'https://api.deepseek.com',
  apiKey: process.env.DEEPSEEK_API_KEY || '<YOUR_KEY>',
});

async function main() {
  const stream = await openai.chat.completions.create({
    model: 'deepseek-flash',
    messages: [
      { role: 'system', content: 'You are an expert systems engineer.' },
      { role: 'user', content: 'Design a lock-free queue with zero-copy buffer in C++20.' },
    ],
    stream: true,
    reasoning_effort: 'high',
    extra_body: {
      thinking: { type: 'enabled' },
    },
  });

  for await (const chunk of stream) {
    const delta = chunk.choices[0]?.delta as any;
    // Inspect dynamic reasoning thoughts if available
    if (delta?.reasoning_content) {
      process.stdout.write(delta.reasoning_content);
    } else if (delta?.content) {
      process.stdout.write(delta.content);
    }
  }
}

main();

Interactive Pricing Calculator & Cache-Hit Economics

Peak list prices from the DeepSeek API docs. Competitor prices were removed because they were not sourced.

Flash peak $14.51 · Pro peak $51.37
Input Tokens / Month50M
Represents codebase & prompt context
Prefix Cache Hit Rate85%
Cache-hit rate is an input you choose, not a published average
Output Tokens / Month10M
Generated code, responses & thoughts
Provider & ModelCache Miss / 1MCache Hit / 1MOutput / 1MEst. Monthly Cost
DeepSeek-V4.1-Flash (peak)DeepSeek$0.30$0.006$1.20$14.51 USD
DeepSeek-V4-Pro-0813 (peak)DeepSeek$1.32$0.044$3.96$51.37 USD

Model Identifiers for Production API Calls

deepseek-flash
DeepSeek-V4.1-Flash (`deepseek-flash`)

Current flash API model. Legacy names deepseek-v4-flash and deepseek-v4-flash-vision-exp are still accepted and are served by V4.1-Flash at the flash price. 1M context, vision supported.

Target Use Cases:
General API callsTool callsVision inputs1M context
deepseek-v4-pro
DeepSeek-V4-Pro-0813 (`deepseek-v4-pro`)

API checkpoint DeepSeek-V4-Pro-0813. 1M context, max output 384K, vision not supported. Weights card: 1.6T total, 49B activated.

Target Use Cases:
Text and tool callsLong contextOff-peak batch jobs

HTTP REST API Endpoints

POST/v1/chat/completions
deepseek-flashdeepseek-v4-pro
Chat Completions & Dynamic Reasoning

OpenAI-compatible chat completions. Current model names on the pricing page are deepseek-flash and deepseek-v4-pro. Thinking mode uses thinking.type plus reasoning_effort (low, high, or max). The old extra_body.effort field is not the documented control.

GET/v1/models
All
List Models & Lineage Checkpoints

Lists active foundation models, reasoning checkpoints, and multimodal endpoints with context window permissions.

GET/v1/user/balance
All
Account Quota & Token Balance

Returns real-time account balances in USD and CNY, cached prefix savings metrics, and monthly grant status.