DeepSeek API error codes

What each code means, what to do, and crucially: whether retrying is worth it.

CodeMeaningRetry?
400Invalid request body format — malformed JSON, missing field, wrong typeNo
401Authentication failed — wrong, missing or deleted API keyNo
402Insufficient balanceNo
422Invalid parameters — unknown model, out-of-range temperature, max_tokens too largeNo
429Rate limit reached — too fast, or concurrency/QPS exceededYes, with backoff
500Server errorYes
503Server overloadedYes

429 is your problem, 503 is not

429 means you are sending too much. Flash allows up to 2500 concurrent requests, V4 Pro up to 500. Sharing one key across many instances is the usual cause. Fix it with a global concurrency limit, not by retrying harder.

503 means the service is overloaded. Nothing about your request caused it. Avoiding peak hours (Beijing 09:00–12:00 and 14:00–18:00) meaningfully reduces how often you hit it — which is also the off-peak advice.

Backoff settings that work

delays: 1s, 2s, 4s, 8s, 16s  (max 5 attempts)
add +/- 20% jitter to avoid synchronised retries
retry only on: 429, 500, 503
never retry on: 400, 401, 402, 422

Common 422 causes

Related

Pricing · Cost calculator · FAQ