API reference

Errors

Status codes and error format.

Errors use the OpenAI error shape:

error body
{
  "error": {
    "message": "Invalid or revoked API key",
    "type": "authentication_error",
    "code": 401
  }
}

Status codes#

CodetypeWhen
400invalid_request_errorBody is not valid JSON, model is missing, or the model id is unknown.
401authentication_errorMissing, malformed, invalid or revoked API key.
402insufficient_energyPaid model: not enough Energy in your vault. Free model: you hold less than 5,000 ENERGY.
404not_found_errorThe resource does not exist.
429rate_limit_errorMore than 60 requests per minute on this key.
503unavailable_errorThe model is temporarily unavailable. Retry shortly.
500api_errorUnexpected server error.

Retry 429 and 503 with exponential backoff. Don't retry 400, 401 or 402 without changing the request.