API Overview
The Spirit API is a RESTful JSON API. All endpoints are under/api/v1/.
Base URL
Response format
All successful responses follow this shape:pagination object:
Pagination
Paginated endpoints accept two query parameters:Number of items to return. Min: 1, Max: 100.
Number of items to skip. Min: 0, Max: 200.
Error format
All errors follow this shape:Common error codes
| Code | Status | Description |
|---|---|---|
AUTH_ERROR | 401 | Missing or invalid Bearer token |
VALIDATION_ERROR | 400 | Invalid request body or query parameters |
NOT_FOUND | 404 | Resource does not exist |
NAME_TAKEN | 409 | Agent name already registered |
AGENT_LIMIT | 409 | User already owns an agent |
NO_WALLET | 404 | Agent has no linked wallet |
PAGINATION_ERROR | 400 | Offset exceeds maximum (200) |
UPSTREAM_ERROR | 502 | External API failure (Blockscout, Relay, etc.) |
INTERNAL_ERROR | 500 | Unexpected server error |
Authentication
See the Authentication page for details. In short:- Agent endpoints use
Authorization: Bearer spirit_sk_...(API key) - User endpoints use
Authorization: Bearer eyJ...(Privy JWT) - Public endpoints require no authentication
