Error Handling
note
Websockets API is only available for Business plan users. If you're running into trouble, upgrade to a Business plan or higher on the billing page.
Unrecoverable Errors
Errors occurring during the connection handshake, leading to connection failure:
{
"type": "error",
"success": false,
"error_name": "ConnectionFailure",
"message": "Failed to establish a connection.",
"status_code": 401 // Example status code
}
Recoverable Errors
Errors related to synthesis requests that do not interrupt the ongoing connection:
{
"type": "error",
"success": false,
"error_name": "BadJSON",
"error_params": {"explanation": "Provide your query to synthesize as text or SSML in the 'data' field"},
"message": "Invalid JSON: Provide your query to synthesize as text or SSML in the 'data' field",
"status_code": 400
}