Errors

HTTP error codes, response formats, and retry rules.

Errors

HTTPMeaningRecommended action
400Invalid requestCorrect JSON and required fields
401Invalid, frozen, or revoked keyRotate or unfreeze the key
402Insufficient account balance or key usage limit reachedAdd funds or reset/increase the key limit
403Model unavailable for the keyUpdate key permissions
404Unknown endpoint, model, or async requestCheck the identifier and path
413Request too largeReduce context size
429RPM or concurrency exceededHonor Retry-After
500Gateway errorRetry and inspect logs
502/503/504Upstream unavailable or timed outRetry with exponential backoff

Retry 429 after Retry-After. Retry 500, 502, 503, and 504 up to three times with 1/2/4-second backoff. Do not automatically retry validation, authentication, balance, or not-found errors.

Use the request public ID from X-Request-ID to correlate the response with the request log.