HyperbotsHyperAPI/Docs
Reference

Error Codes

All errors return a JSON body with an error object and a standard HTTP status code.

HTTP status codes

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid X-API-Key header.
402PAYMENT_REQUIREDInsufficient credit balance to process this request.
413PAYLOAD_TOO_LARGEFile exceeds the 50 MB size limit.
422UNPROCESSABLE_ENTITYUnsupported file type or malformed request body.
429RATE_LIMITEDRate limit exceeded for this API key over a rolling 60-second window. Body includes `window_seconds`, `tier`, `limit`, and `degraded`; sleep `Retry-After` seconds before retrying. **When `degraded: true`** the rate limiter itself is temporarily unavailable — retry quickly (no need to wait the full window). When `degraded` is absent or false you actually exceeded your tier quota; sleep `Retry-After` and retry.
503SERVICE_UNAVAILABLEInference backend unavailable — circuit breaker is open.

Error response format

{
  "error": {
    "code": "PAYMENT_REQUIRED",
    "message": "Insufficient credit balance to process this request."
  }
}

Handling errors

from hyperapi import HyperAPIClient

client = HyperAPIClient(api_key="hk_live_your_key_here")

from hyperapi import AuthenticationError, ParseError

try:
    result = client.parse("invoice.pdf")
    print(result["result"]["ocr"])
except AuthenticationError:
    print("Invalid API key")
except ParseError as e:
    print(f"Parse failed: {e.message} (HTTP {e.status_code})")