> ## Documentation Index
> Fetch the complete documentation index at: https://docs.u-kiyo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Statuses and response shapes

> Every status value, which field to poll on each connector, and the JSON each command returns.

One page for the facts an agent needs while it waits: what each status means, which field is authoritative, and what each call returns.

## Timing

Reaching `ACTIVE` takes usually **1 to 4 minutes** and at most **15**, including automatic fallback across up to three hosts. If no host delivers within 15 minutes, Ukiyo ends the rental itself and charges **\$0.00**. Keep polling the same rental; never start a second one to replace a rental that is still `PROVISIONING`.

## Which field to poll

| connector | call | field to poll |
| - | - | - |
| HTTP API | `GET /api/v1/rentals/<rentalId>` | `data.status` |
| CLI | `ukiyo rental <rentalId> --json` | `status` |
| MCP | `get_rental_status` | `status` |
| Agent Skill | `scripts/ukiyo.sh status <deploymentId>` | `status` (deployment values, below) |
| x402, no account | `POST /api/machine/quotes/<purchaseId>/actions/status` | `purchase.status` |

Poll every 5 to 10 seconds. Stop when the value is `ACTIVE` or one of the final values below.

## Rental status values (API, CLI, MCP)

`status` on a rental:

| value | meaning | final? | what to do |
| - | - | - | - |
| `PROVISIONING` | Ukiyo is starting a machine, or trying the next host. | no | Keep polling. Nothing is charged. |
| `ACTIVE` | The GPU is verified and SSH is authenticated. Billing runs. | no | Fetch credentials and connect. |
| `TERMINATING` | Termination was accepted; the machine is being destroyed. The charge is already fixed. | no | Keep polling if you need confirmation. |
| `TERMINATED` | The machine is destroyed. `chargedMinor` is final. | yes | Nothing. |
| `FAILED` | No machine was delivered, or the rental could not continue. | yes | Read `failureReason` and `message`. A rental that never reached `ACTIVE` costs \$0.00. |

When a rental is `FAILED`, `failureReason` is one of:

| `failureReason` | meaning |
| - | - |
| `GPU_UNAVAILABLE` | No eligible machine of that type was available. Try another type or retry. |
| `MACHINE_NOT_STARTED` | The machine did not start. |
| `PROVISIONING_TIMEOUT` | The machine did not become ready in time. |
| `HARDWARE_CHECK_FAILED` | The software or GPU readiness check failed. |
| `INSTANCE_STOPPED` | The machine stopped unexpectedly. |
| `ACCOUNT_BALANCE_LOW` | Available credit was too low; `message` states the shortfall. |
| `CAPACITY_LIMIT` | An account or key limit was reached. |
| `BILLING_UNAVAILABLE` | Usage monitoring was unavailable; retry shortly. |
| `PROVISIONING_FAILED` | Any other provisioning failure. |

## Deployment status values

`status` on a deployment (`GET /api/v1/deployments/<deploymentId>`, `ukiyo status`, `get_deployment_status`, and `purchase.status` on x402) is the machine's own state:

| value | meaning | final? |
| - | - | - |
| `PAYMENT_CONFIRMED` | Funds are confirmed; provisioning has not started yet. Treat as `PROVISIONING`. | no |
| `PROVISIONING` | A machine is starting, or the next host is being tried. | no |
| `ACTIVE` | The GPU is verified and SSH is authenticated. | no |
| `PROVISIONING_FAILED` | **No host delivered a working GPU inside the 15-minute limit.** Each host tried was either already taken or did not finish starting within its 5 minutes. You were charged \$0.00. Do not pay again for this rental; start a new one. | yes for your money; the record then moves to `TERMINATED` once destruction of every instance is verified |
| `TERMINATING` | The machine is being destroyed. | no |
| `TERMINATED` | The machine is destroyed. | yes |

The rental view folds `PAYMENT_CONFIRMED` into `PROVISIONING`, and reports a failed provisioning as `FAILED` with a `failureReason`. The deployment view and the x402 `purchase.status` show `PROVISIONING_FAILED` itself.

## x402 status values

The x402 status response has two levels:

* **`purchase.status`** is authoritative for the machine. It takes the deployment values above.
* **`purchase.refundStatus`** and **`purchase.refundedMinor`** are authoritative for your money: `SETTLEMENT_PENDING` → `PENDING` → `COMPLETED`, or `NOT_REQUIRED` when the whole payment was used.
* The top-level `state` is the purchase record's coarser state (for example `PAYMENT_PENDING`, `PROVISIONING`, `PROVISIONING_FAILED`, `TERMINATED`). It can trail `purchase.status` by one poll. Do not poll it.

