# Errors

Source: https://bflops.com/docs/api/errors

Every error code the REST API and MCP tools answer, what it means and what to do.



A refused request answers an HTTP status and a body like this:

```json title="400"
{
  "error": {
    "code": "invalid_request",
    "message": "The request is not valid.",
    "field": "ssh_key"
  }
}
```

Branch on `code`, never on `message`: the words may change. `field` names the part of the body at fault, when there is one; `needed_usd` says what your balance must hold, on `prepay_needed`. The MCP tools answer the same `message`.

## Your request [#your-request]

| Code                   | Status | What to do                                                       |
| ---------------------- | ------ | ---------------------------------------------------------------- |
| `unauthorized`         | 401    | Send your key as `Authorization: Bearer bf_...` or `x-api-key`   |
| `invalid_request`      | 400    | Fix the field named in `field`                                   |
| `not_found`            | 404    | The machine, cluster or rental is gone, or not yours             |
| `rate_limited`         | 429    | Wait the seconds in `Retry-After`, then retry                    |
| `idempotency_mismatch` | 422    | This `Idempotency-Key` was used with another body. Use a new key |
| `idempotency_running`  | 409    | The first request with this key is still running. Retry shortly  |

## Your key and account [#your-key-and-account]

| Code              | Status | What to do                                                                                    |
| ----------------- | ------ | --------------------------------------------------------------------------------------------- |
| `read_only_key`   | 403    | Give the key a GPU daily limit on [API keys](/keys)                                           |
| `key_daily_limit` | 429    | The key's daily limit is spent. Wait for the next UTC day, or raise it                        |
| `agent_cap`       | 429    | A key runs 4 machines or 1 cluster at once. Stop one first                                    |
| `gpu_cap`         | 429    | A new account runs 8 GPUs at most in its first 7 days                                         |
| `daily_cap`       | 429    | A new account spends $300 a day at most in its first 7 days                                   |
| `balance_short`   | 402    | [Top up](/docs/top-up), then try again                                                        |
| `prepay_needed`   | 402    | Hold 72 hours of this machine (`needed_usd`), then try again. Only the time it runs is billed |
| `too_many_keys`   | 409    | You hold 20 keys. Revoke one first                                                            |
| `frozen`          | 403    | The account is on hold while a report about it is reviewed                                    |
| `sanctioned`      | 403    | This account cannot rent on bFLOPS                                                            |
| `place_refused`   | 451    | bFLOPS is not offered where the request comes from                                            |

## Quotes and starts [#quotes-and-starts]

| Code                        | Status | What to do                                                            |
| --------------------------- | ------ | --------------------------------------------------------------------- |
| `quote_missing`             | 404    | The quote was not found. Get a new one                                |
| `expired`                   | 409    | Over 60 seconds passed. Get a new quote                               |
| `price_moved`               | 409    | The price changed. Get a new quote                                    |
| `quote_used`                | 409    | This quote started something already. Get a new one                   |
| `quote_is_cluster`          | 409    | Start a cluster's quote with `start_cluster` (MCP)                    |
| `quote_is_machine`          | 409    | Start a machine's quote with `start` (MCP)                            |
| `gpus_unavailable`          | 409    | This machine is rented whole: ask for all its GPUs                    |
| `kind_unavailable`          | 409    | It is not offered on demand, or not interruptible                     |
| `machine_unavailable`       | 409    | Someone else rented it first. Pick another                            |
| `cluster_needs_established` | 409    | Clusters open 7 days after your first top-up, once you have spent $50 |
| `data_unavailable`          | 409    | /data opens on the same terms, and on single machines only            |
| `data_in_use`               | 409    | /data is mounted on another machine. Stop that one first              |
| `not_extendable`            | 409    | Only a key's machine extends, while starting or running               |
| `outside_schedule`          | 409    | This machine is outside its hours now. Pick another                   |
| `no_reservations`           | 409    | This machine takes no reservations                                    |

## On our side [#on-our-side]

| Code                   | Status | What to do                                                                |
| ---------------------- | ------ | ------------------------------------------------------------------------- |
| `paused`               | 503    | New machines are paused for now. Running ones keep running. Retry later   |
| `supplier_unavailable` | 503    | No machine of this type can start now. Try another type                   |
| `supplier_preparing`   | 503    | Your balance covers it and it is being made ready. Retry in a few minutes |
| `unavailable`          | 503    | Something failed on our side. Retry in a moment                           |
