Decide what to do
The full list of codes is in Errors.
A retry loop
Common cases
401 unauthorized: the key is missing or wrong. Check theAuthorization: Bearer <key>header.402 insufficientCredits: your balance is too low. Nothing was charged. Top up and try again.429 rateLimitedortooManyInFlight: you are over your rate limits. Wait, then retry.400 invalidRequest: the input is not valid. The message names the field. Check the endpoint’s input in the API reference.