---
title: "Create a sandbox"
method: POST
path: "/sandboxes"
tags: ["sandboxes"]
---

# Create a sandbox

`POST /sandboxes`

Spawn a new sandbox with the given configuration

## Request body

- GithubComStacyOsStacyvmInternalOrchestratorSpawnRequest
  - `image` string
  - `memory_mb` integer
  - `metadata` object
  - `owner_id` string
  - `provider` string
  - `template` string
  - `tenant_id` string
  - `ttl` string
  - `vcpus` integer

## Response `201`

Created

- GithubComStacyOsStacyvmInternalOrchestratorSandbox
  - `created_at` string
  - `expires_at` string
  - `id` string
  - `image` string
  - `memory_mb` integer
  - `metadata` object
  - `owner_id` string
  - `preview_domain` string
  - `provider` string
  - `state` 'creating' | 'running' | 'idle' | 'unhealthy' | 'expired' | 'destroyed' | 'error'
  - `tenant_id` string
  - `vcpus` integer
  - `vm_id` string
  - `worker_id` string

## Other responses

- `400` — Bad Request
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.dev/stacyos/apis/stacyvm-api.md) · [All operations](https://skmtc.dev/stacyos/apis/stacyvm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/stacyos/stacyvm-api/revisions/d8b1ebf10293/schema)
