Errors

Every error response is JSON, every error has a stable error.code, and every code maps to one HTTP status. Branch on error.code in your code; treat error.message as human text only.

Last updated: April 25, 2026 Reading time: 5 min

Error response shape

{
  "error": {
    "code": "invalid_token",
    "message": "Unknown or revoked key",
    "hint": "Check Profile → API & Billing for active keys."
  }
}

HTTP status codes

StatusMeaning
200Success.
400Bad request — malformed query / missing required parameter.
401Authentication failed — missing, malformed, unknown or revoked key.
402Subscription inactive — payment failed or you cancelled and the period ended.
403Forbidden — you're authenticated but your tier doesn't allow this action.
404Not found — model/bench slug doesn't exist or is hidden.
422Unprocessable — semantically wrong, e.g. trying to create a 4th key on Pro tier.
429Rate-limited or quota exceeded.
500Internal server error. We're alerted; retry with exponential backoff.
503Maintenance window. Always accompanied by Retry-After.

error.code reference

Auth errors (401 / 402)

CodeWhen
missing_tokenNo Authorization header.
invalid_token_formatToken doesn't start with sb_live_ or has wrong length.
invalid_tokenToken doesn't match any key in our database.
revokedKey was explicitly revoked from the dashboard.
subscription_inactiveSubscription state is past_due, canceled or unpaid. Update your card via Stripe Customer Portal.

Client errors (400 / 404 / 422)

CodeWhen
bad_requestMalformed query string or missing required parameter (the message says which).
invalid_paramParameter present but value is invalid (e.g. limit=99999).
not_foundNo row matches the slug/id you requested.
max_keys_reachedYou've hit your tier's active-key cap. Revoke or upgrade.

Limit / forbidden (403 / 429)

CodeWhen
tier_forbiddenEndpoint not available on your tier (e.g. bulk export on Starter).
rate_limitedMore requests in the current calendar minute (UTC) than your per-minute ceiling.
quota_exceededMonthly quota for this key reached.

Server errors (500 / 503)

CodeWhen
internalSomething blew up on our side. We're alerted automatically. Retry with backoff.
maintenancePlanned maintenance window. Retry-After tells you when to come back.

Stability promise

Always switch on the code. Never regex the message.