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
| Status | Code | Meaning | What to do |
|---|---|---|---|
| 401 | missing_api_key | No API key was provided. Send Authorization: Bearer bl_... | Send Authorization: Bearer bl_... on every call. |
| 401 | invalid_api_key | That 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. |
| 402 | insufficient_credits | Not enough credits. Buy credits at /console/billing. | Add credits on Billing. Nothing was billed. |
| 404 | model_not_found | That 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. |
| 400 | invalid_json | The request body is not valid JSON. | The body must be valid JSON. |
| 400 | invalid_request | The request is not valid. | Read error.message and error.param. They name the field. |
| 400 | unsupported_parameter | Ballast does not support the parameter you sent. The name is in error.param. | Remove it. What works lists what Ballast accepts. |
| 413 | request_too_large | The request body is too large. | Send fewer messages or less text. The limit is 2 MB. |
| 429 | rate_limited | Too many requests. The limit is 60 a minute per key. | Wait for Retry-After, then retry. |
| 429 | too_many_concurrent | Too many requests in flight. The limit is 8 at once per key. | Wait for one of your requests to finish, then retry. |
| 502 | upstream_failed | No host could finish the request. Nothing was billed. | Retry. Three hosts were tried and nothing was billed. |
| 503 | no_capacity | No host is online for this model right now. | Retry after Retry-After. No host had the model loaded. Nothing was billed. |
| 500 | internal_error | Something 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.