GUIDES · BATCH & CONCURRENCY

Batch workloads: concurrency, 429s and retries

If you are running thousands of requests rather than chatting, the only question that matters is what happens when they overlap. Below is what we measured on our own endpoint, including the parts that are not flattering.

BASE URL https://apikey.help/v1 MODEL deepseek-v4.1-flash-1017

01What we measured

Sixteen identical 8-token requests, fired simultaneously at apikey.help/v1 with one API key, then repeated at lower levels. Same key, same model, same machine, ten seconds between rounds so upstream rate-limit windows could recover.

Parallel requestsSucceededp50p95
22 / 24.2 s4.2 s
44 / 42.7 s4.6 s
88 / 87.3 s12.4 s
1616 / 163.4 s24.0 s

Read the two columns separately, because they tell different stories.

Nothing failed. Every request eventually returned 200 at every level, including 16 at once. There is no concurrency cap on your key.

But latency degrades badly. p95 goes from 4.2 s at concurrency 2 to 24 s at concurrency 16. That is not a queue on our side — it is the upstream failover path: when the primary provider rate-limits a request, we wait for it to give up before moving to the next provider. Under load that wait happens more often, and it is serial.

02Where 429s actually come from

We do not rate-limit your key. There is no per-key requests-per-minute cap on this endpoint — check the measured table above, sixteen parallel requests all went through.

The 429s you will occasionally see are upstream rate limits being relayed. We buy capacity from several providers, and those providers limit by account, not by your key. When one is saturated, the request is retried on the next provider automatically. If every provider refuses, you get the 429.

That has one practical consequence worth knowing: adding more keys to your side does not raise the ceiling. The limit lives on the supplier's account, which we share. Ten keys from you hit the same upstream pool as one.

03Retry patterns that work here

Because a 429 usually means "another provider is about to be tried", the worst thing to do is resend immediately at the same rate. What works:

import time, random, httpx

def call(payload, tries=5):
    for n in range(tries):
        r = httpx.post("https://apikey.help/v1/chat/completions",
                       json=payload, headers={"Authorization": f"Bearer {KEY}"},
                       timeout=120)
        if r.status_code == 200:
            return r.json()
        if r.status_code not in (429, 500, 502, 503, 504):
            r.raise_for_status()          # 4xx: retrying will not help
        time.sleep(min(2 ** n, 30) + random.random())
    r.raise_for_status()

04What a failed call costs

Nothing. Upstream errors, timeouts and broken streams never reach your bill. A retry that eventually succeeds is billed once, for the successful call.

This matters more than it sounds for batch work: retrying is free in money and expensive only in time. Budget for latency, not for double billing.

05Where this is the wrong tool

Being straight about the limits, because discovering them mid-run is worse:

If those constraints fit how you work, the price makes batch jobs viable that would not be at list price. If they do not, the official API is the honest recommendation.

06FAQ

Is there a concurrency limit per API key?

No hard cap. Sixteen simultaneous requests on one key all succeeded in our own test. Tail latency rises with concurrency, so 4–8 in flight is the practical sweet spot.

Why do I get 429 if there is no rate limit on my key?

429s come from upstream providers limiting by account, not from us limiting your key. The request is retried on another provider automatically; you only see the 429 if all of them refuse.

Does adding more API keys increase throughput?

No. Upstream limits are per supplier account, which we share. Extra keys do not lift the ceiling — they only help you separate usage reporting.

Am I billed for retried or failed requests?

No. Only successful calls are billed. A request that fails and is retried successfully is charged once.

Can I check my balance programmatically?

Not with an API key today. Balance shows in the console and billing page; top-ups are USDC transfers on Base. If you need automated top-up, that has to be driven from the wallet side.

← All guides API reference
Start free

→Read next