Reference
Errors
The error shape, every code, and which ones to retry.
Shape
{
"error": {
"code": "gpus_out_of_range",
"message": "gpus must be 1 to 8, or 16",
"field": "gpus"
},
"request_id": "req_7Hc2kq"
}code is stable and safe to match on. message is for people and may change. field is set when one field caused it.
Codes
| HTTP | Code | Means | Retry |
|---|---|---|---|
| 400 | bad_json | Body is not valid JSON | No |
| 401 | no_key | Missing or unknown key | No |
| 403 | scope | Key lacks the scope, for example run | No |
| 404 | not_found | No such job, session or month for your team | No |
| 409 | already_ended | Stopping a job that already ended | No |
| 422 | gpus_out_of_range | gpus not 1 to 8 or 16 | No |
| 422 | limit_too_long | limit over 14d, or past your Anvil term | No |
| 422 | no_anvil | plan anvil without an active Anvil | No |
| 422 | bank_empty | plan bank with no hours and overflow stop | No |
| 422 | image_unreachable | Image could not be resolved | No |
| 429 | rate_limited | Over 300 requests a minute | Yes, after Retry-After |
| 503 | preview | Your key is not active yet | No |
| 503 | maintenance | API in a maintenance window | Yes, with backoff |
Retrying
Retry 429 and 503 maintenance with exponential backoff, starting at 1 second. Do not retry other 4xx errors: the same request gets the same answer. POST /jobs accepts an Idempotency-Key header, so a retried start never creates two jobs.