# DeepSeek V4 API Pricing: V4 Pro and V4.1 Flash

> DeepSeek V4 API pricing checked Dec 5, 2026: V4 Pro and V4.1 Flash peak and off-peak rates, cache costs, how to get an API key, plus curl and Python code.

Source: https://goiapi.com/en/blog/deepseek-v4-api-pricing
Updated: 2026-12-05

Author: GoiAPI, December 5, 2026

DeepSeek V4 API pricing depends on the model and the time of day. On DeepSeek's own platform, [DeepSeek V4 Pro](https://goiapi.com/en/models/deepseek-v4-pro-0813) costs $0.66 per million input tokens (cache miss) and $1.98 per million output tokens off-peak, and [DeepSeek V4.1 Flash](https://goiapi.com/en/models/deepseek-v4.1-flash) costs $0.15 input and $0.60 output; during peak hours (01:00–04:00 and 06:00–10:00 UTC, Monday to Friday) every rate doubles. These are DeepSeek's list prices, checked on December 5, 2026.

This guide has the full rate card with cache-hit prices, peak hours converted to common time zones, the V4 Flash vs V4.1 Flash name change that still trips up old code, how to get a DeepSeek API key, and working curl, Python and Claude Code examples. Many pricing articles still quote the April 2026 launch prices, which no longer apply.

Disclosure: GoiAPI sells API access to the DeepSeek, Claude, GPT and GLM models mentioned in this article.

## DeepSeek V4 API pricing at a glance (December 2026)

