AiCredits
Pricing Deep Dive

DeepSeek V4 Pro Price Guide: Peak vs Off-Peak vs Cache Hit Rates

How DeepSeek V4 Pro billing actually works across peak, off-peak, and cache-hit lanes — plus runnable code to land your traffic in the cheaper one, every time.

Published 2026-09-24 Updated 2026-09-24 6 min

Why your DeepSeek V4 Pro bill never matches your napkin math

Most developers estimate spend by multiplying token counts by one rate they saw once on a pricing page. That model collapses the moment real traffic arrives. DeepSeek V4 Pro is billed across several lanes at once — cached input, uncached input, generated output, and the time-of-day window your request lands in — and each lane moves independently. Two workloads with identical token counts can produce very different invoices, because one reuses a stable prompt prefix and the other rebuilds it from scratch on every call.

The useful reframe: cost tuning is not mainly about shrinking your prompt. It is about changing which lane your tokens travel in. Below is how each lane behaves, plus code you can run today against AiCredits to see which lane you are actually landing in.

The billing lanes at a glance

Before optimising anything, separate the levers. They are independent, and the cheapest fix is usually the one you already control.

LaneWhat it rewardsHow to land in it
Cache hit (input)Sending a prefix identical to one you sent recentlyFreeze system prompts, tool schemas, and rule blocks; put all variable text last
Cache miss (input)Novel input tokensBatch similar jobs, deduplicate context, retrieve less
Off-peak windowWork that tolerates delayQueue deferrable jobs and drain them inside the cheaper window
Peak windowLow latency, immediate answersKeep interactive traffic here; move batch work out
Output tokensShort, well-specified answersCap max_tokens, request structured output, forbid preamble

Exact rates for each lane live at aicreditsapi.com/pricing, and they change over time — read them there rather than trusting any blog post, including this one. The structure is stable enough to engineer against; the numbers are not.

Cache hits are positional, not textual

A cache hit happens when the beginning of your prompt is byte-identical to a prefix your account sent recently. The provider spots the match, skips recomputing that section, and prices those tokens more cheaply. The key word is beginning. The match is positional — one changing character near the top invalidates everything after it.

This is why the most common optimisation attempt fails. Teams spend a week compressing a long system prompt, then prepend a timestamp, a session ID, or a freshly shuffled set of few-shot examples. The cache never hits and the compression work buys nothing. The fix costs nothing: everything static goes first, everything variable goes last.

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ['AICREDITS_API_KEY'],
    base_url='https://api.aicreditsapi.com/v1',
)

# Everything that never changes goes first, in the system message.
SYSTEM = '''You are a linter. Apply these rules exactly.

<rules>
- flag bare except clauses
- flag mutable default arguments
- flag `== None` instead of `is None`
- flag f-strings with no placeholders
- flag variables that shadow builtins
</rules>

Reply with a JSON array of objects: {'line': int, 'rule': str, 'fix': str}'''

def lint(source: str) -> str:
    resp = client.chat.completions.create(
        model='deepseek-v4-flash',
        messages=[
            {'role': 'system', 'content': SYSTEM},  # stable prefix -> cacheable
            {'role': 'user', 'content': source},    # the only part that varies
        ],
    )
    u = resp.usage
    print(
        'prompt:', u.prompt_tokens,
        'completion:', u.completion_tokens,
        'cache_hit:', getattr(u, 'prompt_cache_hit_tokens', None),
        'cache_miss:', getattr(u, 'prompt_cache_miss_tokens', None),
    )
    return resp.choices[0].message.content

print(lint('def f(a): return a == None'))

Read that usage object carefully. Providers do expose cache accounting in the response, but the field names differ between API versions and SDK releases, so print what actually comes back instead of hardcoding a key. If your hit counter stays at zero across repeated calls with an identical system message, the culprit is almost always a stray dynamic value above the fold.

Peak vs off-peak: schedule the work you do not need right now

Off-peak windows exist because inference demand is uneven. Requests that land in a cheaper window cost less for the same work, which makes scheduling a genuine cost lever — but only for work that tolerates delay. Interactive traffic does not qualify: a user waiting on a lint result does not care that a batch summariser could have run four hours later.

So split the workload deliberately. Anything latency-tolerant goes through a queue and drains inside the off-peak window. The window boundaries are set by the provider and can shift, so read them from the pricing page and keep them in configuration rather than hardcoding a guess:

import datetime as dt
import os

# Fill these in after checking the current window on aicreditsapi.com/pricing.
OFF_PEAK_START = int(os.environ.get('OFF_PEAK_START_HOUR', '0'))
OFF_PEAK_END = int(os.environ.get('OFF_PEAK_END_HOUR', '0'))

