AlmanacDocs

Errors & rate limits

Error envelopes, validation behavior, throttling tiers, and the headers that explain them.

Error envelope

Most errors return the standard envelope:

{
	"statusCode": 401,
	"message": "invalid api key",
	"error": "Unauthorized",
	"requestId": "9f2c1e0a-…"
}

Two variations to handle:

  • Validation failures put an array of messages in message:

    {
    	"statusCode": 400,
    	"message": ["provider must be a string", "messages must contain at least 1 elements"],
    	"error": "Bad Request",
    	"requestId": "…"
    }
  • Domain errors from some endpoints use a compact shape with a machine-readable code and no statusCode field in the body (the HTTP status still applies):

    { "error": "miner_not_registered_to_org", "requestId": "…" }

Robust clients should key off the HTTP status first, then inspect message/error.

requestId is always present and matches the X-Request-Id response header — include it in support requests.

Strict validation

Request bodies are validated strictly:

  • Unknown properties are rejected with 400 (not silently dropped). If you send max_tokens instead of maxTokens, you get a validation error rather than an ignored parameter — a deliberate guard against silent misconfiguration.
  • Values are coerced where unambiguous (e.g. numeric strings in query params).

Rate limits

Two independent layers apply:

LayerLimitScope
Per-keyyour key's rateLimitRpm per minuteeach API key
Per-IP30 req/s · 600 req/min · 10,000 req/hevery caller, including public endpoints

On authenticated requests, X-RateLimit-Limit and X-RateLimit-Remaining report the per-key window. A 429 includes Retry-After (seconds until the window resets).

For validators: a 429 on a signed request refunds the nonce, so the identical signed request can be safely retried after Retry-After — see validator auth.

Common statuses

StatusMeaning
400Validation error, unknown property, or malformed input
401Missing/invalid API key or signature
402Insufficient credits for the estimated call cost
403Key lacks the required scope, or org suspended
404Unknown resource (event, provider, model)
409Reused Idempotency-Key
429Rate limited — check Retry-After
502 / 504Upstream provider error / timeout (gateway calls)
503Provider registered but not configured server-side

Size limits

  • JSON bodies: 1 MB
  • Agent uploads (application/octet-stream): 2 MB

On this page