Speko Docs

Errors

The local API's error envelope and code set.

The envelope

Every local API error is:

{ "error": { "code": "session_not_found", "message": "..." } }

This is the local gateway envelope. The hosted relay uses a richer envelope with retryable and request_id — see relay errors. The two code sets are also different.

HTTP error codes

StatusCodeWhere
401local_auth_requiredany authenticated route without a valid bearer (response carries WWW-Authenticate: Bearer)
400idempotency_key_requiredPOST /v1/sessions without the header
400invalid_requestbody too large (64 KiB), unknown fields, invalid combinations
400unsupported_protocolWebSocket upgrade without the speko.voice.v0.r3 subprotocol
404session_not_foundstream attach or delete for an unknown session
409idempotency_key_conflictkey reused with a different body
409duplicate_sessionthe control plane returned an already-active session ID
409stream_already_attachedsecond WebSocket consumer
429local_concurrency_exhaustedat SPEKO_MAX_SESSIONS
500request_fingerprint_failedinternal idempotency hashing failure
502session_open_failedthe provider session could not be opened
502control_plane_unavailableplan fetch transport failure (managed mode)
503gateway_drainingthe process is shutting down
504control_plane_timeoutcontrol-plane deadline exceeded (managed mode)
passthroughcontrol_plane_rejectedthe control plane refused the plan; the original status is preserved

On control_plane_rejected, correlate with Speko support using the X-Control-Plane-Request-ID response header. The control plane's own codes (for example credit_exhausted, provider_not_entitled) are documented in Control plane API.

In-stream errors

Failures after a session is established arrive as the error event on the WebSocket, with retryable, terminal, and source fields.

On this page