Error Codes

Complete reference of HTTP status codes, error response formats, and SDK exception mappings.

Error Response Format

All error responses follow a consistent JSON format:

{
  "error": {
    "message": "A human-readable description of what went wrong"
  }
}

HTTP Status Codes

CodeMeaningCommon CausesResolution
200OKRequest succeeded
204No ContentSuccessful delete operation
400Bad RequestInvalid UUID format, missing required fields, invalid player_gender value, malformed JSON bodyCheck the request body matches the expected schema. Verify UUID format for persona and machine IDs.
401UnauthorizedMissing or invalid JWT token, missing or invalid API key, invalid LLM API keyFor web API: check Authorization: Bearer header. For SDK: check X-API-Key and X-LLM-API-Key headers.
403ForbiddenAccessing another user's persona via SDK, accessing an unpublished persona, non-admin accessing admin endpointsEnsure you own the persona and it is published. Use personas.list() to see accessible personas.
404Not FoundPersona ID doesn't exist, session not found, machine ID doesn't existVerify the ID exists. For sessions, use get_session() to check before sending messages.
429Too Many RequestsRate limit exceededWait for the Retry-After header duration. SDKs auto-retry with exponential backoff.
500Internal Server ErrorUnexpected server error, LLM provider outage, database errorRetry the request. If persistent, check your LLM provider's status page. SDKs auto-retry on 5xx errors.
503Service UnavailableServer is temporarily overloaded or under maintenanceRetry after a short delay. SDKs handle this automatically.

SDK Exception Mapping

Each SDK maps HTTP status codes to typed exceptions:

HTTP CodePythonTypeScriptUnity (C#)
400BadRequestErrorBadRequestErrorBadRequestException
401AuthenticationErrorAuthenticationErrorAuthenticationException
403ForbiddenErrorForbiddenErrorForbiddenException
404NotFoundErrorNotFoundErrorNotFoundException
429RateLimitErrorRateLimitErrorRateLimitException
500+ServerErrorServerErrorServerException
💡Tip
All SDKs automatically retry on 429 and 5xx errors with jittered exponential backoff (up to 3 retries by default, configurable via max_retries). You only need to handle errors that persist after retries.

Rate Limits by Category

CategoryLimitScopeApplies To
Generation10 / minPer IPAI content creation (web editor)
Chat60 / minPer IPWeb chat message endpoints
General120 / minPer IPAll other web endpoints
SDK Chat30 / minPer API keySDK message + streaming endpoints
SDK General60 / minPer API keySDK init, history, reset, personas, machines