Skip to main content
Error responses are JSON, shaped like:
{ "error": { "message": "...", "type": "...", "code": "invalid_request" } }

HTTP status codes

StatusMeaningCommon cause
400Bad requestMissing / malformed parameters
401UnauthorizedMissing or wrong key
403ForbiddenKey revoked / no access to the model
404Not foundPath or model does not exist
429Rate limitedSee Rate Limits
5xxUpstream / gateway errorRetry or contact support

Business error codes

Possible values of the error.code field:
codeMeaningWhat to do
invalid_requestInvalid request parametersCheck params and body
bad_request_bodyMalformed request bodyVerify the JSON is valid
read_request_body_failedFailed to read request bodyCheck body and Content-Type
convert_request_failedRequest conversion failedEnsure params match the API format
sensitive_words_detectedSensitive content detectedAdjust the input
prompt_blockedPrompt was blockedAdjust the prompt
access_deniedAccess deniedCheck key, permissions, and group
model_not_foundModel not foundVerify model and your plan’s models
invalid_api_typeUnsupported API typeUse a supported API format
get_channel_failedNo available channelRetry later or contact support
channel:no_available_keyNo available channel keyRetry later or contact support
channel:invalid_keyInvalid channel keyContact support
channel:model_mapped_errorModel mapping errorContact support
channel:response_time_exceededUpstream timeoutRetry; shrink the request if needed
insufficient_user_quotaInsufficient quotaTop up or check your plan quota
pre_consume_token_quota_failedQuota pre-deduction failedCheck quota and retry
model_price_errorModel pricing errorContact support
count_token_failedToken counting failedCheck input and retry
do_request_failedUpstream request failedRetry
bad_responseBad upstream responseRetry or contact support
bad_response_status_codeBad upstream status codeRetry or contact support
empty_responseEmpty upstream responseRetry; raise timeout for streaming
read_response_body_failedFailed to read upstream responseRetry
json_marshal_failedSerialization failedRetry or contact support
query_data_errorData query errorRetry or contact support
update_data_errorData write errorRetry or contact support