Errors

Explore error messages and solutions.

API errors

ElevenLabs uses standard HTTP status codes to indicate the success or failure of a request. Additionally, all API requests return a JSON object with a detail property that contains information about the error.

In general, a 200 HTTP status code indicates a successful request. A 4xx code indicates a problem with the request, like an invalid parameter or missing required field. A 500 HTTP status code indicates a problem with ElevenLabs’ servers, which should be rare.

Error properties

PropertyDescription
typeThe type of error that occurred. See the table below for possible values.
codeThe code of the error. These are more specific than the type, and can be used to determine the cause of the error.
messageThe message of the error. This provides more details about the error.
statusThe status of the error. This is a legacy field that is no longer used, instead use the code property.
request_idThe request ID of the error. This is a unique identifier for the request that can be used to troubleshoot the error.
paramThe parameter that caused the error. In the case of a validation error, this will indicate the parameter that is invalid.

Example error response

Here’s the response for an API request that used an incorrect model ID:

1{
2 "detail": {
3 "type": "validation_error",
4 "code": "invalid_parameters",
5 "message": "The 'keyterms' parameter is only supported with the 'scribe_v2' model. You specified 'scribe_v1'.",
6 "status": "invalid_parameters",
7 "request_id": "3c807fc4c3a1705f9638ecc764a91c01",
8 "param": "keyterms"
9 }
10}

Using the error properties, we can see that the error is a validation error, and the code is invalid_parameters. The message provides more details about the error, and the request_id is a unique identifier for the request that can be used to troubleshoot the error. The param property indicates the parameter that caused the error.

SDK error handling

The ElevenLabs SDKs provide typed error classes that give you access to the error details.

1from elevenlabs import ElevenLabs, ApiError
2
3elevenlabs = ElevenLabs()
4
5try:
6 audio = elevenlabs.text_to_speech.convert(
7 voice_id="invalid-voice-id",
8 model_id="eleven_v3",
9 text="Hello, world!",
10 )
11except ApiError as e:
12 print(f"Status code: {e.status_code}")
13
14 # Access the error body
15 if e.body and "detail" in e.body:
16 detail = e.body["detail"]
17 print(f"Error type: {detail.get('type')}")
18 print(f"Error code: {detail.get('code')}")
19 print(f"Message: {detail.get('message')}")
20 print(f"Request ID: {detail.get('request_id')}")
21
22 # Handle specific error types
23 if detail.get("type") == "rate_limit_error":
24 print("Rate limited - implement exponential backoff")
25 elif detail.get("type") == "authentication_error":
26 print("Check your API key")

Rate limiting and concurrency

If you receive a 429 HTTP status code, it means you have either made too many requests in a short period of time and exceeded the rate limit for the API endpoint, or you have exceeded the concurrency limit for the API endpoint. The error code will be rate_limit_exceeded or concurrent_limit_exceeded respectively.

In the case of rate limiting, you should implement exponential backoff in your code when a 429 error is received. This means adding a delay before retrying the request.

In the case of concurrency, you should wait for the current requests to complete before making new ones. See the Concurrency and priority section for more information.

Error types

An error comes with a type property that indicates the type of error that occurred. See the table below for possible values.

TypeDescriptionHTTP Status Code
validation_errorThe request contains invalid parameter values.400
invalid_requestThe request structure is malformed or missing required fields.400
authentication_errorAuthentication failed - invalid or missing API key/token.401
payment_requiredUser has insufficient credits or payment is required.402
authorization_errorThe authenticated user doesn’t have the required permissions for this action.403
not_foundThe requested resource was not found.404
conflictThe request conflicts with the current state of the resource.409
rate_limit_errorToo many requests - try again later.429
internal_errorAn unexpected server error occurred.500
service_unavailableThe service is temporarily unavailable, this should be a rare occurrence.503

Error codes

