---
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

## Changes

- **2026-05-27** `a0acb3a6a101` — 3 warning, 16 info
  - removed the request property `ttl_seconds`
  - removed the optional property `expires_at` from the response with the `201` status
  - removed the optional property `ttl_seconds` from the response with the `201` status
  - added the new optional request property `delete_after_stop_seconds`
  - …15 more
- **2026-05-04** `d68594e2e78c` — 2 warning
  - removed the request property `timeout`
  - removed the request property `wait_for_ready`
- **2026-04-30** `99490d1e837e` — 2 warning, 4 info
  - removed the request property `template_name`
  - removed the optional property `template_name` from the response with the `201` status
  - added the new optional request property `proxy_config/callbacks`
  - added the new optional request property `snapshot_name`
  - …2 more
- **2026-04-13** `e86be67718ee` — 1 breaking, 1 warning, 12 info
  - removed the required property `proxy_config/rules/items/inject_headers` from the response with the `201` status
  - removed the request property `proxy_config/rules/items/inject_headers`
  - the endpoint scheme security `X-Service-Key` was added to the API
  - added the new optional request property `fs_capacity_bytes`
  - …10 more
- **2026-03-31** `9b9d7777d6a9` — 1 info
  - added the new optional request property `proxy_config`

[Full history](https://skmtc.dev/langchain-ai/apis/langsmith/changes/v2/sandboxes/boxes/post.md)

---

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