Provisions a new sandbox VM through the orchestrator. The API waits until the VM
reports a guest IP address before returning — typically 1–5 seconds. The returned
object contains tokens and connection details needed by the SDK.
Template name to base the sandbox on. Becomes the sandbox name and is
prefixed with tpl- for the template_id. Defaults to an empty string
(which uses the default base image).Example: "base"
Auto-kill timeout in seconds. When the timeout expires the sandbox state is
set to killed and the VM is terminated. Omit it for the 300-second default.
0 means no expiry and is accepted only by on-prem deployments; Declaw Cloud rejects it with 400, and a value above your plan’s maximum session with 403tier_limit.Example: 300
Arbitrary key-value metadata stored with the sandbox. Useful for tagging
sandboxes by project, run ID, or agent name.Example: { "project": "my-agent", "run_id": "run-001" }
Resource allocation (vCPUs, memory, disk) is fixed at the template level —
the request-level resources field is currently rejected with HTTP 403. Use
templates to size sandboxes instead.
IPs or CIDR ranges explicitly denied, plus ALL_TRAFFIC ("*" / "0.0.0.0/0")
to deny everything not allowlisted. allow_out takes precedence — a destination
matching both is allowed, so deny_out cannot carve an exception out of an
allow_out entry. Domain names in deny_out are ignored; express domain
restrictions by allowlisting with allow_out instead.
Example: ["10.0.0.0/8"]
Full SecurityPolicy object (PII config, injection defense, transformation rules,
audit config). Passed as a JSON object and stored verbatim. See the
Security section for the complete schema.
"kill" destroys the sandbox when its timeout fires. "pause" takes a
pause snapshot and hibernates it instead — the same as calling
pause — so it can be
resumed later. A pause that fails is
retried a few times; if it still fails, the sandbox is killed instead. A
paused sandbox is kept until it is resumed or killed. Any other value is
rejected with 400.
Wallet (sandbox or guardrails) has insufficient balance
403
Per-sandbox tier limits exceeded (vCPU / memory / disk / session duration), or request-level resources field supplied
429
Concurrent sandbox limit reached for your tier, or sandbox create rate limit exceeded
503
Orchestrator is unavailable or the VM failed to start
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Declaw","description":"Declaw is a security-first sandbox platform for AI agents. Run untrusted code in sandbox microVMs with PII redaction, prompt injection defense, and network policy enforcement.","colors":{"primary":"#0D9373","light":"#07C983","dark":"#0D9373"},"logo":{"light":"https://mintcdn.com/declaw/YB_0u8lW6K_x_PnD/logo/light.svg?fit=max\u0026auto=format\u0026n=YB_0u8lW6K_x_PnD\u0026q=85\u0026s=3a1b3b5d14a7c974db1eda0b8d012499","dark":"https://mintcdn.com/declaw/YB_0u8lW6K_x_PnD/logo/dark.svg?fit=max\u0026auto=format\u0026n=YB_0u8lW6K_x_PnD\u0026q=85\u0026s=564cdf5bfb8abed1949842b56312a3ba"},"favicon":"https://mintcdn.com/declaw/8XHgD2oahu7LIUrQ/favicon.svg?fit=max\u0026auto=format\u0026n=8XHgD2oahu7LIUrQ\u0026q=85\u0026s=c8814a2fdcc2cf40add79906afcd7b5b","api":{"openapi":"openapi.yaml","mdx":{"auth":{"method":"key","name":"X-API-Key"},"server":"https://api.declaw.ai"}},"appearance":{"default":"dark"},"navbar":{"links":[{"href":"https://docs.declaw.ai/mcp","label":"MCP"}],"primary":{"type":"button","label":"Get API Key","href":"https://declaw.ai"}},"footer":{"socials":{"x":"https://x.com/declaw_ai"}},"seo":{"indexing":"navigable"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/bjA5Zs9ZPw"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"declaw","hasAudioNarration":false,"actualSubdomain":"declaw","customDomains":["docs.declaw.ai"],"gitSource":{"type":"github","owner":"declaw-ai","repo":"declaw-cloud","deployBranch":"main","contentDirectory":"declaw/client_docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ad8419f3fe31fb23d51dad1","collectionId":"dfe2e9f0-4a4f-4b22-8ebd-61b3d1c12780","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ad8419f3fe31fb23d51dad1"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ad8419f3fe31fb23d51dad1","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"default","tag":"Cookbook","count":89},{"language":"default","tag":"API Reference","count":52},{"language":"default","tag":"Documentation","count":45},{"language":"default","tag":"SDKs","count":32},{"language":"default","tag":"Volumes API","count":21},{"language":"default","tag":"Sandbox API","count":14},{"language":"default","tag":"OpenAI Agents","count":14},{"language":"default","tag":"Security","count":13},{"language":"default","tag":"Python SDK","count":12},{"language":"default","tag":"Filesystem API","count":11}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/sandbox/create","slug":"/api-reference/sandbox/create","pageMetadata":{"title":"Create Sandbox","api":"POST /sandboxes","description":"Create a new isolated sandbox sandbox.","href":"/api-reference/sandbox/create"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Create a new isolated sandbox sandbox.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Expandable,Heading,Note,ParamField,ResponseField,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Provisions a new sandbox VM through the orchestrator. The API waits until the VM\nreports a guest IP address before returning — typically 1–5 seconds. The returned\nobject contains tokens and connection details needed by the SDK.`}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsxs(ParamField,{body:`template`,type:`string`,id:`param-template`,children:[_jsxs(_components.p,{children:[`Template name to base the sandbox on. Becomes the sandbox `,_jsx(_components.code,{children:`name`}),` and is\nprefixed with `,_jsx(_components.code,{children:`tpl-`}),` for the `,_jsx(_components.code,{children:`template_id`}),`. Defaults to an empty string\n(which uses the default base image).`]}),_jsxs(_components.p,{children:[`Example: `,_jsx(_components.code,{children:`\"base\"`})]})]}),`\n`,_jsxs(ParamField,{body:`timeout`,type:`integer`,id:`param-timeout`,children:[_jsxs(_components.p,{children:[`Auto-kill timeout in seconds. When the timeout expires the sandbox state is\nset to `,_jsx(_components.code,{children:`killed`}),` and the VM is terminated. Omit it for the 300-second default.\n`,_jsx(_components.code,{children:`0`}),` means no expiry and is accepted only by on-prem deployments; Declaw Cloud rejects it with `,_jsx(_components.code,{children:`400`}),`, and a value above your plan’s maximum session with `,_jsx(_components.code,{children:`403`}),` `,_jsx(_components.code,{children:`tier_limit`}),`.`]}),_jsxs(_components.p,{children:[`Example: `,_jsx(_components.code,{children:`300`})]})]}),`\n`,_jsxs(ParamField,{body:`envs`,type:`object`,id:`param-envs`,children:[_jsx(_components.p,{children:`Environment variables to inject into the sandbox VM. Keys and values must\nbe strings.`}),_jsxs(_components.p,{children:[`Example: `,_jsx(_components.code,{children:`{ \"OPENAI_API_KEY\": \"sk-...\" }`})]})]}),`\n`,_jsxs(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:[_jsx(_components.p,{children:`Arbitrary key-value metadata stored with the sandbox. Useful for tagging\nsandboxes by project, run ID, or agent name.`}),_jsxs(_components.p,{children:[`Example: `,_jsx(_components.code,{children:`{ \"project\": \"my-agent\", \"run_id\": \"run-001\" }`})]})]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Resource allocation (vCPUs, memory, disk) is fixed at the `,_jsx(_components.strong,{children:`template`}),` level —\nthe request-level `,_jsx(_components.code,{children:`resources`}),` field is currently rejected with HTTP 403. Use\ntemplates to size sandboxes instead.`]})}),`\n`,_jsxs(ParamField,{body:`network`,type:`object`,id:`param-network`,children:[_jsx(_components.p,{children:`Outbound network access controls.`}),_jsxs(Expandable,{title:`NetworkConfig fields`,children:[_jsx(ParamField,{body:`allow_out`,type:`string[]`,id:`param-allow-out`,children:_jsxs(_components.p,{children:[`Domains or CIDR ranges allowed for outbound traffic. Wildcards supported.\nExample: `,_jsx(_components.code,{children:`[\"pypi.org\", \"*.github.com\"]`})]})}),_jsx(ParamField,{body:`deny_out`,type:`string[]`,id:`param-deny-out`,children:_jsxs(_components.p,{children:[`IPs or CIDR ranges explicitly denied, plus `,_jsx(_components.code,{children:`ALL_TRAFFIC`}),` (`,_jsx(_components.code,{children:`\"*\"`}),` / `,_jsx(_components.code,{children:`\"0.0.0.0/0\"`}),`)\nto deny everything not allowlisted. `,_jsx(_components.code,{children:`allow_out`}),` takes precedence — a destination\nmatching both is `,_jsx(_components.strong,{children:`allowed`}),`, so `,_jsx(_components.code,{children:`deny_out`}),` cannot carve an exception out of an\n`,_jsx(_components.code,{children:`allow_out`}),` entry. Domain names in `,_jsx(_components.code,{children:`deny_out`}),` are ignored; express domain\nrestrictions by allowlisting with `,_jsx(_components.code,{children:`allow_out`}),` instead.\nExample: `,_jsx(_components.code,{children:`[\"10.0.0.0/8\"]`})]})}),_jsx(ParamField,{body:`allow_public_traffic`,type:`boolean`,default:`true`,id:`param-allow-public-traffic`,children:_jsxs(_components.p,{children:[`When `,_jsx(_components.code,{children:`false`}),`, all outbound traffic is denied unless explicitly in `,_jsx(_components.code,{children:`allow_out`}),`.`]})})]})]}),`\n`,_jsx(ParamField,{body:`security`,type:`object`,id:`param-security`,children:_jsxs(_components.p,{children:[`Full SecurityPolicy object (PII config, injection defense, transformation rules,\naudit config). Passed as a JSON object and stored verbatim. See the\n`,_jsx(_components.a,{href:`/security/overview`,children:`Security`}),` section for the complete schema.`]})}),`\n`,_jsxs(ParamField,{body:`lifecycle`,type:`object`,id:`param-lifecycle`,children:[_jsx(_components.p,{children:`Controls what happens when the sandbox timeout fires.`}),_jsxs(Expandable,{title:`LifecycleConfig fields`,children:[_jsx(ParamField,{body:`on_timeout`,type:`string`,default:`kill`,id:`param-on-timeout`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`\"kill\"`}),` destroys the sandbox when its timeout fires. `,_jsx(_components.code,{children:`\"pause\"`}),` takes a\npause snapshot and hibernates it instead — the same as calling\n`,_jsx(_components.a,{href:`/api-reference/sandbox/pause`,children:`pause`}),` — so it can be\n`,_jsx(_components.a,{href:`/api-reference/sandbox/resume`,children:`resumed`}),` later. A pause that fails is\nretried a few times; if it still fails, the sandbox is killed instead. A\npaused sandbox is kept until it is resumed or killed. Any other value is\nrejected with `,_jsx(_components.code,{children:`400`}),`.`]})}),_jsx(ParamField,{body:`auto_resume`,type:`boolean`,default:`false`,id:`param-auto-resume`,children:_jsx(_components.p,{children:`Reserved. Accepted and stored, but not yet acted on: a paused sandbox is\nresumed only by an explicit resume call.`})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`Returns a `,_jsx(_components.a,{href:`/api-reference/sandbox/get`,children:`Sandbox`}),` object with state `,_jsx(_components.code,{children:`running`}),`.`]}),`\n`,_jsx(ResponseField,{name:`sandbox_id`,type:`string`,id:`param-sandbox-id`,children:_jsxs(_components.p,{children:[`Unique sandbox identifier. Format: `,_jsx(_components.code,{children:`sbx-\u003c8 chars>`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`template_id`,type:`string`,id:`param-template-id`,children:_jsxs(_components.p,{children:[`Template ID used. Format: `,_jsx(_components.code,{children:`tpl-\u003cname>`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`state`,type:`string`,id:`param-state`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`\"running\"`}),` on a freshly created sandbox.`]})}),`\n`,_jsx(ResponseField,{name:`envd_access_token`,type:`string`,id:`param-envd-access-token`,children:_jsx(_components.p,{children:`Bearer token for direct envd daemon access. Used internally by the SDK.`})}),`\n`,_jsx(ResponseField,{name:`traffic_access_token`,type:`string`,id:`param-traffic-access-token`,children:_jsx(_components.p,{children:`Bearer token for the security proxy. Used internally by the SDK.`})}),`\n`,_jsx(ResponseField,{name:`guest_ip`,type:`string`,id:`param-guest-ip`,children:_jsx(_components.p,{children:`Internal IP address of the sandbox VM.`})}),`\n`,_jsx(ResponseField,{name:`envd_port`,type:`integer`,id:`param-envd-port`,children:_jsxs(_components.p,{children:[`Port on which envd listens. Typically `,_jsx(_components.code,{children:`49983`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`started_at`,type:`string`,id:`param-started-at`,children:_jsx(_components.p,{children:`UTC timestamp of sandbox creation.`})}),`\n`,_jsx(Heading,{level:`2`,id:`example`,children:`Example`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`8`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.declaw.ai/sandboxes`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"template\": \"base\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"timeout\": 300,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"envs\": { \"MY_VAR\": \"hello\" }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` declaw `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Sandbox`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`sbx `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Sandbox.create(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` domain`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"api.declaw.ai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`300`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` envs`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"MY_VAR\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"hello\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(sbx.sandbox_id) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# sbx-a1b2c3d4`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`9`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Sandbox`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"@declaw/sdk\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` sbx`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Sandbox`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` apiKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` domain:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"api.declaw.ai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` timeout:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 300`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` envs:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`MY_VAR:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"hello\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sbx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sandboxId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// sbx-a1b2c3d4`})]}),`\n`]})})})]}),`\n`,_jsx(CodeBlock,{filename:`Response`,numberOfLines:`15`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sandbox_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sbx-a1b2c3d4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"template_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"tpl-base\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"base\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"state\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"live\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"timeout\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`300`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"envs\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"MY_VAR\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"hello\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"envd_access_token\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"envd-ab12cd34\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sandbox_domain\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"declaw.dev\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"traffic_access_token\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"traffic-ef56gh78\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"guest_ip\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"172.16.0.5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"envd_port\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`49983`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"started_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2024-01-15T10:30:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"end_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2024-01-15T10:35:00Z\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Cause`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsxs(_components.td,{children:[`Invalid request body or malformed `,_jsx(_components.code,{children:`security`}),` JSON`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`401`})}),_jsx(_components.td,{children:`Missing or invalid API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`402`})}),_jsx(_components.td,{children:`Wallet (sandbox or guardrails) has insufficient balance`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`403`})}),_jsxs(_components.td,{children:[`Per-sandbox tier limits exceeded (vCPU / memory / disk / session duration), or request-level `,_jsx(_components.code,{children:`resources`}),` field supplied`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`429`})}),_jsx(_components.td,{children:`Concurrent sandbox limit reached for your tier, or sandbox create rate limit exceeded`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`503`})}),_jsx(_components.td,{children:`Orchestrator is unavailable or the VM failed to start`})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create Sandbox","api":"POST /sandboxes","description":"Create a new isolated sandbox sandbox.","href":"/api-reference/sandbox/create"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Example","slug":"example","depth":2,"children":[]},{"title":"Error Responses","slug":"error-responses","depth":2,"children":[]}],"codeExamples":{},"endpoint":{"title":"Create Sandbox","path":"/sandboxes","servers":[{"url":"https://api.declaw.ai"}],"method":"post","request":{"security":[{"title":"API Key Auth","parameters":{"header":{"X-API-Key":{"type":"apiKey"}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"template":[{"type":"string","description":"Template name to base the sandbox on. Becomes the sandbox `name` and is prefixed with `tpl-` for the `template_id` . Defaults to an empty string (which uses the default base image). Example: `\"base\"`"}],"timeout":[{"type":"integer","description":"Auto-kill timeout in seconds. When the timeout expires the sandbox state is set to `killed` and the VM is terminated. Omit it for the 300-second default. `0` means no expiry and is accepted only by on-prem deployments; Declaw Cloud rejects it with `400` , and a value above your plan’s maximum session with `403` `tier_limit` . Example: `300`"}],"envs":[{"type":"object","properties":{},"description":"Environment variables to inject into the sandbox VM. Keys and values must be strings. Example: `{ \"OPENAI_API_KEY\": \"sk-...\" }`"}],"metadata":[{"type":"object","properties":{},"description":"Arbitrary key-value metadata stored with the sandbox. Useful for tagging sandboxes by project, run ID, or agent name. Example: `{ \"project\": \"my-agent\", \"run_id\": \"run-001\" }`"}],"network":[{"type":"object","properties":{"allow_out":[{"type":"array","items":[{"type":"string"}],"description":"Domains or CIDR ranges allowed for outbound traffic. Wildcards supported. Example: `[\"pypi.org\", \"*.github.com\"]`"}],"deny_out":[{"type":"array","items":[{"type":"string"}],"description":"IPs or CIDR ranges explicitly denied, plus `ALL_TRAFFIC` ( `\"*\"` / `\"0.0.0.0/0\"` ) to deny everything not allowlisted. `allow_out` takes precedence — a destination matching both is allowed , so `deny_out` cannot carve an exception out of an `allow_out` entry. Domain names in `deny_out` are ignored; express domain restrictions by allowlisting with `allow_out` instead. Example: `[\"10.0.0.0/8\"]`"}],"allow_public_traffic":[{"type":"boolean","description":"When `false` , all outbound traffic is denied unless explicitly in `allow_out` ."}]},"description":"Outbound network access controls."}],"security":[{"type":"object","properties":{},"description":"Full SecurityPolicy object (PII config, injection defense, transformation rules, audit config). Passed as a JSON object and stored verbatim. See the Security section for the complete schema."}],"lifecycle":[{"type":"object","properties":{"on_timeout":[{"type":"string","description":"`\"kill\"` destroys the sandbox when its timeout fires. `\"pause\"` takes a pause snapshot and hibernates it instead — the same as calling pause — so it can be resumed later. A pause that fails is retried a few times; if it still fails, the sandbox is killed instead. A paused sandbox is kept until it is resumed or killed. Any other value is rejected with `400` ."}],"auto_resume":[{"type":"boolean","description":"Reserved. Accepted and stored, but not yet acted on: a paused sandbox is resumed only by an explicit resume call."}]},"description":"Controls what happens when the sandbox timeout fires."}]}}],"examples":{"example":{"value":{"template":"\u003cstring>","timeout":123,"envs":{},"metadata":{},"network":{"allow_out":["\u003cstring>"],"deny_out":["\u003cstring>"],"allow_public_traffic":true},"security":{},"lifecycle":{"on_timeout":"\u003cstring>","auto_resume":true}}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"sandbox_id":[{"type":"string","description":"Unique sandbox identifier. Format: `sbx-\u003c8 chars>` ."}],"template_id":[{"type":"string","description":"Template ID used. Format: `tpl-\u003cname>` ."}],"state":[{"type":"string","description":"Always `\"running\"` on a freshly created sandbox."}],"envd_access_token":[{"type":"string","description":"Bearer token for direct envd daemon access. Used internally by the SDK."}],"traffic_access_token":[{"type":"string","description":"Bearer token for the security proxy. Used internally by the SDK."}],"guest_ip":[{"type":"string","description":"Internal IP address of the sandbox VM."}],"envd_port":[{"type":"integer","description":"Port on which envd listens. Typically `49983` ."}],"started_at":[{"type":"string","description":"UTC timestamp of sandbox creation."}]}}],"examples":{"example":{"value":{"sandbox_id":"\u003cstring>","template_id":"\u003cstring>","state":"\u003cstring>","envd_access_token":"\u003cstring>","traffic_access_token":"\u003cstring>","guest_ip":"\u003cstring>","envd_port":123,"started_at":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"declaw","siteName":"Declaw","title":"Create Sandbox - Declaw","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-07T08:27:26.120Z","originalFileLocation":"api-reference/sandbox/create.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create a new isolated sandbox sandbox.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Declaw\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/declaw/5qZO9alYltiMvEad/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/declaw/5qZO9alYltiMvEad/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/declaw/5qZO9alYltiMvEad/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/declaw/5qZO9alYltiMvEad/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/declaw/5qZO9alYltiMvEad/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/declaw/5qZO9alYltiMvEad/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/declaw/5qZO9alYltiMvEad/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/declaw/5qZO9alYltiMvEad/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/declaw/5qZO9alYltiMvEad/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create Sandbox - Declaw\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a new isolated sandbox sandbox.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Declaw\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.declaw.ai/api-reference/sandbox/create\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://declaw.mintlify.app/_mintlify/api/og/v2?division=Sandbox+API\u0026amp;title=Create+Sandbox\u0026amp;description=Create+a+new+isolated+sandbox+sandbox.\u0026amp;theme=e908f26a500811980d5ccfa6\u0026amp;signature=5e8112f136b9dfb002b7bd8f97f582cf8d4ba94760ee74644637e7a70229942a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Create Sandbox - Declaw\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a new isolated sandbox sandbox.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://declaw.mintlify.app/_mintlify/api/og/v2?division=Sandbox+API\u0026amp;title=Create+Sandbox\u0026amp;description=Create+a+new+isolated+sandbox+sandbox.\u0026amp;theme=e908f26a500811980d5ccfa6\u0026amp;signature=5e8112f136b9dfb002b7bd8f97f582cf8d4ba94760ee74644637e7a70229942a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/declaw/5qZO9alYltiMvEad/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Declaw\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.declaw.ai/api-reference/sandbox/create\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/sandbox/create.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.declaw.ai/#organization\",\"name\":\"Declaw\",\"url\":\"https://docs.declaw.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/declaw/YB_0u8lW6K_x_PnD/logo/light.svg?fit=max\u0026auto=format\u0026n=YB_0u8lW6K_x_PnD\u0026q=85\u0026s=3a1b3b5d14a7c974db1eda0b8d012499\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.declaw.ai#website\",\"name\":\"Declaw\",\"url\":\"https://docs.declaw.ai\",\"publisher\":{\"@id\":\"https://docs.declaw.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.declaw.ai/api-reference/sandbox/create#webpage\",\"url\":\"https://docs.declaw.ai/api-reference/sandbox/create\",\"name\":\"Create Sandbox\",\"description\":\"Create a new isolated sandbox sandbox.\",\"dateModified\":\"2026-10-07T08:27:26.120Z\",\"isPartOf\":{\"@id\":\"https://docs.declaw.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.declaw.ai/api-reference/sandbox/create#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.declaw.ai/api-reference/sandbox/create#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Sandbox API\",\"item\":\"https://docs.declaw.ai/api-reference/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Sandbox\",\"item\":\"https://docs.declaw.ai/api-reference/sandbox/create\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.declaw.ai/api-reference/sandbox/create#apireference\",\"headline\":\"Create Sandbox\",\"name\":\"Create Sandbox\",\"description\":\"Create a new isolated sandbox sandbox.\",\"url\":\"https://docs.declaw.ai/api-reference/sandbox/create\",\"mainEntityOfPage\":{\"@id\":\"https://docs.declaw.ai/api-reference/sandbox/create#webpage\"},\"dateModified\":\"2026-10-07T08:27:26.120Z\",\"publisher\":{\"@id\":\"https://docs.declaw.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.declaw.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Declaw\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Declaw","nav":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/bjA5Zs9ZPw"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Sandbox API","pages":[{"title":"API Overview","sidebarTitle":"Overview","href":"/api-reference/overview"},{"title":"Authentication","sidebarTitle":"Authentication","description":"How to authenticate requests to the Declaw API using the X-API-Key header.","href":"/api-reference/authentication"},{"title":"Create Sandbox","api":"POST /sandboxes","href":"/api-reference/sandbox/create"},{"title":"List Sandboxes","api":"GET /sandboxes","description":"Return the sandboxes visible to the authenticated API key, filtered and paged.","href":"/api-reference/sandbox/list"},{"title":"Get Sandbox","api":"GET /sandboxes/{sandbox_id}","href":"/api-reference/sandbox/get"},{"title":"Kill Sandbox","api":"DELETE /sandboxes/{sandbox_id}","href":"/api-reference/sandbox/kill"},{"title":"Get Sandbox Status","api":"GET /sandboxes/{sandbox_id}/status","href":"/api-reference/sandbox/status"},{"title":"Set Timeout","api":"PATCH /sandboxes/{sandbox_id}/timeout","href":"/api-reference/sandbox/set-timeout"},{"title":"Pause Sandbox","api":"POST /sandboxes/{sandbox_id}/pause","href":"/api-reference/sandbox/pause"},{"title":"Resume Sandbox","api":"POST /sandboxes/{sandbox_id}/resume","href":"/api-reference/sandbox/resume"},{"title":"Create Snapshot","api":"POST /sandboxes/{sandbox_id}/snapshot","href":"/api-reference/sandbox/create-snapshot"},{"title":"List Snapshots","api":"GET /sandboxes/{sandbox_id}/snapshots","href":"/api-reference/sandbox/list-snapshots"},{"title":"Restore Sandbox","api":"POST /sandboxes/{sandbox_id}/restore","href":"/api-reference/sandbox/restore"},{"title":"Fork Sandbox","api":"POST /sandboxes/{sandbox_id}/fork","href":"/api-reference/sandbox/fork"}]},{"group":"Command API","pages":[{"title":"Run Command","api":"POST /sandboxes/{sandbox_id}/commands","href":"/api-reference/command/run"},{"title":"Run Command (Stream)","api":"POST /sandboxes/{sandbox_id}/commands/stream","href":"/api-reference/command/run-stream"},{"title":"List Commands","api":"GET /sandboxes/{sandbox_id}/commands","href":"/api-reference/command/list"},{"title":"Kill Command","api":"DELETE /sandboxes/{sandbox_id}/commands/{pid}","href":"/api-reference/command/kill"},{"title":"Send Stdin","api":"POST /sandboxes/{sandbox_id}/commands/{pid}/stdin","href":"/api-reference/command/send-stdin"},{"title":"Wait for Command","api":"GET /sandboxes/{sandbox_id}/commands/{pid}/wait","href":"/api-reference/command/wait"}]},{"group":"Filesystem API","pages":[{"title":"Read File","api":"GET /sandboxes/{sandbox_id}/files","href":"/api-reference/filesystem/read"},{"title":"Write File","api":"POST /sandboxes/{sandbox_id}/files","href":"/api-reference/filesystem/write"},{"title":"Write File (Raw / Binary)","api":"PUT /sandboxes/{sandbox_id}/files/raw","href":"/api-reference/filesystem/write-raw"},{"title":"Write Files (Batch)","api":"POST /sandboxes/{sandbox_id}/files/batch","href":"/api-reference/filesystem/write-batch"},{"title":"List Directory","api":"GET /sandboxes/{sandbox_id}/files/list","href":"/api-reference/filesystem/list-dir"},{"title":"File Exists","api":"GET /sandboxes/{sandbox_id}/files/exists","href":"/api-reference/filesystem/exists"},{"title":"File Info","api":"GET /sandboxes/{sandbox_id}/files/info","href":"/api-reference/filesystem/info"},{"title":"Remove File","api":"DELETE /sandboxes/{sandbox_id}/files","href":"/api-reference/filesystem/remove"},{"title":"Rename / Move File","api":"PATCH /sandboxes/{sandbox_id}/files","href":"/api-reference/filesystem/rename"},{"title":"Make Directory","api":"POST /sandboxes/{sandbox_id}/files/mkdir","href":"/api-reference/filesystem/mkdir"},{"title":"Watch Directory","api":"POST /sandboxes/{sandbox_id}/files/watch","href":"/api-reference/filesystem/watch"}]},{"group":"Volumes API","pages":[{"title":"Create Volume","api":"POST /volumes","href":"/api-reference/volumes/create"},{"title":"List Volumes","api":"GET /volumes","href":"/api-reference/volumes/list"},{"title":"Get Volume","api":"GET /volumes/{volume_id}","href":"/api-reference/volumes/get"},{"title":"Delete Volume","api":"DELETE /volumes/{volume_id}","href":"/api-reference/volumes/delete"},{"title":"Download Volume","api":"GET /volumes/{volume_id}/download","href":"/api-reference/volumes/download"},{"title":"Create Empty Volume","api":"POST /volumes/empty","href":"/api-reference/volumes/create-empty"},{"title":"Ingest Volume","api":"POST /volumes/ingest","href":"/api-reference/volumes/ingest"},{"title":"Read Volume File","api":"GET /volumes/{volume_id}/files/raw","href":"/api-reference/volumes/read-file"},{"title":"Write Volume File","api":"PUT /volumes/{volume_id}/files/raw","href":"/api-reference/volumes/write-file"},{"title":"List Volume Directory","api":"GET /volumes/{volume_id}/files/list","href":"/api-reference/volumes/list-files"},{"title":"Stat Volume File","api":"GET /volumes/{volume_id}/files/info","href":"/api-reference/volumes/stat-file"},{"title":"Volume File Exists","api":"GET /volumes/{volume_id}/files/exists","href":"/api-reference/volumes/file-exists"},{"title":"Make Volume Directory","api":"POST /volumes/{volume_id}/files/mkdir","href":"/api-reference/volumes/mkdir"},{"title":"Remove Volume File","api":"DELETE /volumes/{volume_id}/files","href":"/api-reference/volumes/remove"},{"title":"Rename Volume File","api":"PATCH /volumes/{volume_id}/files","href":"/api-reference/volumes/rename"},{"title":"Acquire Volume Lock","api":"POST /volumes/{volume_id}/locks","href":"/api-reference/volumes/acquire-lock"},{"title":"Get Volume Lock Status","api":"GET /volumes/{volume_id}/locks","href":"/api-reference/volumes/lock-status"},{"title":"Renew Volume Lock","api":"POST /volumes/{volume_id}/locks/renew","href":"/api-reference/volumes/renew-lock"},{"title":"Release Volume Lock","api":"DELETE /volumes/{volume_id}/locks","href":"/api-reference/volumes/release-lock"},{"title":"Commit Attached Volume","api":"POST /sandboxes/{sandbox_id}/volumes/{volume_id}/commit","href":"/api-reference/volumes/commit"},{"title":"Snapshot Sandbox Path","api":"POST /sandboxes/{sandbox_id}/volumes/snapshot","href":"/api-reference/volumes/snapshot"}]}]},{"tab":"SDKs","pages":[{"title":"SDKs","href":"/sdks/python/overview"}]},{"tab":"Cookbook","pages":[{"title":"Cookbook","href":"/cookbook/overview"}]}]},"title":"Create Sandbox - Declaw","buildId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","deploymentId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-rfhihCWU.js","utils-BmH1XFxk.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-BcNsxPKB.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-BAES3tkd.js","snippetPresets-DCMQBKLP.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-D6l_bzE9.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BOktbnNh.js","shallow-BCs8SgM7.js","getApiPlaygroundDisplay-DEmW5bJB.js","CodeSnippet-CpZOpB9C.js","CodeSnippets-BOBDqibl.js","Page-D5fEM6aW.js","getPastedJson-DH2JBvmr.js","icon-BBJH-kKh.js","MethodPill-D2Sd5NLC.js","DuplicateIcon-CGgfL2qN.js","createIcon-BKudBBzi.js","DynamicMarkdown-85clUA0i.js","SectionHeading-D0JiMgDx.js","axios-vUo_bRtp.js"]}