On failure, `purchase.failureReason` is `NO_HOST_DELIVERED`, `JOB_TIMED_OUT` or `JOB_FAILED`, with `purchase.failureMessage` and `purchase.hostsTried`. See [x402](https://docs.u-kiyo.ai/connect/machine-payments.md).

## Response shapes

The HTTP API wraps every result as `{"data": {...}, "meta": {...}}`. **The CLI prints the contents of `data` at the top level.** MCP tools return the API body as JSON text, with the `data` wrapper. The Skill script prints the CLI form when it delegates to the CLI and the API form when it calls the API with `UKIYO_API_TOKEN`. Values below are examples only.

### List offers

`GET /api/v1/offers` · `ukiyo offers --json` · `list_compute_offers` · `scripts/ukiyo.sh offers`

```json theme={null}
{"id":"<offerId>","offerId":"<offerId>","gpuModel":"RTX4090","name":"NVIDIA RTX 4090",
 "category":"Creator GPU","gpuCount":1,"vramGb":24,"cpuCores":15,"memoryGb":62.7,"storageGb":50,
 "hourlyPriceMinor":92,"pricePerHourMinor":92,"maxHourlyPriceMinor":92,"currency":"USD","available":true,
 "availableOffers":5,"selection":"GPU_TYPE","minimumCreditMinor":16}
```

The hourly price of a listed type is **`hourlyPriceMinor`**, in cents for the whole instance (`pricePerHourMinor` is the older name; both are returned). `vramGb` and `memoryGb` are the **guaranteed minimum** per GPU and for RAM across the hosts Ukiyo may assign; the machine you get may have more. RAM figures are GiB to one decimal.

### Rent, and rental status

`POST /api/v1/rentals` · `GET /api/v1/rentals/<rentalId>` · `ukiyo rent` · `ukiyo rental <rentalId>` · `rent_gpu` · `get_rental_status`

```json theme={null}
{"rentalId":"<uuid>","orderId":"<uuid>","deploymentId":"<uuid>","status":"ACTIVE",
 "hourlyPriceMinor":92,"chargedMinor":3,"chargeFinal":false,"currency":"USD",
 "ssh":{"host":"<host>","port":22022,"username":"root"},
 "billingPolicy":"LISTED_RUNTIME","serviceEndedAt":null,"endedAt":null,
 "pythonPath":"/venv/main/bin/python","memoryGb":62.7,"deliveredMemoryGb":62.7,"budgetMinor":null,
 "quote":{"hourlyPriceMinor":92,"durationSeconds":null,"totalMinor":0,"currency":"USD"},
 "failureReason":null,"message":null,
 "credits":{"billingModel":"ACCOUNT_BALANCE","consumedMinor":3,"settlementStatus":"ACCRUING"},
 "deployment":{"id":"<uuid>","status":"ACTIVE","unitPriceMinor":92,"chargedMinor":3,"chargeFinal":false,
               "startedAt":"<UTC time>","cpuCores":15,"memoryGb":64,"storageGb":50}}
```

* **`quote.totalMinor` is `0`, and that is correct.** Billing is per second of `ACTIVE` time, so there is no prepaid total. The rate is `hourlyPriceMinor`; what you have been charged so far is `chargedMinor`, final once `chargeFinal` is `true`.
* `quote.durationSeconds` is `null` for the same reason: you did not buy a fixed duration.
* `memoryGb` is the RAM advertised for the type; `deliveredMemoryGb` is the RAM your container can use, measured inside it at `ACTIVE`, and is `null` before then. Both are GiB to one decimal.
* **`ssh`** carries `host`, `port` and `username` while `status` is `ACTIVE`, and is `null` otherwise. It never includes the private key: get that from `credentials` (next).

### Credentials

`POST /api/v1/deployments/<deploymentId>/credentials/reveal` · `ukiyo credentials <deploymentId>` · `get_deployment_credentials` · `scripts/ukiyo.sh credentials <deploymentId>`

```json theme={null}
{"protocol":"SSH","host":"<host>","port":22022,"username":"root","privateKey":"<secret>",
 "connection":{"protocol":"ssh","host":"<host>","port":22022,"username":"root",
               "keyFileName":"ukiyo-<first 8 of deploymentId>.pem"}}
```

Only works while the deployment is `ACTIVE`; in any other status it returns `CREDENTIALS_NOT_FOUND`. The private key is a secret and every reveal is audited. The CLI prints `privateKey` as `[REDACTED]` unless you pass `--save-key <path>` (recommended) or `--reveal`.

### Terminate

`POST /api/v1/deployments/<deploymentId>/terminate` · `ukiyo terminate <deploymentId> --yes` · `terminate_deployment` · `scripts/ukiyo.sh terminate <deploymentId>`

```json theme={null}
{"accepted":true,"deploymentId":"<uuid>","rentalId":"<uuid>","status":"TERMINATING","chargedMinor":3,"chargeFinal":true,"currency":"USD"}
```

The API answers `202`: termination is accepted, `status` is `TERMINATING` or `TERMINATED`, and `chargedMinor` is already final. Terminating again returns the same values. To confirm destruction, read the rental again until `status` is `TERMINATED`, or use `ukiyo terminate <deploymentId> --yes --wait --json`, which waits and prints the final deployment.

### Balance

`GET /api/v1/billing/balance` · `ukiyo balance --json` · `get_account_balance`

```json theme={null}
{"availableMinor":500,"currency":"USD","frozen":false,"reservedMinor":0,
 "ledger":[{"id":"<uuid>","kind":"<entry kind>","amountMinor":500,"balanceAfterMinor":500,"orderId":null,"createdAt":"<UTC time>"}]}
```

`ledger` holds the 20 most recent entries. Add `?ledgerLimit=<0 to 100>` to change that; `0` returns the balance with an empty ledger.

### x402 purchase status and terminate

`POST /api/machine/quotes/<purchaseId>/actions/status` and `POST /api/machine/quotes/<purchaseId>/actions/terminate` return the same shape:

```json theme={null}
{"purchaseId":"<purchaseId>","state":"PROVISIONING","accessToken":"<secret>",
 "purchase":{"status":"ACTIVE","orderId":"<uuid>","deploymentId":"<uuid>",
             "billingModel":"ACCOUNT_BALANCE","chargedMinor":"3","chargeFinal":false,"currency":"USD",
             "refundStatus":"SETTLEMENT_PENDING","refundedMinor":"0",
             "destructionConfirmed":false,
             "access":{"protocol":"SSH","host":"<host>","port":22022,"username":"root","privateKey":"<secret>"}}}
```

* `purchase.access` is present only while `purchase.status` is `ACTIVE` and only for a GPU block. That is where SSH comes from on this path.
* `chargedMinor` and `refundedMinor` are strings of cents on this path.
* After a failure the response adds `purchase.failureReason`, `purchase.failureMessage` and `purchase.hostsTried`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.