GraphyApiError
All API errors are wrapped inGraphyApiError:
Retry Behavior
The SDK automatically retries failed requests based onretryConfig.
Default configuration:
| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 1000ms |
| 3 | 2000ms |
Retryable Conditions
| Condition | Retries |
|---|---|
| HTTP 5xx | Yes |
| HTTP 429 (rate limit) | Yes |
| Network failure | Yes |
| HTTP 4xx (except 429) | No |
| User abort | No |
GraphyApiError | No |
Custom Retry Configuration
Disable Retries
Error Codes
Errors from the API include acode field:
| Code | HTTP Status | Retryable | Description |
|---|---|---|---|
VALIDATION_ERROR | 400 | No | Invalid request body or parameters |
AUTHENTICATION_ERROR | 401 | No | Invalid or missing API key |
RATE_LIMIT_ERROR | 429 | Yes | Too many requests |
PROCESSING_ERROR | 500 | Yes | Internal processing failure |
TIMEOUT_ERROR | 504 | Yes | Request took too long |
Network Errors
Network failures throw aGraphyApiError with message "Network error":
Abort Errors
User cancellation throws a nativeAbortError:
Stream Errors
In streaming mode, errors can arrive as events:Timeout Errors
The SDK throwsAbortError when a request exceeds the configured timeout:

