Error envelope
Every Spatius API error returns the same JSON envelope, regardless of which endpoint failed:codeis a stable machine-readable string. Program againstcode, notmessage.messageis a human-readable explanation specific to this occurrence.requestIduniquely identifies the request. It is also returned in theX-Request-IDresponse header. Quote it when contacting support.
HTTP status and error code mapping
Job failure codes
When a creation job reachesfailed, the job’s error object carries one of these codes:
The
retryable flag on the error indicates whether resubmitting the same request may succeed.
Rate limits
Limits are enforced per account. Your account may be configured below these hard caps:
Read limits apply to the
GET endpoints; creation limits apply to POST /avatars. When a limit is hit, the API returns 429 with rate_limit_exceeded (or concurrency_limit_exceeded when the concurrency cap is the binding constraint). Back off and retry — for job polling, an interval of 5–10 seconds stays comfortably within the read limits.
Pagination
Both list endpoints (GET /avatars and GET /avatar-jobs) paginate the same way. They accept pagination.pageSize and pagination.pageToken, and return pagination.nextPageToken and pagination.totalCount.
pageSize defaults to 20 and has a maximum of 99.
To page through results, pass the previous response’s pagination.nextPageToken as pagination.pageToken. An empty nextPageToken means there are no more pages. Treat the token as opaque and pass back exactly what you received; do not construct or increment it yourself. An invalid page token is rejected with 400 and invalid_request.
Next steps
Overview
The asynchronous avatar creation flow, end to end.
Authentication
The X-App-ID and X-API-Key header pair.

