OverpayingForAIPricing desk
9 min read·Last reviewed for accuracy · 2026-09-11·Prices verified · 2026-09-12

DeepSeek Agent Cost: V4 Flash and V4 Pro API Pricing for Loops

What DeepSeek V4 Flash and V4 Pro cost on a real 12-step agent run against Claude Sonnet 5, GPT-5.4 and Gemini 3.8 Flash, where DeepSeek tool calling holds up, where it does not, and a hybrid pattern that keeps a flagship for the last step.

The article text carries the review date. The rate table below is rebuilt from the live catalogue on every deploy.

Fastest win

DeepSeek V4 Flash lists at $0.05 per million input and $0.16 per million output. On the reference 12-step agent run that is about $0.009, against $0.39 on Claude Sonnet 5, $0.50 on GPT-5.4 and $0.15 on Gemini 3.8 Flash. Run the loop on V4 Flash and hand the final verification step to Sonnet 5 and the whole run costs about $0.07, 82% less than all-Sonnet, with a flagship checking the answer.

The short answer on DeepSeek agent cost

DeepSeek V4 Flash costs $0.05 per million input tokens and $0.16 per million output. On the reference 12-step agent run, which reads 172,800 input tokens and writes 4,800 output tokens, that is 172,800 × $0.05 + 4,800 × $0.16 = about $0.009. DeepSeek V4 Pro at $0.66 / $1.98 runs the same loop for about $0.12. Claude Sonnet 5 costs $0.39, GPT-5.4 $0.50 and Gemini 3.8 Flash $0.15.

Model$/1M input$/1M outputContext12-step run
DeepSeek V4 Flash$0.05$0.161.3M172,800 × $0.05 + 4,800 × $0.16 = $0.009
DeepSeek V4.1 Flash$0.15$0.601M172,800 × $0.15 + 4,800 × $0.60 = $0.029
DeepSeek V4 Pro$0.66$1.981M172,800 × $0.66 + 4,800 × $1.98 = $0.124
Gemini 3.8 Flash$0.75$3.751M172,800 × $0.75 + 4,800 × $3.75 = $0.148
Claude Haiku 4.5$1$5200K172,800 × $1 + 4,800 × $5 = $0.197
Claude Sonnet 5$2$101M172,800 × $2 + 4,800 × $10 = $0.394
GPT-5.4$2.50$151M172,800 × $2.50 + 4,800 × $15 = $0.504

The trace behind that column: a 4,000-token system prompt plus tools, a 500-token task, and twelve steps each adding a 300-token tool call and a 1,500-token result. The per-step re-send of everything before it is what makes the input column dominate; see [how much an AI agent costs to run](/guides/how-much-does-an-ai-agent-cost-to-run).

DeepSeek V4 pricing, in agent terms

Three things about the price list matter for loops specifically.

Input is where agents spend, and V4 Flash's $0.05 input rate is 40 times below Sonnet 5 and 50 times below GPT-5.4. Output is a minor share of an agent bill, so the input rate is the one to compare.

Context is 1.3M tokens on V4 Flash and 1M on V4 Pro, so a long loop will not hit a window limit before your step cap does; a 200-step run of the reference trace ends at 362,700 tokens of context. Whether the model uses that much history well is a separate question, covered below.

Caching exists on DeepSeek's own endpoint and bills repeated prefix hits at a reduced input rate; the rate is on the vendor page and not in our catalogue, so this article prices everything uncached. If your loop re-sends a large stable prefix, the [prompt caching for AI agents](/guides/prompt-caching-for-ai-agents) rules apply to DeepSeek as well.

Where DeepSeek V4 is reliable

In our experience and in the reports we see from teams running it, V4 Flash holds up in three situations:

  • Structured tool calls on well-specified tasks: a clear system prompt, tools with tight schemas and descriptive names, and a task that says what "done" looks like. Read-file, query-database, call-this-API loops fall here.
  • Long-context reads: summarising or extracting from a few hundred thousand tokens of retrieved material, where the 1.3M window and the $0.05 rate combine to make a single pass cost cents.
  • High-volume, low-stakes loops: classification pipelines, log triage, first-pass code review, anything where a wrong answer is cheap to detect and rerun.

V4 Pro is the same shape with more headroom on judgement, for when you want one vendor and one endpoint but a stronger planning step.

Where it fails

The same reports and our own use point to three weak spots. We describe them as observations, not benchmark results, because we cannot cite a benchmark that isolates them:

  • Ambiguous tasks. When the brief leaves room to infer intent, V4 Flash tends to pick a literal reading and run with it, and by step 6 it has done a lot of confident work on the wrong problem.
  • Long multi-turn planning. Past roughly ten steps with branching decisions, it loses track of what it has already tried and repeats tool calls. The window is large; the planning is not.
  • Strict JSON edge cases. Nested optional fields, arrays of objects, unusual escaping and enum values with near-duplicates are where argument JSON comes back subtly wrong. Validate every tool call against the schema before executing it, and treat a validation failure as a signal to escalate, not to retry on the same model.

