Handling HTTP 429
Mengbi Router returns HTTP 429 when request-rate or in-flight capacity limits are reached.
Safe retries
Read Retry-After and use bounded exponential backoff.
if status == 429:
wait Retry-After or exponential_backoff
retry with a bounded number of attemptsAvoid retry storms
- Do not retry continuously without a delay.
- Do not launch duplicate copies of the same request.
- Do not interpret HTTP 429 as a missing model.
In-flight limits
Each personal account and each API Key may run up to 10 simultaneous requests.
Global capacity protection
Requests also share a protected upstream capacity pool, and image requests consume more capacity. Wait for Retry-After before retrying a rejected request.
Disconnect cleanup
When a client disconnects, Mengbi Router cancels the upstream request and releases its capacity and wallet reservation without reporting the cancellation as an upstream incident.