Source: [DeepSeek Models & Pricing](https://api-docs.deepseek.com/quick_start/pricing), checked on December 5, 2026. USD per 1 million tokens.

| Token type | V4.1 Flash off-peak | V4.1 Flash peak | V4 Pro off-peak | V4 Pro peak |
|---|---|---|---|---|
| Input, cache hit | $0.003 | $0.006 | $0.022 | $0.044 |
| Input, cache miss | $0.15 | $0.30 | $0.66 | $1.32 |
| Output | $0.60 | $1.20 | $1.98 | $3.96 |

Three things decide what you actually pay:

- **Cache hit vs cache miss.** A cache hit is the part of your prompt that DeepSeek already has cached from an earlier request with the same beginning (a long system prompt, a fixed document). It is billed at a small fraction of the cache-miss rate. Everything else is a cache miss.
- **Output includes reasoning.** Both models run in thinking mode by default, according to the same page. Reasoning tokens are billed as output tokens, so a short visible answer can still use a lot of output.
- **Peak vs off-peak.** Off-peak rates are half of peak rates. The schedule is below.

DeepSeek's pricing page also says model usage is billed as tokens multiplied by price, that charges come out of your topped-up or granted balance (granted balance first), and that prices may change. If you are not sure what a token is or how input and output are counted, see [AI API tokens and what 1M tokens costs](https://goiapi.com/en/blog/ai-api-tokens-pricing).

### Why older articles show different prices

DeepSeek's [change log](https://api-docs.deepseek.com/updates) (checked on December 5, 2026) shows several pricing and model changes in 2026. The one that matters most for budgets: on August 13, 2026 DeepSeek announced peak and off-peak rates, with off-peak at half the peak price, effective 16:00 UTC on August 16, 2026. Pages written around the V4 launch in April 2026 list a single rate per model and figures that do not match the current rate card. If a page has no "checked on" date, treat its numbers as a snapshot.

## DeepSeek peak hours: when prices double

According to DeepSeek's pricing page (checked on December 5, 2026):

- **Peak:** 01:00–04:00 UTC and 06:00–10:00 UTC, Monday to Friday.
- **Off-peak (half price):** every other hour, all weekend, and all day on Chinese public holidays.

![Weekday timeline in UTC: peak at double price from 01:00 to 04:00 and 06:00 to 10:00, off-peak at half price otherwise, and off-peak all day on weekends](https://media.goiapi.com/blog/deepseek-api-peak-hours-utc-rcvlvsl3w4/1600.webp)

The same peak windows in other time zones, using standard (winter) time as of December 2026. If your region uses daylight saving time, shift by one hour in summer.

| Time zone | Peak window 1 | Peak window 2 |
|---|---|---|
| UTC / London (GMT) | 01:00–04:00 | 06:00–10:00 |
| Central Europe (CET, UTC+1) | 02:00–05:00 | 07:00–11:00 |
| India (IST, UTC+5:30) | 06:30–09:30 | 11:30–15:30 |
| Singapore, Beijing (UTC+8) | 09:00–12:00 | 14:00–18:00 |
| Tokyo (JST, UTC+9) | 10:00–13:00 | 15:00–19:00 |
| US Eastern (EST, UTC−5) | 20:00–23:00, previous day | 01:00–05:00 |
| US Pacific (PST, UTC−8) | 17:00–20:00, previous day | 22:00–02:00, previous day into the next |

For the Americas, "previous day" means the peak starts on Sunday evening through Thursday evening local time, because Monday 01:00 UTC is still Sunday there.

If you run batch jobs (bulk classification, data extraction, overnight evaluations) directly against DeepSeek, scheduling them outside these windows halves the bill. Interactive use during your working day may fall inside a peak window depending on where you are.

## DeepSeek V4 models: V4 Pro vs V4.1 Flash

DeepSeek's API currently serves two models (pricing page, checked on December 5, 2026):

| | `deepseek-flash` | `deepseek-v4-pro` |
|---|---|---|
| Model version | DeepSeek-V4.1-Flash-1017 | DeepSeek-V4-Pro-0813 |
| Context length | 1M tokens | 1M tokens |
| Max output | Up to 384K tokens | Up to 384K tokens |
| Thinking mode | Non-thinking and thinking (default) | Non-thinking and thinking (default) |
| JSON output, tool calls | Yes | Yes |
| Image input | Yes | No |
| Concurrency limit | 2,500 | 500 |

Both models accept the OpenAI format at `https://api.deepseek.com` and the Anthropic format at `https://api.deepseek.com/anthropic`.

### V4 Flash vs V4.1 Flash: the model name changed

This is where a lot of confusion comes from. From DeepSeek's change log (checked on December 5, 2026):

- **July 31, 2026:** DeepSeek-V4-Flash entered public beta as `deepseek-v4-flash`.
- **August 13, 2026:** DeepSeek-V4-Pro reached general availability as `deepseek-v4-pro`.
- **September 10, 2026:** DeepSeek-V4.1-Flash was released under a new model name, `deepseek-flash`.
- **October 17, 2026:** V4.1 Flash was upgraded to DeepSeek-V4.1-Flash-1017.

The pricing page says the old names `deepseek-v4-flash` and `deepseek-v4-flash-vision-exp` still work but are retired: requests to them run on DeepSeek-V4.1-Flash-1017 and are billed at the Flash price. In other words, code that still sends `deepseek-v4-flash` is already using V4.1 Flash. For new code, use `deepseek-flash`. Because the original V4 Flash is no longer served, this article only lists V4.1 Flash prices.

### Which one should you use?

Pick by workload, not by benchmark headlines:

- **V4.1 Flash** suits high-volume work: classification, extraction, simple chat, intent detection and short summaries. It is the only one of the two that takes image input on DeepSeek's API. Its input price is a fraction of Pro's.
- **V4 Pro** suits harder reasoning and coding tasks where a wrong answer costs more than the tokens.

A practical approach: start with Flash, read both the output and the `usage` object, and move only the tasks Flash handles poorly to Pro.

One thing we saw in our own tests through GoiAPI on December 3, 2026: on a short summarization request with `max_tokens: 400`, V4.1 Flash spent all 400 output tokens on reasoning and returned empty content, while `usage` still reported 400 output tokens. The same request on V4 Pro returned a complete answer with no reasoning tokens. With Flash, leave `max_tokens` well above the length of the answer you expect.

## How to get a DeepSeek API key

To buy directly from DeepSeek:

1. Create an account on the [DeepSeek Platform](https://platform.deepseek.com/).
2. Open the **Top Up** page and add balance. Accepted payment methods and the minimum amount are set by DeepSeek and shown on that page, and availability can depend on your country, so check it before you commit to this route.
3. Go to **API keys** ([platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys)) and create a new key. Copy it right away and store it somewhere safe, such as a password manager or an environment variable.
4. Call `https://api.deepseek.com` (OpenAI format) or `https://api.deepseek.com/anthropic` (Anthropic format) with the model name `deepseek-flash` or `deepseek-v4-pro`.

DeepSeek's quick-start curl example sends `Authorization: Bearer <key>` to `POST https://api.deepseek.com/chat/completions` (checked on December 5, 2026). Because the API follows the OpenAI format, any OpenAI SDK or [OpenAI-compatible tool](https://goiapi.com/en/blog/openai-compatible-api) works by changing the base URL, the key and the model name.

## DeepSeek on GoiAPI: one key, flat USD rate

If you would rather not depend on DeepSeek's payment options, or you want one key for DeepSeek, Claude, GPT and GLM, you can call both DeepSeek models through GoiAPI. Top-ups are in USDT (TRC20 or BEP20) or Binance Pay, with no credit card and no monthly fee. Pricing is one rate around the clock, with no peak or off-peak split, which makes costs easy to plan.

GoiAPI prices, USD per 1 million tokens, from the [GoiAPI pricing page](https://goiapi.com/en/pricing), checked on December 5, 2026:

| Model | Model name on GoiAPI | Input | Output | Cache read | Cache write |
|---|---|---|---|---|---|
| [DeepSeek V4 Pro](https://goiapi.com/en/models/deepseek-v4-pro-0813) | `deepseek-v4-pro-0813` | $0.144144 | $0.432432 | $0.014495 | $0.18018 |
| [DeepSeek V4.1 Flash](https://goiapi.com/en/models/deepseek-v4.1-flash) | `deepseek-v4.1-flash` | $0.0408408 | $0.1225224 | $0.0040664 | $0.051051 |

Note that the model names differ from DeepSeek's own API: on GoiAPI you send `deepseek-v4-pro-0813` and `deepseek-v4.1-flash`. The full list is returned by [`GET /v1/models`](https://goiapi.com/en/docs/list-models).

How billing works on GoiAPI, from the pricing page and [Limits and balance](https://goiapi.com/en/docs/limits-and-balance):

- You pay for the tokens each request actually uses. Each request that returns content has a small minimum charge, which only matters for very short requests.
- A request that fails without returning any content is not charged, unless you cancel it yourself.
- Before calling the model, GoiAPI holds an estimated amount based on the input and your `max_tokens`, then charges the actual usage and releases the rest.
- Each key can have daily and monthly spending limits and a list of allowed models, so you can create a key that only calls DeepSeek.

Top-ups are final and non-refundable, so top up only what you plan to use. You can always add more later.

### What a typical request costs

Here is the same workload priced both ways: one chat turn with 2,000 input tokens (no cache) and 500 output tokens, and 1,000 such turns. Calculated from the two price tables above (DeepSeek list prices and GoiAPI prices, both checked on December 5, 2026). GoiAPI figures exclude the per-request minimum charge, and reasoning tokens would add to the output count.

| Model and rate | One turn | 1,000 turns |
|---|---|---|
| DeepSeek V4 Pro on DeepSeek, off-peak | $0.00231 | $2.31 |
| DeepSeek V4 Pro on DeepSeek, peak | $0.00462 | $4.62 |
| DeepSeek V4 Pro on GoiAPI (any hour) | $0.000505 | $0.50 |
| DeepSeek V4.1 Flash on DeepSeek, off-peak | $0.00060 | $0.60 |
| DeepSeek V4.1 Flash on DeepSeek, peak | $0.00120 | $1.20 |
| DeepSeek V4.1 Flash on GoiAPI (any hour) | $0.000143 | $0.14 |

To price your own workload, plug your token counts into the [API cost calculator](https://goiapi.com/en/tools/cost-calculator).

## Call the DeepSeek API with curl

GoiAPI accepts OpenAI Chat Completions requests at `https://api.goiapi.com/v1/chat/completions`. Replace `sk-...` with your key:

```bash
curl https://api.goiapi.com/v1/chat/completions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-pro-0813",
    "max_tokens": 200,
    "messages": [{"role": "user", "content": "Answer in one sentence: what is the capital of France?"}]
  }'
```

Always set `max_tokens`. GoiAPI reserves funds based on it before calling the model, so a sensible value keeps requests from being rejected when your balance is low. With `deepseek-v4.1-flash`, do not set it too tight, because reasoning tokens count toward the same limit. Request body, streaming and headers are covered in the [Chat Completions docs](https://goiapi.com/en/docs/openai-chat-completions).

When we ran this request against both DeepSeek models on December 3, 2026, both returned HTTP 200, and the `model` field in the response matched the name we sent. Every response also carries an `x-request-id` header, which you can send to support if you need a request looked up.

To use DeepSeek's API directly instead, change the URL to `https://api.deepseek.com/chat/completions`, use your DeepSeek key, and set `model` to `deepseek-v4-pro` or `deepseek-flash`.

## DeepSeek API in Python (OpenAI SDK)

The OpenAI Python SDK works with DeepSeek because both GoiAPI and DeepSeek follow the OpenAI format. Keep the key in an environment variable rather than in your code:

```bash
# macOS / Linux
export GOIAPI_API_KEY="sk-..."
```

```powershell
# Windows PowerShell
$env:GOIAPI_API_KEY = "sk-..."
```

Install the SDK with `pip install openai`, then run:

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.goiapi.com/v1",
    api_key=os.environ["GOIAPI_API_KEY"],
)

resp = client.chat.completions.create(
    model="deepseek-v4.1-flash",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Summarize the following text in 3 sentences: ..."}],
)

print(resp.choices[0].message.content)
print(resp.usage)
```

`max_tokens=1024` leaves room for Flash's reasoning so the answer is not cut off or empty. Printing `resp.usage` shows the input and output token counts you are billed for.

To switch to a DeepSeek key, set `base_url` to `https://api.deepseek.com`, put the DeepSeek key in the environment variable, and change `model` to `deepseek-flash` or `deepseek-v4-pro`. Nothing else changes.

GoiAPI also supports the OpenAI Responses API (`POST /v1/responses`), with some limits: `previous_response_id` and a few other fields are not supported. See the [Responses API docs](https://goiapi.com/en/docs/openai-responses). GoiAPI is chat only for now; it has no embeddings, image generation or audio endpoints.

## Use DeepSeek V4 in Claude Code

Claude Code speaks the Anthropic Messages format, and both routes support it.

Before you start: Anthropic's [LLM gateway documentation](https://code.claude.com/docs/en/llm-gateway) (checked on December 5, 2026) says Anthropic does not support pointing Claude Code at non-Claude models through any gateway. It works, but if something breaks you will not get help from Anthropic.

### Option 1: DeepSeek's Anthropic endpoint

DeepSeek's [Claude Code guide](https://api-docs.deepseek.com/quick_start/agent_integrations/claude_code) (checked on December 5, 2026) sets `ANTHROPIC_BASE_URL` to `https://api.deepseek.com/anthropic`, `ANTHROPIC_AUTH_TOKEN` to your DeepSeek key, and maps every Claude Code model slot (`ANTHROPIC_MODEL` and the `ANTHROPIC_DEFAULT_*_MODEL` variables) to `deepseek-flash`, using `deepseek-flash[1m]` for the main slots to get the 1M context. Follow that page for the full list, since it also sets subagent, effort and compaction variables. If you want V4 Pro instead, set `ANTHROPIC_MODEL` to `deepseek-v4-pro`.

### Option 2: GoiAPI with one key

GoiAPI serves the Anthropic format at `https://api.goiapi.com/v1/messages`. On December 3, 2026 we called both `deepseek-v4-pro-0813` and `deepseek-v4.1-flash` on that endpoint and both returned 200 with a valid Anthropic-format response. Set three variables and start Claude Code:

```bash
# macOS / Linux
export ANTHROPIC_BASE_URL="https://api.goiapi.com"
export ANTHROPIC_AUTH_TOKEN="sk-..."
export ANTHROPIC_MODEL="deepseek-v4-pro-0813"
claude
```

```powershell
# Windows PowerShell
$env:ANTHROPIC_BASE_URL = "https://api.goiapi.com"
$env:ANTHROPIC_AUTH_TOKEN = "sk-..."
$env:ANTHROPIC_MODEL = "deepseek-v4-pro-0813"
claude
```

The base URL is `https://api.goiapi.com` without `/v1`, because Claude Code appends `/v1/messages` itself. If you add `/v1`, requests go to a path that does not exist, and Claude Code reports a 404 as "There's an issue with the selected model…", which points you at the model instead of the URL.

What we saw on December 3, 2026, running Claude Code 2.1.325 in non-interactive mode (`claude -p "..." --output-format json`) with the three variables above:

- The request succeeded with `deepseek-v4-pro-0813`.
- Claude Code printed a warning to stderr and carried on: `[claude-code:unrecognized_model] {"model":"deepseek-v4-pro-0813","query_source":"sdk"}`.
- A one-line question used 16,507 input tokens, 128 cache-read tokens and 38 output tokens, as reported by Claude Code. Almost all of that is Claude Code's own system prompt and tool definitions. At GoiAPI's V4 Pro prices that is about $0.0024 per turn, compared with a tiny fraction of a cent for the same question sent straight to the API.
- The `total_cost_usd` value Claude Code prints is its own estimate, not what GoiAPI charges. Check the per-request cost in your dashboard instead.

That test was a single short question. We have not tested long sessions with file edits and tool calls on DeepSeek. If you run into problems there, or want different models for different kinds of tasks, see [Claude Code Router with GPT, DeepSeek and GLM](https://goiapi.com/en/blog/claude-code-router). The general key setup is in [Claude Code API key setup](https://goiapi.com/en/blog/claude-code-api-key) and the [Claude Code integration docs](https://goiapi.com/en/docs/integrations/claude-code).

## DeepSeek direct, OpenRouter or GoiAPI: which to choose

**Buy from DeepSeek directly** when:

- You can pay with one of the methods DeepSeek's Top Up page accepts.
- You run large batch jobs and can schedule them off-peak at half price.
- Your prompts start with a long, repeated prefix, so you benefit from DeepSeek's very low cache-hit rate.
- You want your data-processing and usage terms directly with DeepSeek.
- You need features only DeepSeek's platform offers, such as its search, file parsing or speech APIs.

**Use OpenRouter** when you want access to a very large catalog of models or need endpoints GoiAPI does not offer. OpenRouter bills inference at each model's list price and charges a 5.5% fee when you buy credits on its Standard plan ([OpenRouter pricing](https://openrouter.ai/pricing), checked on December 5, 2026).

**Use GoiAPI** when you want one key for DeepSeek, Claude, GPT and GLM, a flat rate at every hour, per-request cost tracking in your dashboard, and top-ups in USDT or Binance Pay with no card. If paying without a card is the main reason, [Claude API without a credit card](https://goiapi.com/en/blog/claude-api-without-credit-card) walks through the USDT top-up. For a similar model pair from Z.ai, see [GLM 5.3 API pricing](https://goiapi.com/en/blog/glm-5-3-api-pricing).

## Common errors when calling DeepSeek through GoiAPI

The full list is on the [error codes page](https://goiapi.com/en/docs/error-codes).

| HTTP | What it means | What to do |
|---|---|---|
| `400` | The body is not JSON, `model` is missing, or the request is invalid for the model | Fix the request as the message says |
| `401` | Missing, wrong or revoked key, for example `The API key is invalid or has been revoked.` with `code: "invalid_api_key"` | Check the `Authorization: Bearer` header |
| `402` | Not enough balance to hold funds for the request | Top up, or lower `max_tokens` |
| `403` | The key is not allowed to use this model or to call from this IP | Check the key's restrictions in the dashboard |
| `404` | Wrong model name or path, for example `The model {model} does not exist. See the list at /v1/models.` | Use `deepseek-v4-pro-0813` or `deepseek-v4.1-flash`, not DeepSeek's own names |
| `429` | Per-minute limit reached, a daily or monthly spending limit on the key reached, or the model is overloaded | Wait for the seconds in `Retry-After`, then retry. Spending-limit errors include `x-should-retry: false`, so raise the limit in the dashboard instead of retrying |
| `500` | Internal error | Retry; if it keeps failing, send the support ID |
| `503` | Maintenance, or the model is temporarily not responding | Retry in a few minutes |

Your key's per-minute limit is returned in the `x-ratelimit-limit-requests`, `x-ratelimit-remaining-requests` and `x-ratelimit-reset-requests` headers. The key we tested on December 3, 2026 had a limit of 60 requests per minute; yours may differ. Per-model availability is shown on the [status page](https://goiapi.com/en/status).

## FAQ

### How much does the DeepSeek V4 API cost?

On DeepSeek's platform (checked on December 5, 2026), DeepSeek V4 Pro costs $0.66 input (cache miss), $0.022 input (cache hit) and $1.98 output per million tokens off-peak, and DeepSeek V4.1 Flash costs $0.15, $0.003 and $0.60. Peak-hour rates are double. On GoiAPI, V4 Pro is $0.144144 input and $0.432432 output, and V4.1 Flash is $0.0408408 input and $0.1225224 output per million tokens at any hour.

### What are DeepSeek's peak hours?

01:00–04:00 and 06:00–10:00 UTC, Monday to Friday. All other hours, weekends and Chinese public holidays are off-peak at half price.

### Do I have to pay to use the DeepSeek API?

Yes. The DeepSeek API is billed per input and output token. DeepSeek's pricing page mentions a granted balance, which is spent before your topped-up balance; whether a new account gets one is shown on the platform after you sign up. To keep a first test small, use V4.1 Flash, a short prompt and a modest `max_tokens`.

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

`deepseek-v4-flash` was the name of the V4 Flash public beta from July 2026. Since September 10, 2026 the current model is V4.1 Flash, called `deepseek-flash`. The old name still works, but DeepSeek runs those requests on DeepSeek-V4.1-Flash-1017 and bills them at the Flash price.

### Does DeepSeek charge for reasoning tokens?

Yes. Thinking is the default mode for both models, and reasoning tokens are billed as output tokens. Check `usage` in the response to see how many you used, and set `max_tokens` high enough that reasoning does not use up the whole budget.

### Can I use DeepSeek V4 with Claude Code?

Yes, through DeepSeek's Anthropic endpoint or through GoiAPI's Anthropic-format endpoint, as shown above. Anthropic does not support Claude Code with non-Claude models, and each turn sends a large system prompt (about 16,500 input tokens in our one-question test), so watch your per-request costs.

### Is the DeepSeek API OpenAI-compatible?

Yes. DeepSeek accepts OpenAI-format requests at `https://api.deepseek.com`, and GoiAPI at `https://api.goiapi.com/v1`. The OpenAI SDKs work with either one after you change the base URL, the key and the model name.

## Get started with DeepSeek on GoiAPI

1. [Create a GoiAPI account](https://goiapi.com/en/signup) and generate an API key in the dashboard. Copy it right away; it is shown only once.
2. Top up with USDT (TRC20 or BEP20) or Binance Pay. Top-ups are final, so add only what you expect to use.
3. Set the base URL to `https://api.goiapi.com/v1` for OpenAI-format tools, or `https://api.goiapi.com` for Claude Code and the Anthropic SDK, and call `deepseek-v4.1-flash` or `deepseek-v4-pro-0813`.

The [quickstart guide](https://goiapi.com/en/docs/quickstart) walks through your first request, and the curl example above with `deepseek-v4.1-flash` is the lowest-cost way to try it.