These weak spots define the boundary of the hybrid pattern below.

Direct API or OpenRouter: data residency and price

DeepSeek's direct API is operated by DeepSeek, and requests are processed on its infrastructure under its data policy. For some organisations that is a non-starter regardless of price, and the model's weights being open does not change where your prompts go when you call the hosted endpoint.

OpenRouter routes DeepSeek models to third-party hosting providers and lets you restrict which providers or regions serve a request, which is the practical answer to residency requirements. The trade-off is that each host sets its own rate, so an OpenRouter row for the same model can list above the direct price; the [model catalogue](/models) shows the current rows side by side. The full comparison, including caching and reliability differences, is in [OpenRouter vs direct API](/compare/openrouter-vs-direct-api).

The hybrid pattern: V4 Flash for the loop, a flagship for the last step

Run the tool loop on V4 Flash and send the finished transcript to a stronger model once, to verify the work and write the final answer. The flagship reads the whole context one time instead of twelve, so its cost is bounded and small.

Reference run, eleven loop steps on V4 Flash: input 11 × 4,500 + 1,800 × 55 = 148,500 tokens, output 3,300 tokens. 148,500 × $0.05 + 3,300 × $0.16 = $0.008. Verification step, one call reading the full 24,300-token transcript and writing 1,500 tokens:

Verifier ($/1M in / out)Verification stepLoop on V4 FlashTotalvs all-verifier loop
Claude Sonnet 5 ($2 / $10)24,300 × $2 + 1,500 × $10 = $0.064$0.008$0.07$0.39, 82% less
GPT-5.4 ($2.50 / $15)24,300 × $2.50 + 1,500 × $15 = $0.083$0.008$0.09$0.50, 82% less
Claude Opus 5 ($5 / $25)24,300 × $5 + 1,500 × $25 = $0.159$0.008$0.17$0.98, 83% less
DeepSeek V4 Pro ($0.66 / $1.98)24,300 × $0.66 + 1,500 × $1.98 = $0.019$0.008$0.03$0.12, 78% less

The verifier's job is narrow: check that the tool results support the conclusion and produce the final output. Give it a tool to reject the run and route rejections to a full flagship rerun; if fewer than one in ten runs is rejected, the hybrid stays far cheaper than the flagship alone. The same split scales up into the planner-and-workers layout in [multi-agent system cost](/guides/multi-agent-system-cost).

An OpenAI-compatible loop against the DeepSeek endpoint

DeepSeek's API is OpenAI-compatible, so the official openai package works with a different base URL. This loop runs the tool steps on V4 Flash and computes cost from usage on every response:

import json, os
from openai import OpenAI

client = OpenAI(api_key=os.environ["DEEPSEEK_API_KEY"], base_url="https://api.deepseek.com")
MODEL = "deepseek-chat"   # confirm the id that maps to V4 Flash on the DeepSeek models page
spent = 0.0
messages = [{"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": task}]
for step in range(11):
    resp = client.chat.completions.create(model=MODEL, messages=messages, tools=TOOLS, max_tokens=1024)
    u = resp.usage
    spent += (u.prompt_tokens * 0.05 + u.completion_tokens * 0.16) / 1e6   # V4 Flash rates per 1M
    msg = resp.choices[0].message
    messages.append(msg)
    if not msg.tool_calls:
        break
    for call in msg.tool_calls:
        args = json.loads(call.function.arguments)          # validate before executing
        messages.append({"role": "tool", "tool_call_id": call.id,
                         "content": run_tool(call.function.name, args)[:6000]})
# hand `messages` to the verifier model; step 12 on Sonnet 5 ≈ 24,300 × $2 + 1,500 × $10 = $0.064

Truncating tool results at 6,000 characters (roughly 1,500 tokens) keeps the trace matching the table. The [DeepSeek 101 course](/tutorials/deepseek-101) covers the endpoint basics.

Cheapest model that still does this, and when to pay for the flagship

For well-specified tool loops, V4 Flash is the cheapest model in the catalogue that we would trust in production, at $0.009 for the reference run. Gemini 3.8 Flash at $0.15 is the next step up with a different failure profile, and Claude Haiku 4.5 at $0.20 sits just behind it; the ranking across all of them is in [cheapest LLM for AI agents](/guides/cheapest-llm-for-ai-agents).

Pay for a flagship on the whole loop, not just the last step, when the task is ambiguous from step one, when the loop needs more than ten steps of real planning, or when a wrong answer costs more than the $0.38 you save. Claude Opus 5 at $0.98 or GPT-5.5 at $1.01 for the reference run is still cheap next to one bad decision.

How to cap spend on a DeepSeek loop

Cheap loops run unwatched, which is how a 200-step loop happens. At V4 Flash rates a 200-step runaway is about $1.85, so nobody notices until it runs on ten thousand tasks. Keep the same four controls you would use on Sonnet 5:

  • max_tokens per call, 1,024 for tool steps
  • A step cap, 12 to 25, enforced in the loop
  • A stop condition: end on a response with no tool_calls, and abort on a repeated identical call
  • A per-run dollar budget summed from usage.prompt_tokens and usage.completion_tokens, plus the verifier's usage

