View as Markdown

Errors

Errors come back with an HTTP status and a JSON body in the same shape as OpenAI's, so the OpenAI SDKs raise their usual exceptions.

json
{"error": {"message": "Your account has no credit left. Add credit at https://www.continuumlabs.ai/console", "type": "insufficient_quota", "code": "insufficient_quota"}}

Every error

StatuscodeWhat it meansWhat to do
400invalid_request_errorThe body is not valid JSON.Check the request body.
401invalid_api_keyThe key is missing, malformed, deleted or unknown.Send Authorization: Bearer cl-.... Create a new key in the console if needed.
401key_disabledThe key has been switched off in the console.Ask your account owner to switch it back on.
402insufficient_quotaYour account has no credit left.Add credit. Requests work again straight away.
402allowance_reachedThe key's or the workspace's allowance for this period is used up. The message says which.Wait for the reset, or raise the allowance in the console.
403permission_errorA management key was used to call a model, or an ordinary key to manage.Use the right kind of key.
404model_not_foundThe model ID is not one we offer. The message lists the IDs that are.Use an ID from models.
404not_foundThe endpoint or the ID does not exist.Check the path against these docs.
413request_too_largeThe request is over 4 MB.Send less text, or split the work across requests.
429rate_limitedThe model is busy.Wait and retry, with backoff.
502upstream_errorThe model returned an error.Retry. If it keeps happening, tell us.
502upstream_unavailableThe model could not be reached.Retry after a few seconds.
503service_unavailableThe service is not open, or is down for maintenance.Check our status, then retry later.

If the model rejects a request because of something in it, such as a parameter it does not support, you get its original status with a short explanation in message.

Retrying safely

Retry 429, 502 and 503 with exponential backoff: wait about one second, then two, then four, and stop after a few tries. Do not retry 400, 401, 402, 404 or 413, because they will fail the same way.

The OpenAI SDKs retry some errors for you. You can set how many times:

python
client = OpenAI(base_url="https://api.continuumlabs.ai/v1", api_key="cl-your-key", max_retries=3)

Failed requests are not charged.