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

# Create a sandbox

`POST /v2/sandboxes/boxes`

Create a new sandbox from a snapshot. Provide at most one of `snapshot_id` or `snapshot_name`; if neither is provided, the server uses the default static blueprint.

## Request body

- SandboxesCreateSandboxPayload
  - `delete_after_stop_seconds` integer
  - `fs_capacity_bytes` integer
  - `idle_ttl_seconds` integer
  - `mem_bytes` integer
  - `name` string
  - `proxy_config` SandboxesProxyConfig
    - `access_control` SandboxesAccessControl
      - `allow_list` string[]
      - `deny_list` string[]
    - `callbacks` SandboxesCallback[]
      - `full_request` boolean
      - `match_hosts` string[], required
      - `request_headers` SandboxesProxyHeader[]
        - `is_set` boolean
        - `name` string, required
        - `type` 'plaintext' | 'opaque' | 'workspace_secret', required
        - `value` string
      - `ttl_seconds` integer, required
      - `url` string, required
    - `no_proxy` string[]
    - `rules` SandboxesProxyRule[]
      - `enabled` boolean
      - `headers` SandboxesProxyHeader[]
        - `is_set` boolean
        - `name` string, required
        - `type` 'plaintext' | 'opaque' | 'workspace_secret', required
        - `value` string
      - `match_hosts` string[], required
      - `match_paths` string[]
      - `name` string, required
  - `restore_memory` boolean — RestoreMemory, when non-nil, overrides the server default for whether to resume the sandbox from its captured memory snapshot. true → resume from the memory snapshot if it exists; cold-boot the sandbox otherwise. false → always cold-boot, even if a memory snapshot exists. nil → use the server default. Applies to this request only; a later stop+start of the same sandbox reverts to the server default.
  - `snapshot_id` string
  - `snapshot_name` string
  - `tag_value_ids` string[]
  - `vcpus` integer

## Response `201`

Created

- SandboxesSandboxResponse
  - `created_at` string
  - `created_by` string
  - `dataplane_url` string
  - `delete_after_stop_seconds` integer
  - `fs_capacity_bytes` integer
  - `id` string
  - `idle_ttl_seconds` integer
  - `mem_bytes` integer
  - `name` string
  - `proxy_config` SandboxesProxyConfig
    - `access_control` SandboxesAccessControl
      - `allow_list` string[]
      - `deny_list` string[]
    - `callbacks` SandboxesCallback[]
      - `full_request` boolean
      - `match_hosts` string[], required
      - `request_headers` SandboxesProxyHeader[]
        - `is_set` boolean
        - `name` string, required
        - `type` 'plaintext' | 'opaque' | 'workspace_secret', required
        - `value` string
      - `ttl_seconds` integer, required
      - `url` string, required
    - `no_proxy` string[]
    - `rules` SandboxesProxyRule[]
      - `enabled` boolean
      - `headers` SandboxesProxyHeader[]
        - `is_set` boolean
        - `name` string, required
        - `type` 'plaintext' | 'opaque' | 'workspace_secret', required
        - `value` string
      - `match_hosts` string[], required
      - `match_paths` string[]
      - `name` string, required
  - `size_class` string
  - `snapshot_id` string
  - `status` string
  - `status_message` string
  - `stopped_at` string
  - `updated_at` string
  - `updated_by` string
  - `vcpus` integer

## Other responses

- `400` — Snapshot not found
- `409` — Name already exists
- `422` — Validation error
- `429` — Quota exceeded
- `500` — Sandbox creation failed or internal error
- `504` — Sandbox did not become ready in time

---

[API](https://skmtc.net/langchain-ai/apis/langsmith.md) · [All operations](https://skmtc.net/langchain-ai/apis/langsmith/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langchain-ai/langsmith/versions/a0acb3a6a101/schema)
