Error Handling
All errors return JSON with consistent structure and appropriate HTTP status codes.Error Response Format
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid API key |
| 404 | Not Found - Resource doesn’t exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
Common Error Codes
Quote Errors
| Code | Description |
|---|---|
INVALID_ASSET | Unsupported asset symbol |
AMOUNT_TOO_SMALL | Below minimum amount |
INSUFFICIENT_LIQUIDITY | Not enough liquidity |
Transaction Errors
| Code | Description |
|---|---|
INVALID_QUOTE | Quote expired or not found |
INVALID_SIGNATURE | Malformed signed transaction |
INSUFFICIENT_BALANCE | Not enough tokens |
ROUTING_UNAVAILABLE | Private mode unavailable |
Authentication Errors
| Code | Description |
|---|---|
INVALID_API_KEY | API key is invalid |
EXPIRED_API_KEY | API key has expired |
RATE_LIMIT_EXCEEDED | Too many requests |