Skip to content

TTS Errors

All errors follow the following schema:

Name Type Optional Description
status string false The unique identifier of the error
message string false The description of the error
context object true The context of the error

Error Index

Status Schema
auth_invalid_api_key InvalidApiKeyError
auth_unauthorized UnauthorizedError
internal_server_error InternalServerError
job_cancellation_failure JobCancellationError
job_not_found JobNotFoundError
quota_empty OutOfQuotaError
quota_insufficient NotEnoughQuotaError
request_validation_error RequestValidationError
tts_model_not_found TtsModelNotFoundError
tts_request_no_text_data NoTextProvidedError
tts_request_not_waitable TtsNotWaitableError
tts_request_too_large TtsRequestTooLargeError

InvalidApiKeyError

status: auth_invalid_api_key

Header x-api-key is not a valid api-key.

Example

1
2
3
4
{
  "status": "auth_invalid_api_key",
  "message": "Invalid x-api-key"
}

JobCancellationError

status: job_cancellation_failure

Unable to cancel job because it is already in progress.

Example

1
2
3
4
5
6
7
{
  "status": "job_cancellation_failure",
  "message": "Unable to cancel job 2fec34e1efb146f7a7431cb35b64550d because it is already in progress",
  "context": {
    "job_id": "2fec34e1efb146f7a7431cb35b64550d"
  }
}

Context

Name Type Optional Description
job_id string false Identifier of the job

JobNotFoundError

status: job_not_found

Example

1
2
3
4
5
6
7
{
  "status": "job_not_found",
  "message": "Job 2fec34e1efb146f7a7431cb35b64550d not found",
  "context": {
    "job_id": "2fec34e1efb146f7a7431cb35b64550d"
  }
}

Context

Name Type Optional Description
job_id string false Identifier of the job

NoTextProvidedError

status: tts_request_no_text_data

No text provided for the speech synthesize request.

Example

1
2
3
4
{
  "status": "tts_request_no_text_data",
  "message": "No text provided for the speech synthesize request."
}

NotEnoughQuotaError

status: quota_insufficient

Example

1
2
3
4
5
6
7
8
{
  "status": "quota_insufficient",
  "message": "Insufficient quota. Current quota: {current} < {required}",
  "context": {
    "current": 0,
    "required": 0
  }
}

Context

Name Type Optional Description
current integer false The amount of quota you currently have
required integer false Required amount of quota for this operation

OutOfQuotaError

status: quota_empty

Example

1
2
3
4
{
  "status": "quota_empty",
  "message": "Out of quota"
}

TtsModelNotFoundError

status: tts_model_not_found

The specified TTS model is not found.

Example

1
2
3
4
5
6
7
{
  "status": "tts_model_not_found",
  "message": "TTS model 'tts-dimas-formal' not found",
  "context": {
    "model": "tts-dimas-formal"
  }
}

Context

Name Type Optional Description
model string false The name of the model

TtsNotWaitableError

status: tts_request_not_waitable

It is possible to wait for short speech synthesis requests to complete by setting config.wait to true. However, for long request this error is returned instead.

Example

1
2
3
4
5
6
7
8
{
  "status": "tts_request_not_waitable",
  "message": "Cannot wait for long request, 400 > 280",
  "context": {
    "request_length": 400,
    "request_threshold": 280
  }
}

Context

Name Type Optional Description
request_length integer false The length of the request
request_threshold integer false The threshold for short TTS request

TtsRequestTooLargeError

status: tts_request_too_large

The requested text is too large for a single request.

Example

1
2
3
4
5
6
7
8
{
  "status": "tts_request_too_large",
  "message": "The requested text is too large, 400 > 280",
  "context": {
    "length": 400,
    "max_length": 280
  }
}

Context

Name Type Optional Description
length integer false The length of the request
max_length integer false The maximum length for the request

UnauthorizedError

status: auth_unauthorized

The request was not authorized.

Example

1
2
3
4
{
  "status": "auth_unauthorized",
  "message": "Unauthorized"
}

RequestValidationError

status: request_validation_error

Returned when the request payload failed validation.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
  "status": "request_validation_error",
  "message": "Failed to validate request",
  "context": [
    {
      "location": [
        "body",
        "config",
        "model"
      ],
      "message": "field required",
      "status": "value_error.missing"
    }
  ]
}

Context

Name Type Optional Description
Context [object] true -
Parameter object true -
» location [string] false Location of the error
» message string false The description of the error
» status string false The type of validation error that occurred

InternalServerError

status: internal_server_error

An unexpected error occurred. Please contact our support at support@prosa.ai to help us improve our services.

Example

1
2
3
4
{
  "status": "internal_server_error",
  "message": "Internal Server Error"
}