Developers

Error reference

One error shape for every endpoint. Learn it once, handle everything.

The normalized shape

Every API failure — no matter which tool — returns JSON in this shape, with an HTTP status that matches the problem:

error shape
{
  "ok": false,
  "provider": "yatools",
  "fallbackUsed": false,
  "error": {
    "code": "MISSING_URL",
    "message": "Human-readable explanation of what went wrong."
  }
}

provider names the backend that produced the error; fallbackUsed tells you whether a fallback was already tried before failing. On success the same envelope carries a data payload instead of error — see the API quickstart.

Error codes

CodeHTTPMeaning
RATE_LIMITED429Daily quota for this tool exceeded. Respect the Retry-After header and try again after the reset.
MISSING_URL / MISSING_QUERY / MISSING_TEXT400A required parameter is missing — url for websnap, q for search endpoints, text for tts/hand. The message names the problem.
BAD_JSON400A POST route received a body that isn't valid JSON.
BAD_PROMPT400The tti prompt is empty or longer than 500 characters. Shorten it and retry.
BAD_RATIO / BAD_RATE / BAD_PITCH / BAD_VOICE400An option value is outside its allowed range — e.g. an unsupported aspect ratio or an unknown voice index.
UNSAFE_URL400The URL failed SSRF validation (localhost, private IPs, metadata addresses). Use a public URL instead.
URL_TOO_LONG / QUERY_TOO_LONG400The input string exceeds the maximum allowed length.
FILE_TOO_LARGE400The upload exceeds the size cap (e.g. audio files must stay under 25 MB).
TRANSCRIBE_TIMEOUT502Transcription took too long — the audio file is likely too large. Split it into shorter parts and retry.
MISSING_FIELDS / MISSING_IMAGE400A POST route is missing required fields — e.g. certificate needs name, date, signature, details, templateId; vision chat needs an image and a question.
BAD_FIELD / BAD_IMAGE400A field failed validation — e.g. templateId outside 1–8, or an image that isn't a PNG/JPEG/WebP/GIF data URL.
TRANSCRIBE_DOWN / WIKIPDF_DOWN / N8N_UNAVAILABLE502The primary provider and its fallbacks all failed. Safe to retry once; if it persists, the provider is down.
CERT_UNAVAILABLE / IMGCHAT_DOWN502Certificate generation or AI vision has no free fallback — the upstream API itself is unreachable. Retry later.
ALLDL_DOWN / MAIL_DOWN502The downloader or temporary-mail upstream is unreachable (the mail service is intermittently degraded). Retry later; do not hammer the endpoint.

Binary routes return JSON errors

Endpoints that return files on success — screenshots, PDFs, audio, generated images — return application/json when they fail. Never assume a 200 means bytes and never assume bytes without checking:

  • Check the content-type response header before parsing.
  • If it contains application/json, parse the body as the normalized error shape above.
  • Only treat the body as a file when the content-type is the expected media type (e.g. image/png).
  • On success, X-Provider and X-Fallback-Used headers tell you which backend served the file.
Retry guidance: retry once on 502 errors with a short delay. Don't retry 400s (fix the request instead) and don't retry 429s until the Retry-After window passes — see rate limits.

Back to the API quickstart.