# Errors and how to recover

Every error is JSON with a `detail` field. Where there is something to act on, `detail` is an object with the specifics.

| Status | When | What to do |
|---|---|---|
| `400` | A request is invalid, for example no requested GPU model exists in the fleet. | Read `detail`. For GPUs, `detail.available` lists the ids you can use. |
| `401` | The API key is missing or wrong. | Send `Authorization: Bearer <key>`. Create a key under [Settings](https://www.green-compute.com/settings). |
| `402` | Your balance is below one hour of the rental's price. | Top up on [Billing](https://www.green-compute.com/billing). `detail` gives the exact amounts. |
| `403` | Your key can't access that resource. | Use a key from the account that owns it. |
| `404` | The deployment or workload doesn't exist, or isn't yours. On `/ssh`, the pod isn't ready yet. | Check the id; for `/ssh`, wait for `state: "ready"`. |
| `409` | The action conflicts with the current state, for example resuming a pod whose machine is full. | Read `detail`; for resume, try again later or start a new rental. |
| `422` | The request body doesn't match the schema. | `detail` lists each bad field and why. |
| `429` | Rate limit (30 creates per minute per key). | Wait and retry with back-off. |

## The two you will see most

### `400` — GPU not available

```json
{
  "detail": {
    "message": "none of the requested GPU models are available to rent",
    "requested": ["h100"],
    "available": ["rtx4090", "rtx5090"],
    "hint": "set supported_gpu_models to one of `available` (any spelling); see GET /platform/pricing"
  }
}
```

This is returned immediately when you start the deployment, so you never wait on a rental that could never be placed.

### `402` — not enough balance

```json
{
  "detail": {
    "message": "insufficient balance to start this rental",
    "required_cents": 40,
    "current_cents": 12,
    "rate_cents_per_hour": 40,
    "gpu_count": 1,
    "requested_instances": 1
  }
}
```

You need `required_cents - current_cents` more, here $0.28. Top up, then retry the same request.

## A deployment that ends up `failed`

Read `last_error` on `GET /platform/deployments/{id}`. The most common causes:
- **The image doesn't exist or is private.** Check the image name; only public images can be pulled.
- **The image's CUDA is too old for an RTX 5090.** Use a CUDA 12.8+ image (see [GPU rental](https://www.green-compute.com/docs/gpu-rental.md)).

A failed deployment is not billed.
