# Sandboxes

Make and manage sandboxes outside a run.

## Create a sandbox

```http
POST /v1/sandboxes
```

```json Request
{ "repo": "acme/web-app", "timeout_ms": 600000, "from": "web-app-seeded" }
```

```json Response
{ "id": "sbx_41c9", "state": "running", "expires_at": "2026-11-01T09:22:44Z" }
```

## Run a command

```http
POST /v1/sandboxes/{id}/commands
```

```json Request
{ "cmd": "npm test -- checkout", "timeout_ms": 120000 }
```

```json Response
{ "exit_code": 0, "stdout": "Tests: 14 passed, 14 total\n", "stderr": "", "ms": 9120 }
```

## Files

```http
PUT /v1/sandboxes/{id}/files/{path}
GET /v1/sandboxes/{id}/files/{path}
```

Send and receive the raw bytes. For files over 100 MB, use the SDKs, which split them into parallel chunks.

## Pause, resume, snapshot

```http
POST /v1/sandboxes/{id}/pause
POST /v1/sandboxes/{id}/resume
POST /v1/sandboxes/{id}/snapshots
```

## Kill a sandbox

```http
DELETE /v1/sandboxes/{id}
```

Returns `204`. A second call returns `409 conflict`.
