Reference

Errors

Every error is JSON with a stable code. Branch on the code, never on the message.

View as Markdown
429 Too Many Requestsjson
{
  "error": {
    "code": "rate_limited",
    "message": "More than 30 requests in a minute for this key.",
    "docs_url": "https://whet.design/docs/api/errors#rate_limited"
  },
  "request_id": "req_…"
}

Codes

StatuscodeRetryMeaning
401missing_api_keyNoNo Authorization: Bearer whet_sk_… header.
401invalid_api_keyNoThe key is malformed, unknown or revoked.
403insufficient_scopeNoThe key does not carry the scope this endpoint needs.
400invalid_requestNoA field is missing or invalid; the message names it.
415unsupported_media_typeNoThe body is not multipart/form-data or application/json.
415unsupported_imageNoThe image is not a PNG, JPEG or WebP Whet can read.
415unsupported_fileNoThe file is not a PDF, PNG, JPEG, WebP or SVG Whet can open.
413payload_too_largeNoThe file is larger than the endpoint allows (10 MB for images to identify, 50 MB for jobs).
404not_foundNoNo such object for this key's organisation.
401invalid_signatureNoThe X-Whet-Signature does not match the body, or the timestamp is more than 5 minutes off.
409automation_pausedNoThe automation is paused; resume it in the dashboard.
429rate_limitedYesToo many requests for this key right now; wait Retry-After seconds.
429daily_limit_exceededYesThe key's 24-hour quota is used up; Retry-After says when a slot frees.
504upstream_timeoutYesIdentification took longer than 60 s. Retry once; crop to the word if it repeats.
502upstream_errorYesWhet's identification service failed. Retry with backoff.
503service_unavailableYesWhet's identification service is not reachable. Retry with backoff.
500internal_errorYesSomething failed inside the API gateway. Retry with backoff.

Retrying

  • Retry only the codes marked Yes.
  • With Retry-After, wait that many seconds. Without it, back off exponentially: 2, 4, 8 seconds.
  • At most 3 tries. Then report the request_id.
  • upstream_timeout twice for the same word: crop tighter to the word, or pass its box.