API96Astro API

Errors

The error format, every error code, and what your code should do.

Errors use standard HTTP status codes and one JSON shape:

{
  "error": {
    "code": "invalid_request",
    "message": "Input should be less than or equal to 90",
    "field": "latitude",
    "request_id": "req_6e985a89a166b73ea220",
    "retryable": false
  }
}

Program against code, which is stable. message is for people and may change. field names the input at fault, or is null when no single field is.

StatusCodesWhat to do
400invalid_requestThe body is not valid JSON, the Idempotency-Key is too long, or the key was sent in the URL. Fix the request
401invalid_key, expired_keyCheck or rotate the key. Do not retry in a loop
402payment_requiredYour plan's payment is overdue past its grace period. Pay it in the dashboard; sandbox keys keep working
403account_suspendedThe account is not active. Contact support
404not_foundThere is no such capability, job or file, or it is not yours
409idempotency_conflictSee below
410link_expiredA PDF download link has expired. Poll the job for a fresh link
410file_expiredThe PDF is no longer kept. Create a new PDF job
413payload_too_largeReduce the request size
422invalid_request, ambiguous_local_time, unsupported_option, unsupported_languageFix the input. field names the problem
429rate_limitedWait for Retry-After seconds, then retry
429quota_exhaustedNo credits left, or a sandbox daily limit was reached. Top up, upgrade or wait for renewal. Retrying will not help
429spend_cap_reachedYour opt-in overage has reached the monthly spending cap you set (or this call would pass it). Raise the cap or buy a top-up in Billing, or wait for the next period. Retrying will not help
429project_budget_exceededThe key's project has used its monthly credit budget (or this call would pass it). An owner or admin can raise the budget under Projects; it resets on the 1st of the month (UTC). Retrying will not help
500computation_failedSafe to retry with the same idempotency key
501not_yet_availableThe capability is in the catalogue but not callable on /v1 yet
502 / 503unavailableRetry with exponential backoff and jitter
504deadline_exceededThe calculation took too long. Retry with backoff

You are never charged for an error. Failed calls do not use credits.

Idempotency conflicts

409 idempotency_conflict has several causes; the message says which:

  • the same Idempotency-Key was used with a different body: use a new key;
  • a request with that key is still in progress: retryable is true, so retry shortly with the same key;
  • the key is more than 24 hours old, or its original response is no longer kept: use a new key.

Retrying safely

Retry only when retryable is true. Use exponential backoff with jitter, and send an idempotency key on every request, so a retry after a network timeout can never charge twice.

On this page