Error Handling
The API uses standard HTTP status codes. Errors are returned as JSON with a type, a code and a description.
Error Response Format
{
"error": {
"message": "Insufficient credits. Please top up your balance.",
"type": "insufficient_credits_error",
"code": "insufficient_credits"
}
}Evaluate the code, not the message: the code is stable, the wording of the message may change. For key_budget_exhausted the response also contains resets_at and the Retry-After header.
Error Codes
| Status | Code | Description |
|---|---|---|
400 | bad_request | Invalid request parameters |
401 | invalid_api_key | Missing or invalid API key |
402 | insufficient_credits | Not enough credits for this request. Top up your balance. |
402 | key_budget_exhausted | Monthly budget of the key reached |
403 | key_scope_denied | Service not enabled for this key |
403 | key_ip_denied | Request from an address that is not allowed |
403 | account_scope_denied | This service or model is not enabled for your account. Contact support. |
404 | model_not_found | The model does not exist or your key may not use it. |
404 | not_found | The requested resource does not exist. |
413 | payload_too_large | The request is too large, for example an oversized image. |
422 | content_blocked | The content was rejected. The code states the reason: content_blocked_safety, content_blocked_prohibited, content_blocked_copyright, content_blocked_personal_data or content_rejected. |
429 | rate_limit_exceeded | Rate limit exceeded. Wait briefly and retry the request. |
500 | internal_error | Internal server error |
503 | service_unavailable | The service is temporarily unavailable. Retry the request later. |
504 | request_timeout | Processing took too long. Retry the request or make it smaller. |
Per-item errors in an Avirach batch
A batch answers with 200 even when single items fail. Failed items carry status "error" and their own code; only successful items are billed.
missing_params | Neither h3_index nor lat and lon given. |
invalid_h3 | The H3 index is invalid. |
invalid_coords | Coordinates are missing or out of range (latitude −90 to 90, longitude −180 to 180). |
upstream_unavailable | No weather data was available for this item right now. Retry the request later. |