Skip to main content
Every error has the same shape, and failed calls cost nothing.

Decide what to do

The full list of codes is in Errors.

A retry loop

Common cases

  • 401 unauthorized: the key is missing or wrong. Check the Authorization: Bearer <key> header.
  • 402 insufficientCredits: your balance is too low. Nothing was charged, and the error says how many credits the call needs and how many you have. Top up and try again.
  • 429 rateLimited or tooManyInFlight: you are over your rate limits. Wait, then retry.
  • 400 invalidRequest: the input is not valid. The message names the field, or repeats the source’s own complaint. Check the endpoint’s input in the API reference.
  • 404 notFound: the thing you asked for does not exist. The message is the source’s own, such as YouTube says: This video is unavailable. Don’t retry.

Timeouts

Every call answers or fails within 25 seconds. Set your client timeout a little above that, for example 30 seconds.