The runner in [token budget guardrails](/guides/ai-agent-token-budget-guardrails) does this for Anthropic and ports to this endpoint by swapping the usage field names. Price your own trace across vendors in the [calculator](/calculator).

Key Takeaways

  • DeepSeek V4 Flash: $0.05 / $0.16 per 1M, 1.3M context; V4 Pro: $0.66 / $1.98 per 1M, 1M context
  • Reference 12-step run: V4 Flash $0.009, V4 Pro $0.12, Gemini 3.8 Flash $0.15, Claude Sonnet 5 $0.39, GPT-5.4 $0.50
  • Reliable in our experience for structured tool calls on well-specified tasks and for long-context reads; weaker on ambiguous tasks, long multi-turn planning and strict JSON edge cases
  • Hybrid loop: 11 steps on V4 Flash plus one Sonnet 5 verification step costs about $0.07; with Opus 5 verifying, about $0.17
  • Direct API means DeepSeek's own servers and data policy; OpenRouter lets you pick a hosting region at a different listed rate
  • Same guardrails apply: a 200-step V4 Flash loop is only $1.85, which is why teams forget to cap it

Editorial context

Who is this for?

Developers choosing a model for tool-calling loops who want to know whether DeepSeek's prices hold up on real agent traces.

When NOT to use this

Regulated workloads that cannot send data to DeepSeek's servers and cannot use a pinned-region host, or tasks that are ambiguous from the first step.

Pricing insights

V4 Flash is 40 times cheaper per input token than Claude Sonnet 5 and 50 times cheaper than GPT-5.4; on a 12-step loop that is $0.009 against $0.39 and $0.50.

Alternatives to consider

Gemini 3.8 Flash at $0.75 / $3.75 and Claude Haiku 4.5 at $1 / $5 for cheap loops with different failure profiles; a flagship for planning-heavy runs.

Final verdict

Use V4 Flash for the loop when the task is well specified, verify with a flagship, and cap the run. That combination is the cheapest reliable agent configuration in the catalogue today.

Frequently Asked Questions

How much does DeepSeek V4 cost for an AI agent?

DeepSeek V4 Flash lists at $0.05 per million input tokens and $0.16 per million output; V4 Pro at $0.66 and $1.98. A 12-step tool loop that reads 172,800 input tokens and writes 4,800 output tokens costs about $0.009 on V4 Flash and about $0.12 on V4 Pro, against about $0.39 on Claude Sonnet 5 and $0.50 on GPT-5.4.

Does DeepSeek support tool calling?

Yes. The DeepSeek API is OpenAI-compatible, so you pass a tools array to chat.completions.create and receive tool_calls on the response the same way you would with the OpenAI SDK. In our experience V4 Flash makes correct structured calls on well-specified tasks; check argument JSON before executing, because strict-schema edge cases are where it slips.

Where does DeepSeek V4 fail in agents?

Reports and our own use point to three areas: ambiguous tasks where the model must infer intent, long multi-turn planning where it loses track of what it has already done, and strict JSON edge cases such as nested optional fields or unusual escaping. For those, route the planning or the final step to Claude Sonnet 5, GPT-5.4 or a flagship.

Should I use DeepSeek direct or through OpenRouter?

Direct gives you DeepSeek's own list price and its own servers and data policy, which some organisations cannot accept. OpenRouter routes to third-party hosts, lets you restrict which providers or regions serve the request, and lists the same model at whatever rate the host sets, which can differ from the direct price. Compare the catalogue rows before choosing.

What is the hybrid DeepSeek plus flagship pattern?

Run the tool loop on DeepSeek V4 Flash and send the complete transcript to a flagship for one verification and final-answer step. For the reference run that is about $0.008 for eleven V4 Flash steps plus $0.064 for a Claude Sonnet 5 final step, about $0.07 total, which is 82% cheaper than running the whole loop on Sonnet 5.

Is DeepSeek V4 Pro worth 13 times the price of V4 Flash?

For most tool loops, no. V4 Pro at $0.66 per million input costs about $0.12 on the reference run, and at that price Gemini 3.8 Flash is close and Claude Haiku 4.5 is not far off. V4 Pro earns its place when you want a stronger model from the same vendor for the planning step without changing endpoints.

Related

Free courses · no sign-up

Still deciding? Learn the basics first, then come back to the prices.

If our calculators helped you cut down on hidden AI wallet leaks, thanks for using them. A tiny fraction of your savings is what keeps our pricing indexes updated daily.

Not sure which AI is cheapest for your use case? Find out in 30 seconds — no signup required.

AI cost intelligence

Stop overpaying for AI tools

Join the OverpayingForAI list for pricing updates, cheaper alternatives, and practical buying guidance.

Now tracking 50+ AI tools, models, platforms, subscriptions, coding tools, and automation products.

We use your email only for OverpayingForAI updates. Unsubscribe anytime.