Guides
.md ↗

Rate limits & errors

Rate-limit headers, error responses, and request limits.

Rate limits

Rate limits apply to generation endpoints. Check your current values in GET /v1/info under limits, or contact hello@kalpalabs.ai for a higher limit.

HeaderMeaning
X-RateLimit-LimitRequests allowed per minute
X-RateLimit-RemainingRequests currently available
X-RateLimit-ResetSeconds until the limit resets

When you reach the limit, the API returns 429 with Retry-After:

json
{ "error": { "type": "rate_limit_exceeded", "message": "Rate limit exceeded (600 requests/min). Retry in 2s.", "request_id": "…" } }

Wait for Retry-After before retrying.

The error envelope

REST errors use one response shape:

json
{ "error": { "type": "…", "message": "…", "request_id": "…" } }

Validation errors may also include error.details. SSE and WebSocket streams send errors as protocol events after streaming begins.

StatustypeMeaning
400invalid_requestInvalid request, audio, model, or conversation.
400context_length_exceededGeneration filled the model's context window before a stop token. Try shorter sentences.
401authentication_errorMissing or invalid API key.
404not_foundPath or voice not found.
405method_not_allowedHTTP method not supported.
422invalid_requestRequest body does not match the schema.
429rate_limit_exceededRate limit reached.
500internal_errorUnexpected server error.
502inference_errorModel backend error or timeout.
503service_unavailableAPI-key verification is temporarily unavailable.

Request caps

Current request limits are also available from GET /v1/info:

LimitCurrent value
Text per request or turn8,000 characters
Turns per REST/SSE conversation64
Audio per turn25 MiB decoded WAV

Debugging a failed call

Use error.type in application logic and message for display. For persistent failures, share the request_id with support; it also appears in the X-Request-ID response header.