Seongwoo Choi / Journal

DeepSeek API guide: models, prices, and Claude Code setup

At a glanceDeepSeek's API in November 2026: two models, a 1M-token context, peak and off-peak prices, automatic caching, and the documented Claude Code settings.

Not testedAn overview of DeepSeek's documentation. No account was created and no request was sent.

In this article 6 sections
  1. 1. Two model names
  2. 2. Prices change with the time of day
  3. 3. Caching is automatic, if your prompts start the same way
  4. 4. Calling it
  5. 5. Using it in Claude Code
  6. 6. Before you rely on it

DeepSeek sells access to its models through an API that copies the request format of both OpenAI and Anthropic. That makes it easy to try: most tools only need a different base URL and key. This guide collects what the documentation says about the models, what they cost, how caching lowers the bill, and how to point Claude Code at it.

1. Two model names

The API exposes two models. You call them by a stable name, and DeepSeek decides which version serves it.

deepseek-flashdeepseek-v4-pro
Served byDeepSeek-V4.1-Flash-1017DeepSeek-V4-Pro-0813
Context length1M tokens1M tokens
Maximum output384K tokens384K tokens
Vision inputYesNot supported
Concurrency limit2,500500

Both support tool calls, JSON output and a thinking mode, which is on by default. The older names deepseek-v4-flash and deepseek-v4-flash-vision-exp are still accepted, but those models have been retired. Requests using them are served by the current Flash model and billed at the Flash price. The October change is covered in DeepSeek V4.1-Flash-1017 released.

2. Prices change with the time of day

Prices are per one million tokens, and there are two rates. Off-peak is half of peak.

Per 1M tokensFlash, off-peakFlash, peakV4 Pro, off-peakV4 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

Peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday, excluding Chinese public holidays. Everything else is off-peak, including weekends.

A worked example on the Flash model: 10 million uncached input tokens and 2 million output tokens cost 10 × $0.15 + 2 × $0.60 = $2.70 off-peak. The same job during peak hours costs $5.40. If a batch job can wait, schedule it outside the peak windows.

Two more billing facts. The separate Search and Fetch APIs cost $0.75 per 1,000 successful requests each. And usage is deducted from a balance you top up in advance, so check the balance before starting a long job.

3. Caching is automatic, if your prompts start the same way

The gap between a cache hit and a miss is large: on Flash, $0.003 against $0.15 off-peak. Caching is enabled for every account with no code changes, and it matches on the beginning of the request.

The rule in the documentation is that a request hits the cache only when it fully matches a prefix that has already been stored. Two examples from the same page:

  • First request A + B, second request A + B + C. The second one hits the cache for A + B.
  • First request A + B, second request A + C. The second one misses. The system then notices the shared prefix A and stores it, so a third request A + D hits the cache for A.

In practice, put what does not change at the front: the system prompt, tool definitions, a long reference document. Put what changes, such as the user's question, at the end. Anything that varies near the top, such as a timestamp, breaks the match for everything after it.

The response tells you what happened. The usage section includes prompt_cache_hit_tokens and prompt_cache_miss_tokens. DeepSeek describes the cache as best-effort, with no guaranteed hit rate, and says unused entries are cleared after a few hours to a few days.

4. Calling it

With the OpenAI SDK, change the base URL and the model name. This is the documentation's example:

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get('DEEPSEEK_API_KEY'),
    base_url="https://api.deepseek.com",
)

response = client.chat.completions.create(
    model="deepseek-flash",
    messages=[
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": "Hello"},
    ],
    stream=False,
    reasoning_effort="high",
    extra_body={"thinking": {"type": "enabled"}},
)

print(response.choices[0].message.content)

For tools built on Anthropic's format, the base URL is https://api.deepseek.com/anthropic.

5. Using it in Claude Code

Because of that Anthropic-compatible endpoint, Claude Code can run on DeepSeek models. The documentation gives these environment variables for macOS and Linux:

export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API Key>
export ANTHROPIC_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-flash[1m]
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-flash
export CLAUDE_CODE_EFFORT_LEVEL=max
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=786432

Then start claude in the project directory as usual.

One detail affects the bill. If a tool sends a Claude model name that DeepSeek does not recognise, the API maps it: names starting with claude-opus go to deepseek-v4-pro, and other claude names go to deepseek-flash. Pro output costs 3.3 times as much as Flash, and uncached input 4.4 times. The documented settings above avoid the surprise by setting every model variable to Flash explicitly. Leave those lines out and any request that names an Opus model is billed at the Pro price.

Claude Code's own project files work the same whichever model answers. They are covered in Claude Code project setup.

6. Before you rely on it

  • The pricing page says prices may change and recommends checking it regularly. Treat the table above as a snapshot.
  • Peak hours cover part of the European morning and the late evening in the Americas. Check them against when your jobs run.
  • This guide did not review DeepSeek's privacy terms. Read them before sending confidential code or customer data.
  • Nothing here was tested. Run your own task on both models before choosing; the cheaper one is often enough.

For the story around the company rather than the API, Fireship's short video DeepSeek is back... and Silicon Valley is terrified is a quick watch.

Sources

This article reflects public information available when it was written. Versions, defaults and prices can change; check the linked official documentation.

This is an overview of DeepSeek's documentation as read on November 12, 2026, not a hands-on review. No account was created and no requests were sent. Prices and limits are DeepSeek's published figures, and the cost example is arithmetic on that price table. Written for this site with AI assistance, from the sources above. For errors or additional information, please request a correction. Editorial policy