API referenceSandboxes
Create Sandbox
Authorization
bearerAuth AuthorizationBearer <token>
Use a project API key for sandbox and runtime routes, or an OpenMetal user access token for account management routes.
In: header
Header Parameters
Idempotency-Key*stringLength
1–512X-Metal-Project-ID*stringPublic project ID used to scope sandbox access.
Match
^prj_[A-Za-z0-9]+$Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
provider?string | stringprovider
Variant 1
Values
blaxel, cloudflare, codesandbox, daytona, e2b, freestyle, modal, northflank, prime, runloop, vercelVariant 2
source*object | object | objectsource
Variant 1
kind*stringenvironment*stringLength
1–200version*stringLength
1–100DefaultlatestVariant 2
kind*stringimage*stringLength
1–500command?array<string>Variant 3
kind*stringprovider*stringValues
blaxel, cloudflare, codesandbox, daytona, e2b, freestyle, modal, northflank, prime, runloop, verceltemplate*stringLength
1–500resources*objectresources
vcpu*numbermemory_mb*integerRange
128–9007199254740991disk_mb?integerRange
0–9007199254740991architecture*stringValues
x86_64, arm64, anyDefaultanylifecycle*objectlifecycle
runtime_timeout_seconds*integerRange
1–172800idle_timeout_seconds?integerRange
1–9007199254740991on_runtime_timeout*stringValues
destroy, pauseDefaultdestroyon_idle_timeout*stringValues
destroy, pauseDefaultdestroyregions?array<string>features?objectfeatures
isolation?array<string>pty?booleanpause_resume?booleanpublic_ports?array<integer>computer_use?booleanrecording?objectrecording
format*stringDefault
mp4process?objectprocess
execute?booleanordered_output?booleancancel?booleanfilesystem?objectfilesystem
read?booleanwrite?booleanwrite_modes?array<string>create_parents?booleanlist?booleandelete?booleannetwork?objectnetwork
internet_access?booleanallow_domains?array<string>deny_domains?array<string>fallback?objectfallback
providers*array<string>max_attempts?integerRange
1–10provider_options?objectprovider_options
blaxel?objectblaxel
[key: string]?unknowncloudflare?objectcloudflare
[key: string]?unknowncodesandbox?objectcodesandbox
template_id?stringvm_tier?stringValues
Pico, Nano, Micro, Small, Medium, Large, XLargedaytona?objectdaytona
[key: string]?unknowne2b?objecte2b
template_id?stringfreestyle?objectfreestyle
snapshot_id?stringmodal?objectmodal
[key: string]?unknownnorthflank?objectnorthflank
deployment_plan?stringephemeral_storage_mb?integerRange
−∞–9007199254740991prime?objectprime
team_id?stringLength
1–∞runloop?objectrunloop
resource_size?stringValues
X_SMALL, SMALL, MEDIUM, LARGE, X_LARGE, XX_LARGEblueprint_id?stringvercel?objectvercel
[key: string]?unknownenvironment?objectenvironment
[key: string]?stringLength
0–16384secret_refs?objectsecret_refs
[key: string]?stringmetadata?objectmetadata
[key: string]?stringLength
0–500Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/sandboxes" \ -H "Idempotency-Key: string" \ -H "X-Metal-Project-ID: string" \ -H "Content-Type: application/json" \ -d '{ "source": { "kind": "environment", "environment": "string", "version": "latest" }, "resources": { "vcpu": 1, "memory_mb": 128, "architecture": "x86_64" }, "lifecycle": { "runtime_timeout_seconds": 1, "on_runtime_timeout": "destroy", "on_idle_timeout": "destroy" } }'{ "sandbox": { "id": "string", "type": "sandbox", "project_id": "string", "state": "requested", "state_reason": "string", "requested": { "provider": "blaxel", "source": { "kind": "environment", "environment": "string", "version": "latest" }, "resources": { "vcpu": 1, "memory_mb": 128, "disk_mb": 0, "architecture": "x86_64" }, "lifecycle": { "runtime_timeout_seconds": 1, "idle_timeout_seconds": 1, "on_runtime_timeout": "destroy", "on_idle_timeout": "destroy" }, "regions": [ "string" ], "features": { "isolation": [ "microvm" ], "pty": true, "pause_resume": true, "public_ports": [ 1 ], "computer_use": true, "recording": { "format": "mp4" }, "process": { "execute": true, "ordered_output": true, "cancel": true }, "filesystem": { "read": true, "write": true, "write_modes": [ "create" ], "create_parents": true, "list": true, "delete": true } }, "network": { "internet_access": true, "allow_domains": [ "string" ], "deny_domains": [ "string" ] }, "fallback": { "providers": [ "blaxel" ], "max_attempts": 1 }, "provider_options": { "blaxel": { "property1": null, "property2": null }, "cloudflare": { "property1": null, "property2": null }, "codesandbox": { "template_id": "string", "vm_tier": "Pico" }, "daytona": { "property1": null, "property2": null }, "e2b": { "template_id": "string" }, "freestyle": { "snapshot_id": "string" }, "modal": { "property1": null, "property2": null }, "northflank": { "deployment_plan": "string", "ephemeral_storage_mb": 1 }, "prime": { "team_id": "string" }, "runloop": { "resource_size": "X_SMALL", "blueprint_id": "string" }, "vercel": { "property1": null, "property2": null } }, "environment": { "property1": "string", "property2": "string" }, "secret_refs": { "property1": "string", "property2": "string" }, "metadata": { "property1": "string", "property2": "string" } }, "provider": "blaxel", "billing_mode": "managed", "resolved_resources": { "vcpu": 1, "memory_mb": 128, "disk_mb": 0, "architecture": "x86_64", "provider_size": "string" }, "cost_microusd": "string", "cost_updated_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "ready_at": "2019-08-24T14:15:22Z", "paused_at": "2019-08-24T14:15:22Z", "stopped_at": "2019-08-24T14:15:22Z", "metadata": { "property1": "string", "property2": "string" } }, "operation": { "id": "string", "project_id": "string", "type": "sandbox_create", "state": "queued", "resource_type": "sandbox", "resource_id": "string", "retryable": true, "error": { "code": "string", "message": "string", "retryable": true, "details": { "property1": null, "property2": null } }, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "completed_at": "2019-08-24T14:15:22Z" }}