Skip to content
All guidesOpen

Docs / For renters

Errors

Every error the API sends, what it means and which ones are safe to retry.

Errors use the OpenAI shape, so the SDKs raise the exceptions you expect. The HTTP status tells you the class of problem and error.code tells you which one.

Error bodyjson
{
  "error": {
    "message": "That API key is not valid or was revoked.",
    "type": "invalid_request_error",
    "code": "invalid_api_key"
  }
}
API errors
StatusCodeMeaningWhat to do
401missing_api_keyNo API key was provided. Send Authorization: Bearer bl_...Send Authorization: Bearer bl_... on every call.
401invalid_api_keyThat API key is not valid or was revoked.Check the key, or make a new one on API keys. A revoked key stops working within 5 seconds.
402insufficient_creditsNot enough credits. Buy credits at /console/billing.Add credits on Billing. Nothing was billed.
404model_not_foundThat model is not in the Ballast catalog. See GET /v1/models.Use an id from GET /v1/models. On a rental, use the model you rented.
400invalid_jsonThe request body is not valid JSON.The body must be valid JSON.
400invalid_requestThe request is not valid.Read error.message and error.param. They name the field.
400unsupported_parameterBallast does not support the parameter you sent. The name is in error.param.Remove it. What works lists what Ballast accepts.
413request_too_largeThe request body is too large.Send fewer messages or less text. The limit is 2 MB.
429rate_limitedToo many requests. The limit is 60 a minute per key.Wait for Retry-After, then retry.
429too_many_concurrentToo many requests in flight. The limit is 8 at once per key.Wait for one of your requests to finish, then retry.
502upstream_failedNo host could finish the request. Nothing was billed.Retry. Three hosts were tried and nothing was billed.
503no_capacityNo host is online for this model right now.Retry after Retry-After. No host had the model loaded. Nothing was billed.
500internal_errorSomething went wrong on our side.Retry. If it keeps happening, tell Support.

What to retry

Retry 429, 502 and 503 after a short wait. 429 and 503 come with a Retry-After header in seconds. Nothing is billed when a request ends in 502 or 503, so a retry cannot double charge you. Do not retry 400, 401, 402 or 404 without changing something first.

A stream that ends with finish_reason: "error" is not an HTTP error, because the 200 was already sent. See Streaming. Rental errors are in Rent a whole GPU.

Something here wrong or missing? Tell us on Support.