API errors

What each API error means and what to do about it, from 400 to 504.

Every error comes with a status, a code and a message. The most common:

  • 400: something in the request isn't valid, like the messages or a parameter. The message says which. context_length_exceeded means the prompt leaves no room for an answer: shorten it.
  • 401 `unauthorized`: the key is missing or wrong. Check the Authorization: Bearer header.
  • 402 `insufficient_balance`: not enough credit for this request. Add credit or lower max_tokens.
  • 403 `key_scope`: an API key was used outside the API. Keys work only on /v1/.
  • 404 `model_not_found`: use the model thaura for chat.
  • 413 `file_too_large`: the request or file is too big.
  • 429: too many requests; wait as Retry-After says. See API limits.
  • 500, 503, 504: a problem on our side. Wait a moment and try again; 503 says when in Retry-After.

The full table is in the API documentation.

Still need help?

A real person reads every message. Contact us · info@thaura.ai