Resources

Errors

OpenAI-shaped routes return the OpenAI error envelope. ElevenLabs-shaped routes return the ElevenLabs one. Stable codes, named parameters.

Last reviewed 2026-08-25

OpenAI envelope

{
  "error": {
    "message": "'model' is required.",
    "type": "invalid_request_error",
    "param": "model",
    "code": "missing_required_parameter"
  }
}

Prop

Type

ElevenLabs envelope

ElevenLabs-shaped routes (/elevenlabs/v1/text-to-speech, /elevenlabs/v1/voices, /elevenlabs/v1/speech-to-text, /elevenlabs/v1/speech-to-speech, /elevenlabs/v1/history) return the ElevenLabs detail shape with 422 for validation errors, as the elevenlabs SDK expects.

{ "detail": { "status": "unsupported_parameter", "message": "diarize and num_speakers are not supported yet" } }

Codes

StatuscodeMeaningRecovery
400unsupported_parameterThe field is not supported on this route.Remove the field named in param. See Compatibility.
400missing_required_parameterA required field is absent.Add the field named in param.
400invalid_valueA value is outside the allowed set, for example response_format or endpoint.Use a listed value.
401invalid_api_keyMissing, wrong, or revoked key.Check the header.
402insufficient_balanceAccount balance is zero.Add credits.
402key_spend_limit_reachedThis key hit its period ceiling.Raise the limit or use another key.
404model_not_foundUnknown model id.Use a model id from Pricing.
404voice_not_foundUnknown voice id. Never a default voice.Use a listed voice or alias.
429rate_limit_exceededPer-key RPM or concurrency.Wait Retry-After.
502upstream_errorThe model did not answer. Nothing billed.Retry with backoff.
503model_bootingThe model is starting.Wait Retry-After.
503no_capacityNo capacity for the model right now.Retry with backoff.

Model errors

Errors raised by the model come back in the same envelope with the same status code. An out-of-range temperature arrives as a 400 with param set to temperature.

Handling errors in the SDK

import openai

try:
    client.chat.completions.create(model="qwen3.8-27b", messages=msgs, audio={"voice": "alloy"})
except openai.BadRequestError as e:
    print(e.body["code"], e.body["param"])  # unsupported_parameter audio
except openai.RateLimitError as e:
    retry_after = int(e.response.headers.get("retry-after", "5"))
except openai.APIStatusError as e:
    if e.status_code == 402:
        print("add credits")

On this page

Share feedback