# Give your AI agent a persistent cloud computer

> A Linux machine your agent keeps coming back to, with its files, installed packages and running processes: create a box through the API, run commands and coding agents on it, let it sleep between sessions, and what it costs.

URL: https://prized.dev/docs/persistent-cloud-computer

An agent that works across sessions needs one computer that stays: the packages it installed, the files it wrote, and the processes it left running are there when it comes back. A box is that computer: a dedicated Linux machine with no maximum run time, created and driven through the API, that sleeps for the price of its disk.

## 1. Create a box [#1-create-a-box]

Make an API key at [API keys](https://prized.dev/dashboard/workspace/api-keys) ([Agent sign-in](https://prized.dev/docs/agent-sign-in) lets an agent make the account and its own key), then:

```bash
export PRIZED_API_KEY=dcp_…
API=https://api.prized.dev/api/v1
AUTH="Authorization: Bearer $PRIZED_API_KEY"
curl -s -X POST "$API/boxes" -H @<(echo "$AUTH") -H "Content-Type: application/json" -d '{"name":"agent-1","tier":"flow"}'
# {"box":{"id":"…","observedState":"requested",…}}
```

Poll `GET $API/boxes/{id}` until it is `running`. `prized box new agent-1 --size Small --wait` does the same from the CLI, and `prized box ls` shows it running ([Boxes](https://prized.dev/docs/boxes#create)).

## 2. Run commands and agents on it [#2-run-commands-and-agents-on-it]

```bash
EDGE=$(curl -s "$API/me" -H @<(echo "$AUTH") | jq -r .edge.url)
curl -s -X POST "$EDGE/v1/box/agent-1/exec" -H @<(echo "$AUTH") -H "Content-Type: application/json" -d '{"command":"echo remember-me >> ~/notes.txt && cat ~/notes.txt"}'
```

`POST /exec` answers with the output and exit code; `"detached": true` leaves a long job running and returns its id to follow ([Run commands and files](https://prized.dev/docs/exec#the-edge-api)). Once signed in on the box ([Credentials](https://prized.dev/docs/credentials)), Claude Code, Codex, OpenCode and pi run there from one call to `POST /prompts`, and the run lives on the box, so nothing depends on the caller staying connected ([Prompt an agent remotely](https://prized.dev/docs/remote-agents#the-edge-api)).

## 3. Let it sleep between sessions [#3-let-it-sleep-between-sessions]

```bash
curl -s -X POST "$API/boxes/{id}/suspend" -H @<(echo "$AUTH")
```

A paused box keeps its disk and pays only for it. Nano through Small also save their memory, so processes and tmux sessions resume where they were; larger sizes, and any box paused over 3 days, start their processes fresh ([Pause and resume](https://prized.dev/docs/boxes#pause-and-resume)). The next `POST /exec` or `POST /prompts` wakes the box before it starts, and `autoPauseMin` on the create pauses it after that many idle minutes ([Auto-pause](https://prized.dev/docs/boxes#auto-pause)).

## One box per user or per agent [#one-box-per-user-or-per-agent]

Name each box after its user or agent and keep the mapping on your side. A workspace holds 1 box on the free credit, 10 on the $10 and $25 plans, 25 on $50 and $100, and 100 from $250 ([Limits](https://prized.dev/docs/limits#boxes)). An [environment](https://prized.dev/docs/environments) gives every new box the same repos, setup script and env vars, and a [snapshot](https://prized.dev/docs/snapshots) of a set-up box restores into new ones.

## What it costs [#what-it-costs]

|  | Nano (2 vCPU, 2 GB) | Small (4 vCPU, 16 GB) |
| --- | --- | --- |
| Awake, per hour | $0.014 | $0.137 |
| Awake around the clock, 30 days | $9.86 | $98.63 |

Asleep, a box pays only for its disk ([Billing](https://prized.dev/docs/billing)). New accounts get $30 of credit with no card, enough for one box from Nano to Small.
