Skip to content
Try chatGet API key

Errors

Every error, on every endpoint, uses the same envelope:

{
"error": {
"message": "Your Bayle API key is missing or could not be verified.",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key"
}
}

All four fields are always present. param and code may be null.

Field Meaning
message Human-readable, and localized. See Response language.
type OpenAI’s error type vocabulary, so an SDK’s exception mapping keeps working.
param The request field at fault, when the failure names one. Null otherwise.
code Bayle’s specific error code. Null when the failure could not be identified.

message is prose and it is translated, so matching on it breaks the first time someone sends Accept-Language: pt-BR. code is stable and machine-readable.

A null code means Bayle could not identify the specific failure. The envelope is still valid and type is still meaningful, so treat null as “something went wrong that isn’t in the list below” rather than as an error in itself.

Type Usually means
invalid_request_error The request is malformed or a field is unacceptable. Fix and retry.
authentication_error The credential is missing or invalid.
permission_error The credential is valid but not authorized for this.
not_found_error The named model, job, or resource does not exist.
insufficient_quota No balance, or a spending limit reached.
rate_limit_error Too many requests, or the model is overloaded. Back off and retry.
api_error A failure on our side. Retrying is reasonable.
Status Meaning
400 Invalid request.
401 Missing or invalid credential. Nothing is charged.
403 Not authorized for this action or model.
404 Model, job, or media not found.
409 Video consent required. See the video guide. Nothing is charged.
413 The request, or the response, exceeded a size ceiling.
429 Rate limited, or the model is overloaded.
500 A failure on our side.
502 We could not reach the generation backend. Retrying is reasonable.
504 The request itself took too long to complete and was timed out. See Retrying — an unmodified retry is likely to hit the same limit again.

40 codes. param is shown where the failure names a specific request field.

CodeTypeParamMessage
api_access_disabledpermission_errorAPI access has been disabled for this Bayle account.
audio_transcription_failedapi_errorBayle could not complete this audio transcription due to a temporary error. Please retry.
audio_validation_failedinvalid_request_errorBayle could not process this audio for transcription. Please check the file and try again.
character_not_foundnot_found_errorcharacter_slugBayle could not find a character matching the provided identifier.
content_policy_violationinvalid_request_errorBayle's content policy does not permit this prompt.
context_length_exceededinvalid_request_errormessagesThis request exceeds the model's maximum context length supported by Bayle.
corrupted_imageinvalid_request_errorBayle could not read the image file because it is corrupted.
image_edit_failedapi_errorBayle could not complete this image edit.
image_too_largeinvalid_request_errorThis image's dimensions exceed the maximum Bayle allows.
image_too_smallinvalid_request_errorThe image provided to Bayle is smaller than the minimum allowed dimensions.
inference_failedapi_errorBayle could not complete inference for this request.
insufficient_quotainsufficient_quotaYour Bayle account does not have enough balance to complete this request.
invalid_api_keyauthentication_errorYour Bayle API key is invalid.
invalid_audio_formatinvalid_request_errorBayle does not support the audio format provided.
invalid_content_typeinvalid_request_errorBayle does not support the content type of this request.
invalid_modelinvalid_request_errormodelThe model specified in this Bayle request is invalid.
invalid_requestinvalid_request_errorBayle could not process this request because one or more parameters are invalid.
invalid_signatureauthentication_errorThe sign-in signature provided to Bayle is invalid.
invalid_video_formatinvalid_request_errorBayle does not support the video format provided.
media_not_foundnot_found_errorBayle could not find the requested media. It may be invalid, expired, or deleted.
model_at_capacityapi_errorThis model is at capacity on Bayle. Please try again shortly.
model_not_foundnot_found_errormodelBayle could not find the specified model.
model_offlineapi_errorThis model is temporarily offline on Bayle. Please try again shortly.
model_overloadedrate_limit_errorThis model is temporarily overloaded on Bayle. Please try again shortly.
model_requires_upgradepermission_errormodelThis model requires a Bayle Pro subscription.
payload_too_largeinvalid_request_errorThis request body is too large for Bayle to accept. Please reduce its size.
permission_deniedpermission_errorYour Bayle credentials do not authorize this action.
rate_limit_exceededrate_limit_errorYou have exceeded the rate limit for Bayle's API.
request_id_not_foundinvalid_request_errorrequest_idBayle could not find a request matching the given request ID.
request_timeoutapi_errorThis request took too long to complete on Bayle and was timed out. For long-running requests, use streaming.
secondary_spend_limit_exceededinsufficient_quotaThis Bayle API key has reached its configured spending limit for this balance type.
subscription_inactiveauthentication_errorYour Bayle Pro subscription is inactive.
tee_attestation_failedapi_errorBayle could not complete a required secure-environment attestation for this request.
tee_signature_failedapi_errorBayle could not complete a required secure-environment signature for this request.
unknown_errorapi_errorBayle encountered an unknown error while processing this request.
upscale_failedapi_errorBayle could not upscale this image.
usd_spend_limit_exceededinsufficient_quotaThis Bayle API key has reached its configured USD spending limit.
video_duration_too_longinvalid_request_errorThis video's duration exceeds the maximum Bayle allows.
video_duration_too_shortinvalid_request_errorThis video's duration is shorter than the minimum Bayle allows.
wallet_mismatchpermission_errorThis Bayle request references a wallet that does not belong to this account.

Retry 429, 500, and 502. Use exponential backoff with jitter, and give up after a few attempts rather than hammering.

504 is different: it means the request itself took longer than the endpoint’s own time limit, so resending the exact same request is likely to hit that limit again. Only retry it after changing something that affects how long the request takes — a shorter prompt, a different model, or a smaller output — rather than resending it unmodified.

Do not retry 400, 401, 403, 404, or 413. Nothing about the request will have changed, so the answer will not either. 409 is a special case: it is not a retry so much as a resubmission with a consent object added, described in the video guide.

A streaming chat completion commits its 200 before generation finishes, so a later failure cannot change the status. It arrives as an event inside the stream instead, carrying this same envelope. See Streaming.