def in_off_peak(now=None) -> bool:
    now = now or dt.datetime.now(dt.timezone.utc)
    h = now.hour
    if OFF_PEAK_START == OFF_PEAK_END:
        return False  # window not configured
    if OFF_PEAK_START < OFF_PEAK_END:
        return OFF_PEAK_START <= h < OFF_PEAK_END
    return h >= OFF_PEAK_START or h < OFF_PEAK_END  # window wraps past midnight

if __name__ == '__main__':
    print('off-peak right now?', in_off_peak())

Pair that check with a cron-driven drain loop: if the window is open, process queued jobs sequentially with a short pause between calls; if it is closed, exit and leave the queue for the next run. Most batch traffic then migrates to the cheaper lane without a single prompt change.

  • Keep on peak: user-facing chat, inline linting, autocomplete, anything a human is watching.

  • Push to off-peak: nightly repo scans, documentation generation, backfills, embedding refreshes.

  • Never defer: anything whose result someone is blocked on, even if it feels like batch work.

  • Watch the clock drift: window boundaries change, so re-check them periodically instead of assuming last quarter's schedule.

Pro vs flash is the third lever

Model choice interacts with everything above. deepseek-v4-flash is the fast default and handles the large majority of calls — classification, formatting, summarisation, routine linting, straightforward code explanation. deepseek-v4-pro costs more and earns its keep when a wrong answer is expensive: subtle concurrency bugs, architecture tradeoffs, migrations where a plausible-but-wrong suggestion costs an hour of debugging.

The failure mode to avoid is blanket-upgrading an entire service to pro because one hard task failed, then paying pro rates for thousands of trivial calls. Escalate per call instead:

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ['AICREDITS_API_KEY'],
    base_url='https://api.aicreditsapi.com/v1',
)

def ask(prompt: str, escalate: bool = False) -> str:
    model = 'deepseek-v4-pro' if escalate else 'deepseek-v4-flash'
    resp = client.chat.completions.create(
        model=model,
        messages=[{'role': 'user', 'content': prompt}],
        temperature=0.2,
    )
    return resp.choices[0].message.content

print(ask('Suggest a better name for the variable `d`.'))
print(ask('This asyncio worker deadlocks under load. Find the cause.', escalate=True))

A pattern that works well in production: run the flash attempt first, validate the output mechanically (schema parse, lint pass, regex the answer must satisfy), and escalate to pro only when validation fails. Under that design pro becomes a fallback path — and fallback paths are exactly where cache hits and off-peak batching pay off most, because they repeat the same prompt shape over and over.

A checklist before you ship

  • Freeze the prefix: system prompt, tool definitions, and rule blocks constant; variable content last.

  • Verify the cache: log the usage object and confirm hits are non-zero on repeated traffic.

  • Cap the output: set max_tokens and request structured answers instead of prose.

  • Queue the deferrable: nightly and batch jobs run inside the off-peak window.

  • Default to flash: escalate to pro per call, not per project.

  • Re-read the pricing page after any provider change — lane structure is more stable than the rates.

Where AiCredits fits

AiCredits sells DeepSeek API credits to developers outside China. You top up with a card or PayPal — no Chinese phone number, bank account, or reseller account required — and point the OpenAI SDK at our base URL, which is exactly what every snippet above does. The same account includes code linting tools, so the cache-friendly rule blocks in the first example have somewhere real to come from. Current rates across deepseek-v4-flash, deepseek-v4-pro, cache hits, and off-peak windows are on the pricing page.

FAQ

Is DeepSeek V4 Pro always more expensive than flash?

Pro costs more per token than flash, so the practical rule is to reserve it for calls where a wrong answer is expensive. Escalate per call rather than upgrading a whole service.

How do I confirm my request actually hit the cache?

Print the usage object returned with each response. Cache accounting fields vary by API version and SDK release, so inspect the raw object rather than hardcoding a key name.

Can I get off-peak rates by simply retrying later?

Not reliably — the windows shift, so check the current boundaries at aicreditsapi.com/pricing. Defer work you can queue instead of re-running interactive requests and hoping.

Do I need a Chinese phone number or bank card to use DeepSeek V4 Pro?

Not with AiCredits. Credits are purchased with a card or PayPal, and the endpoint is the standard OpenAI-compatible base URL used throughout this article.

Does lowering max_tokens really reduce spend?

Yes, since output is billed per generated token, but it is a blunt lever. Clearer instructions and a required output format usually save more than a tight cap that triggers retries.

Try Lint in 2 seconds

Wrote something? Paste it here for a free grammar check. No account needed.

More Tools →

Related Tools

💻Code Explainer

Was this article helpful?

| Share on X Reddit Copy link

服务器宕机了?别等用户告诉你

Wakeless 梦哨 帮你 30 秒监控网站 / API / SSL 证书,宕机秒级告警到邮箱、飞书、Slack。免费档 30 个监控,永久免费,无需信用卡。

免费开始监控 →
💬
反馈意见 / Feedback ×