Three throughput numbers, not one
Search for token throughput benchmarks and you'll mostly find a single number: tokens per second, measured with one request in flight and a prompt nobody would actually send. That number is close to useless for capacity planning, because throughput is not a property of a model — it's a property of your workload running against that model.
Three measurements matter, and they move independently. Per-request output rate is how fast a single response streams, which is what a chat user perceives. Aggregate throughput is how many output tokens per second the endpoint sustains while many requests are in flight, which is what your batch pipeline cares about. Cost efficiency is how much usable output you get per unit of spend. deepseek-v4-flash and deepseek-v4-pro diverge most on the second and third, and barely at all on the first when your prompts are short.
Build the harness before you trust any number
The script below sweeps concurrency for both models with an identical prompt and an identical max_tokens, so the comparison is apples to apples. It uses the OpenAI SDK pointed at AiCredits and reads your key from the environment.
import asyncio
import os
import time
from openai import AsyncOpenAI
client = AsyncOpenAI(
api_key=os.environ['AICREDITS_API_KEY'],
base_url='https://api.aicreditsapi.com/v1',
)
PROMPT = (
'Summarize the trade-offs between a token bucket and a sliding window '
'rate limiter, then recommend one for a public HTTP API. About 200 words.'
)
MODELS = ['deepseek-v4-flash', 'deepseek-v4-pro']
async def one_call(model: str, max_tokens: int = 256):
start = time.perf_counter()
resp = await client.chat.completions.create(
model=model,
messages=[{'role': 'user', 'content': PROMPT}],
max_tokens=max_tokens,
)
elapsed = time.perf_counter() - start
return resp.usage.completion_tokens, elapsed
async def sweep(model: str, levels=(1, 4, 8, 16), rounds: int = 3):
rows = []
for concurrency in levels:
total_tokens = 0
total_wall = 0.0
per_request_rates = []
for _ in range(rounds):
t0 = time.perf_counter()
results = await asyncio.gather(
*(one_call(model) for _ in range(concurrency))
)
total_wall += time.perf_counter() - t0
for tokens, elapsed in results:
total_tokens += tokens
per_request_rates.append(tokens / elapsed)
rows.append({
'model': model,
'concurrency': concurrency,
'aggregate_tps': round(total_tokens / total_wall, 1),
'per_request_tps': round(
sum(per_request_rates) / len(per_request_rates), 1
),
})
return rows
async def main():
for model in MODELS: # warm the connection pool before measuring
await one_call(model, max_tokens=16)
for model in MODELS:
for row in await sweep(model):
print(row)
if __name__ == '__main__':
asyncio.run(main())
Three details decide whether the output means anything. First, completion_tokens from the usage object is the only honest token count — counting streamed chunks overshoots because of role and finish chunks. Second, max_tokens must be identical across models or you're benchmarking the cap, not the model. Third, interleave the models rather than running all-flash-then-all-pro; provider-side load drifts minute to minute and sequential runs quietly bake that drift into your conclusions.
How to read the sweep
Aggregate throughput flattens while per-request rate keeps falling? You've hit a queue, not a compute limit. Adding workers past that point buys latency, not throughput.
Per-request rate stays roughly flat as concurrency climbs? You still have headroom — keep going until the curve bends.
Discard the first round. TLS handshakes and cold connections make round one look like a bad day.
Keep output length fixed. A model that writes 400 tokens where another writes 150 'wins' on wall clock and loses on tokens per second.
Run the sweep at the same time of day. Off-peak behaves differently from peak, and that holds for every API you'll ever benchmark.
The expected shape: flash vs pro
These are the tradeoffs to design around. Measure the actual values on your own traffic rather than trusting anyone's published chart, including ours.
| Dimension | deepseek-v4-flash | deepseek-v4-pro |
|---|---|---|
| Per-request output rate | Higher; streams feel snappy | Lower; heavier compute per token |
| Aggregate at high concurrency | Scales further before flattening | Saturates sooner; queueing arrives earlier |
| Quality on hard tasks | Good for extraction, routing, summaries | Better on multi-step reasoning and refactors |
| Relative cost | Cheaper per token | Costs more per token |
| Default for | Chat, batch jobs, classification, linting | Code review, long-context analysis, agent planning |
The practical consequence: deepseek-v4-flash is your throughput workhorse and the right default for chat, classification, extraction, summarisation, and any batch job where you pay for volume. deepseek-v4-pro spends more compute per output token, so expect a lower per-request rate and an aggregate curve that saturates at lower concurrency — the queue forms earlier. Spend pro where a wrong answer is expensive: multi-step reasoning, code review, long-context analysis, agent planning.
Time-to-first-token deserves its own number
End-to-end throughput tells you when a response finishes, not when it starts. With a human on the other end, TTFT is the number users feel, and it can only be measured on the streaming path.
import asyncio
import os
import time
from openai import AsyncOpenAI
client = AsyncOpenAI(
api_key=os.environ['AICREDITS_API_KEY'],
base_url='https://api.aicreditsapi.com/v1',
)
async def ttft(model: str, prompt: str = 'List five idempotency pitfalls in REST APIs.'):
start = time.perf_counter()
first_chunk_at = None
chunks = 0
stream = await client.chat.completions.create(
model=model,
messages=[{'role': 'user', 'content': prompt}],
max_tokens=300,
stream=True,
)
async for chunk in stream:
if not chunk.choices:
continue
delta = chunk.choices[0].delta
if delta and delta.content:
if first_chunk_at is None:
first_chunk_at = time.perf_counter()
chunks += 1
end = time.perf_counter()
return {
'model': model,
'ttft_s': round((first_chunk_at or end) - start, 3),
'e2e_s': round(end - start, 3),
'chunks': chunks,
}
async def main():
for model in ('deepseek-v4-flash', 'deepseek-v4-pro'):
print(await ttft(model))
if __name__ == '__main__':
asyncio.run(main())
Compare TTFT at the same output length and at the concurrency you actually run. A model with excellent single-request TTFT can still queue badly under load, and that degradation is the failure mode your users notice first.
Cap concurrency instead of chasing it
The most common performance regression in LLM applications is an unbounded asyncio.gather. Fan out 500 requests at once and you don't get 500× throughput — you get a queue, a pile of timeouts, and a retry storm that makes everything slower than before. Wrap calls in an asyncio.Semaphore sized to the point where your aggregate curve goes flat, add exponential backoff with jitter, and treat a 429 as a signal to shed load rather than to retry immediately. Benchmark the semaphore value, not just the model.
Turn the numbers into a routing policy
Once you know the shape of both curves, the optimisation is obvious: stop sending traffic to pro that flash can handle. Route on cheap signals — prompt length, task keywords, whether the request is interactive — and escalate on failure.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ['AICREDITS_API_KEY'],
base_url='https://api.aicreditsapi.com/v1',
)
HARD_SIGNALS = ('prove', 'refactor', 'architecture', 'stack trace', 'migrate', 'audit')
def pick_model(prompt: str) -> str:
lowered = prompt.lower()
if len(prompt) > 4000 or any(sig in lowered for sig in HARD_SIGNALS):
return 'deepseek-v4-pro'
return 'deepseek-v4-flash'
def ask(prompt: str, max_tokens: int = 800) -> str:
model = pick_model(prompt)
try:
resp = client.chat.completions.create(
model=model,
messages=[{'role': 'user', 'content': prompt}],
max_tokens=max_tokens,
)
return resp.choices[0].message.content
except Exception:
if model == 'deepseek-v4-pro':
raise
resp = client.chat.completions.create(
model='deepseek-v4-pro',
messages=[{'role': 'user', 'content': prompt}],
max_tokens=max_tokens,
)
return resp.choices[0].message.content
Log which model you picked and how often you escalated. A healthy mix is mostly flash with a small, stable pro share. If pro's share keeps creeping up, your routing rules are too eager and you're paying for compute you never needed.
The throughput that actually bills you
Wall-clock throughput and spend are separate axes. deepseek-v4-flash costs less than deepseek-v4-pro, cache hits cost less than cold prompts, and off-peak costs less than peak. Two habits follow directly.
Keep your prompt prefix stable. Put the static system prompt and instructions first and the variable user content last, so the prefix stays cacheable. Reordering a prompt because it 'reads better' can silently turn every cached call into a cold one — a real throughput regression that no benchmark chart will show you. And avoid re-sending a long document on every turn of a conversation when a short reference will do.
Throughput is a property of your workload, not the model. Benchmark your prompts, at your concurrency, at your time of day.
Current rates for both models live on aicreditsapi.com/pricing. Re-run the sweep above whenever you change prompt length or concurrency, because those two variables will move your numbers more than any model swap.
FAQ
Yes. The harness runs both models through the same client with the same prompt and max_tokens. Interleave the runs and repeat them, because the thing you can't control is provider-side load — running all of one model and then all of the other bakes that drift into your results.
You've hit either a per-key concurrency limit or the point where queueing latency outweighs the extra parallelism. The script prints per-request rate alongside aggregate, so the tell is simple: aggregate flat plus per-request dropping means stop adding workers.
Not the total token count, but it changes perceived latency a lot. Measure time-to-first-token separately from end-to-end time — for chat interfaces TTFT is the number users actually feel.
deepseek-v4-flash for nearly everything, with a rule-based escalation to deepseek-v4-pro for long prompts and hard task classes. Then measure your escalation rate instead of guessing at it.
aicreditsapi.com issues DeepSeek API credits payable by card or PayPal — no Chinese phone number or bank account required. Set it as AICREDITS_API_KEY and the scripts above run unchanged.