CodeTypeDescription
voice_not_foundnot_foundThe specified voice ID does not exist. Verify the voice ID and try again.
sample_not_foundnot_foundThe specified voice sample was not found.
voice_collection_not_foundnot_foundThe specified voice collection does not exist.
user_not_foundnot_foundThe specified user was not found.
auth_account_not_foundnot_foundThe authentication account was not found.
workspace_not_foundnot_foundThe specified workspace does not exist.
project_not_foundnot_foundThe specified project was not found.
history_item_not_foundnot_foundThe specified history item does not exist.
collection_not_foundnot_foundThe specified collection was not found.
document_not_foundnot_foundThe specified document does not exist.
file_not_foundnot_foundThe specified file was not found.
conversation_not_foundnot_foundThe specified conversation does not exist.
agent_not_foundnot_foundThe specified agent was not found.
dubbing_not_foundnot_foundThe specified dubbing project does not exist.
song_not_foundnot_foundThe specified song was not found.
read_not_foundnot_foundThe specified read was not found.
pronunciation_dictionary_not_foundnot_foundThe specified pronunciation dictionary does not exist.
knowledge_base_not_foundnot_foundThe specified knowledge base was not found.
phone_number_not_foundnot_foundThe specified phone number does not exist.
tool_not_foundnot_foundThe specified tool was not found.
snapshot_not_foundnot_foundThe specified snapshot does not exist.
task_not_foundnot_foundThe specified task was not found.
model_not_foundnot_foundThe specified model does not exist.
transcript_not_foundnot_foundThe specified transcript was not found.
keywords_list_not_foundnot_foundThe specified keywords list was not found.
category_not_foundnot_foundThe specified category was not found.
text_too_longvalidation_errorThe provided text exceeds the maximum allowed length.
text_too_shortvalidation_errorThe provided text is shorter than the minimum required length.
invalid_textvalidation_errorThe provided text contains invalid characters or formatting.
empty_textvalidation_errorThe text field cannot be empty.
invalid_parametersvalidation_error

One or more request parameters are invalid. Check the param property for the invalid parameter.

missing_required_fieldvalidation_error

A required field is missing from the request. Check the param property for the missing field.

invalid_voice_settingsvalidation_error

The voice settings contain invalid values. Check the param property for the invalid voice settings.

invalid_voice_idvalidation_errorThe voice ID format is invalid.
unsupported_modelvalidation_errorThe specified model is not supported for this operation.
invalid_audiovalidation_errorThe provided audio is invalid or corrupted.
invalid_audio_formatvalidation_errorThe specified audio format is not supported.
invalid_output_formatvalidation_errorThe requested output format is not supported.
audio_too_longvalidation_errorThe audio exceeds the maximum allowed duration.
audio_too_shortvalidation_errorThe audio is shorter than the minimum required duration.
invalid_file_typevalidation_errorThe file type is not supported.
invalid_page_sizevalidation_errorThe page size parameter is outside the allowed range.
invalid_cursorvalidation_errorThe pagination cursor is invalid or expired.
bad_requestinvalid_requestThe request could not be understood by the server.
malformed_jsoninvalid_requestThe request body contains invalid JSON.
invalid_content_typeinvalid_requestThe Content-Type header is missing or invalid.
request_too_largeinvalid_requestThe request body exceeds the maximum allowed size.
invalid_api_keyauthentication_errorThe provided API key is invalid.
missing_api_keyauthentication_errorNo API key was provided in the request.
invalid_authorization_headerauthentication_errorThe Authorization header format is invalid.
unauthorizedauthentication_errorAuthentication is required to access this resource.
sign_in_requiredauthentication_errorYou must be signed in to perform this action.
forbiddenauthorization_errorAccess to this resource is forbidden.
insufficient_permissionsauthorization_errorYou do not have the required permissions for this action.
workspace_access_deniedauthorization_errorYou do not have access to this workspace.
feature_not_availableauthorization_errorThis feature is not available on your current plan.
subscription_requiredauthorization_errorA paid subscription is required to access this feature.
voice_access_deniedauthorization_errorYou do not have access to this voice.
model_access_deniedauthorization_errorYou do not have access to this model.
conflictconflictA conflict occurred.
resource_already_existsconflictA resource with the same identifier already exists.
voice_already_existsconflictA voice with this name already exists.
already_runningconflictThe operation is already running.
already_processingconflictThe resource is already being processed.
concurrent_modificationconflictThe resource was modified by another request. Retry with the latest version.
slug_already_existsconflictA resource with this slug already exists.
rate_limit_exceededrate_limit_errorToo many requests. Wait before retrying.
concurrent_limit_exceededrate_limit_error

Maximum number of concurrent requests exceeded. Higher subscription tiers have a higher concurrency limit.

system_busyrate_limit_errorThe system is currently busy. Try again later.
insufficient_creditspayment_requiredYour account does not have enough credits for this operation.
internal_errorinternal_errorAn unexpected error occurred. Contact support if this persists.
service_unavailableservice_unavailableThe service is temporarily unavailable. Try again later.
maintenanceservice_unavailableThe service is undergoing scheduled maintenance.