For backend integrations, use your server SDK’s structured error fields as the source of truth. Server-side integrations should account for session token failures, WebSocket handshake failures, runtime server errors, and unexpected connection closures.Documentation Index
Fetch the complete documentation index at: https://docs.spatius.ai/llms.txt
Use this file to discover all available pages before exploring further.
Common Server SDK Error Codes
These stable error codes are useful when building retry, logging, and alerting flows on your backend.| Error code | Meaning |
|---|---|
sessionTokenExpired | Session token expired or is no longer authorized |
sessionTokenInvalid | Session token is invalid or empty |
appIDUnrecognized | App ID is not recognized by the server |
appIDMismatch | Session token belongs to a different app |
avatarNotFound | Requested avatar does not exist |
billingRequired | Session is blocked by billing requirements |
creditsExhausted | Runtime or connect-time credits are exhausted |
sessionDurationExceeded | Session hit a billing-enforced duration limit |
unsupportedSampleRate | Audio sample rate is not accepted by the handshake |
invalidEgressConfig | LiveKit egress configuration is invalid |
egressUnavailable | Egress service is unavailable or not configured |
idleTimeout | Session was closed because no input was received |
upstreamError | Upstream internal service failed |
protocolError | Invalid protobuf payload or unexpected message sequence |
connectionFailed | Transport-level connection setup failed |
connectionClosed | WebSocket closed unexpectedly |
serverError | Server returned an unclassified error |
invalidRequest | Client request payload or parameters are invalid |
unknown | Fallback code when the SDK cannot classify the failure |
Server SDK Error Fields
When handling server SDK errors, check these fields to determine the correct recovery path:code: stable SDK error code for programmatic handlingphase: where the failure happened, such assession_token,websocket_connect, orwebsocket_runtimehttp_status: HTTP status for token or upgrade failuresserver_code,server_title,server_detail: normalized details returned by the serverconnection_id,req_id: correlation IDs for tracing requests in logsclose_code,close_reason: WebSocket close details for unexpected disconnects
Recommended Handling Flow
- Log
code,phase, and correlation IDs (connection_id,req_id). - Retry only transient failures (for example
connectionClosed,connectionFailed,idleTimeout). - Surface configuration/auth failures (
sessionTokenInvalid,appIDMismatch) to operators. - Alert on recurring
upstreamError,serverError, orprotocolError.

