# Create sandbox

```http
POST /sandboxes
```

Create a sandbox. Requires project.sandboxes.manage.

## Request body

| Field               | Type    | Required | Description                                                                                           |
| ------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------- |
| `access_scope`      | string  | Yes      | Private sandboxes require creator credentials or a creator-owned MCP OAuth grant.                     |
| `project_reference` | string  |          | Project UUID or slug to bill. When set, the project owner is billed.                                  |
| `environment_id`    | string  |          | Environment whose variables are copied once into the sandbox; it also identifies the billing project. |
| `ttl_mode`          | string  |          | Sandbox lifetime policy. `default` uses the platform’s idle and maximum lifetime limits.              |
| `ttl_hours`         | integer |          | Required when ttl\_mode is duration. Number of hours before cleanup, up to 24.                        |

## Responses

| Status | Description                                                                                      |
| ------ | ------------------------------------------------------------------------------------------------ |
| 201    | Sandbox created and billed to the project identified by `project_reference` or `environment_id`. |
| 400    | Bad request                                                                                      |
| 401    | Unauthorized                                                                                     |
| 402    | Payment required                                                                                 |
| 403    | Forbidden                                                                                        |
| 404    | Not found                                                                                        |
