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

StatusCodeDescription
400bad_requestInvalid request parameters
401invalid_api_keyMissing or invalid API key
402insufficient_creditsNot enough credits for this request. Top up your balance.
402key_budget_exhaustedMonthly budget of the key reached
403key_scope_deniedService not enabled for this key
403key_ip_deniedRequest from an address that is not allowed
403account_scope_deniedThis service or model is not enabled for your account. Contact support.
404model_not_foundThe model does not exist or your key may not use it.
404not_foundThe requested resource does not exist.
413payload_too_largeThe request is too large, for example an oversized image.
422content_blockedThe content was rejected. The code states the reason: content_blocked_safety, content_blocked_prohibited, content_blocked_copyright, content_blocked_personal_data or content_rejected.
429rate_limit_exceededRate limit exceeded. Wait briefly and retry the request.
500internal_errorInternal server error
503service_unavailableThe service is temporarily unavailable. Retry the request later.
504request_timeoutProcessing 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_paramsNeither h3_index nor lat and lon given.
invalid_h3The H3 index is invalid.
invalid_coordsCoordinates are missing or out of range (latitude −90 to 90, longitude −180 to 180).
upstream_unavailableNo weather data was available for this item right now. Retry the request later.