Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kugelaudio.com/llms.txt

Use this file to discover all available pages before exploring further.

KugelAudio TTS endpoints return the same error shape for HTTP responses and WebSocket error frames.
{
  "error": "Rate limit exceeded",
  "error_code": "RATE_LIMITED",
  "code": 429
}
FieldTypeDescription
errorstringSafe client-facing message. Do not parse this field for program logic.
error_codestringStable machine-readable error category.
codeintegerHTTP-style status code for the error.
retry_after is not included in the JSON body. When retry timing is available for an HTTP response, use the Retry-After response header.

HTTP and WebSocket payloads

Status / payload codeerror_codeMessageMeaning
400VALIDATION_ERRORInvalid requestThe request payload or WebSocket message is malformed or invalid.
400VALIDATION_ERRORInvalid JSON bodyThe HTTP request body is not valid JSON.
400VALIDATION_ERRORtext requiredThe request is missing text to synthesize.
400VALIDATION_ERRORUnsupported audio formatUploaded reference audio uses an unsupported file format.
400VALIDATION_ERRORInvalid voice metadataVoice creation metadata could not be parsed or validated.
401UNAUTHORIZEDUnauthorizedThe API key is missing, invalid, or not accepted for this request.
402INSUFFICIENT_CREDITSInsufficient creditsThe organization does not have enough credits for the request.
403UNAUTHORIZEDForbiddenThe API key is valid, but it cannot access the requested resource.
404NOT_FOUNDVoice not foundThe requested voice does not exist or is not visible to the caller.
404NOT_FOUNDDictionary not foundThe requested dictionary does not exist or is not visible to the caller.
404NOT_FOUNDEntry not foundThe requested dictionary entry does not exist or is not visible to the caller.
404NOT_FOUNDProject not foundThe requested project does not exist or is not visible to the caller.
404NOT_FOUNDReference not foundThe requested voice reference does not exist or is not visible to the caller.
429RATE_LIMITEDRate limit exceededThe organization exceeded its rate limit.
429RATE_LIMITEDRequest exceeds the maximum character limitThe text is longer than the organization tier allows for one request.
500INTERNAL_ERRORAudio generation failedThe generation request failed before usable audio could be returned.
500INTERNAL_ERRORSample generation failedVoice sample generation failed.
500INTERNAL_ERRORFailed to fetch voiceVoice metadata could not be loaded.
503MODEL_UNAVAILABLEModel overloaded, please try again later.Cluster capacity is temporarily full. Retry later.
503MODEL_UNAVAILABLEThe requested model is temporarily unavailable. Please try again shortly.The selected model is temporarily unavailable.

WebSocket close codes

WebSocket error frames use the same JSON payload shape as HTTP errors. If the server closes the socket after sending an error, the WebSocket close code is separate from the JSON code.
WebSocket close codeRelated error_codeMeaning
4001UNAUTHORIZEDAuthentication failed.
4003INSUFFICIENT_CREDITSThe organization does not have enough credits.
4029RATE_LIMITEDThe organization exceeded its rate limit.
4500MODEL_UNAVAILABLEThe selected model is temporarily unavailable or overloaded.
4000INTERNAL_ERRORThe connection closed because of a generic generation failure.

Handling errors

Use error_code and code for application logic. Treat error as display text only.
if (message.error_code === "RATE_LIMITED") {
  // Back off and retry later.
}

if (message.error_code === "MODEL_UNAVAILABLE") {
  // The model or cluster is temporarily overloaded.
}