Skip to content
Documentation

Errors

Standard HTTP status codes. Every error body is JSON with the same shape: a top-level `error` object with `type` and `message`, plus optional extras (e.g. `balance_usd_micros` for 402). The legacy `detail` key is preserved for back-compat.

#Response shape

http
HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "type": "error",
  "error": {
    "type": "insufficient_credit",
    "message": "Pay-per-token balance depleted.",
    "balance_usd_micros": 0,
    "topup_url": "/tenant/billing/topup"
  },
  "detail": { "error": "insufficient_credit", "balance_usd_micros": 0, "topup_url": "/tenant/billing/topup" }
}

#Meaning

CodeError typeMeaning
400invalid_jsonRequest body was not valid JSON.
400invalid_requestSchema validation failed — missing required field, wrong type, or unknown field.
401unauthorizedMissing, malformed, or revoked API key.
402insufficient_creditPay-per-token balance is zero. Body includes `balance_usd_micros` and `topup_url`.
402no_subscriptionSubscription-mode key without an active plan. Subscribe in the panel to unlock.
403wrong_metering_modePay-per-token-only route hit with a subscription key. Mint a pay_per_token key or use a tool-tuned route.
429quota_exceededSubscription 24h window exhausted. Reset time in `x-powapi-quota-reset-at` (unix seconds).
500internal_errorUnexpected server-side failure. Retry with backoff; if persistent, check status.powapi.io.
502upstream_errorAll routing candidates failed. Retry within 30s — the cascade reshuffles after that.