Open in AI

Errors and limits

Errors come back with a status code and a JSON body with a detail field, usually a sentence you can show as is.

{
  "detail": "This API key lacks the 'power' scope"
}

Status codes

400Bad requestSomething in the request is wrong, for example an unknown plan or a duration over 12.
401UnauthorizedNo key, a wrong key, or a revoked or expired one.
402Payment requiredThe balance doesn’t cover it. detail has message, required and balance.
403ForbiddenThe key lacks the scope, the endpoint isn’t open to keys, the balance is frozen or the server is suspended.
404Not foundNo such server or order on this account.
409ConflictThe server is busy, for example still setting up after an order or reinstall.
422UnprocessableA field has the wrong type or is missing. detail lists each problem.
429Too many requestsMore than 120 requests a minute with one key, or too many wrong keys from one address.
503UnavailableThe data centre didn’t answer in time. Safe to retry.

Rate limits

120 requests a minute per key. Over that, requests answer 429 until the minute has passed. Poll a setting-up server every 15 to 30 seconds, not faster.