Error response reference (documentation only)

This path is for documentation only. All AI Gateway endpoints may return the error responses described in the components below.

HTTP status and Gateway code mapping

StatusCode (Gateway format)Meaning
400BAD_REQUESTMissing required fields (e.g. model, messages) or invalid request syntax
401UNAUTHORIZEDMissing, invalid, or expired authentication token
402INSUFFICIENT_CREDITSNot enough credits to perform the request
403FORBIDDENAuthenticated but not allowed (e.g. team not allowed to access model)
422VALIDATIONInvalid values (e.g. max_tokens < 0); check errors[] for field-level details
429RATE_LIMIT_EXCEEDEDToo many requests; retry after some time
500INTERNAL_SERVER_ERRORServer or upstream error; use request_id when contacting support
Language
Response
Click Try It! to start a request and see the response here!