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
statusCodefield 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 sendmax_tokensinstead ofmaxTokens, 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:
| Layer | Limit | Scope |
|---|---|---|
| Per-key | your key's rateLimitRpm per minute | each API key |
| Per-IP | 30 req/s · 600 req/min · 10,000 req/h | every 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
| Status | Meaning |
|---|---|
400 | Validation error, unknown property, or malformed input |
401 | Missing/invalid API key or signature |
402 | Insufficient credits for the estimated call cost |
403 | Key lacks the required scope, or org suspended |
404 | Unknown resource (event, provider, model) |
409 | Reused Idempotency-Key |
429 | Rate limited — check Retry-After |
502 / 504 | Upstream provider error / timeout (gateway calls) |
503 | Provider registered but not configured server-side |
Size limits
- JSON bodies: 1 MB
- Agent uploads (
application/octet-stream): 2 MB