{"openapi":"3.1.0","info":{"title":"Styne sandbox API","version":"0.1.0","description":"Isolated Linux sandboxes for AI agents: create from a template, run commands, files, fork, snapshots, pause and resume. Documentation: https://docs.styne.ai. The E2B SDK works unchanged with E2B_API_URL=https://api.styne.ai."},"servers":[{"url":"https://api.styne.ai"}],"security":[{"bearerAuth":[]}],"externalDocs":{"description":"Styne sandboxes documentation","url":"https://docs.styne.ai"},"tags":[{"name":"Quickstart","externalDocs":{"url":"https://docs.styne.ai/quickstart"}},{"name":"Templates","externalDocs":{"url":"https://docs.styne.ai/guide-templates"}},{"name":"Run commands","externalDocs":{"url":"https://docs.styne.ai/exec"}},{"name":"Files","externalDocs":{"url":"https://docs.styne.ai/files"}},{"name":"Fork","externalDocs":{"url":"https://docs.styne.ai/fork"}},{"name":"Snapshots","externalDocs":{"url":"https://docs.styne.ai/snapshots"}},{"name":"Volumes","externalDocs":{"url":"https://docs.styne.ai/volumes"}},{"name":"Logs and metrics","externalDocs":{"url":"https://docs.styne.ai/observability"}},{"name":"Timeouts, pause and resume","externalDocs":{"url":"https://docs.styne.ai/pause-tiers"}},{"name":"Plans and billing","externalDocs":{"url":"https://docs.styne.ai/billing"}},{"name":"Agent sign-up","externalDocs":{"url":"https://docs.styne.ai/agent-signup"}},{"name":"Ports and preview URLs","externalDocs":{"url":"https://docs.styne.ai/ports"}},{"name":"SSH and port forwarding","externalDocs":{"url":"https://docs.styne.ai/ssh"}},{"name":"Run a coding agent in a sandbox","externalDocs":{"url":"https://docs.styne.ai/agents"}},{"name":"State store","externalDocs":{"url":"https://docs.styne.ai/state"}},{"name":"Calls between sandboxes","externalDocs":{"url":"https://docs.styne.ai/calls"}},{"name":"Wake triggers and schedules","externalDocs":{"url":"https://docs.styne.ai/wake-triggers"}},{"name":"Checkpoints and rewind","externalDocs":{"url":"https://docs.styne.ai/checkpoints"}},{"name":"Container images","externalDocs":{"url":"https://docs.styne.ai/images"}}],"paths":{"/sandboxes":{"post":{"operationId":"sandboxes.create","summary":"Create a sandbox from a template","tags":["Quickstart"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Create a sandbox. Name a template (templateID), a saved snapshot (snapshot) or a size; with none of them the default size is used.","properties":{"templateID":{"type":"string","description":"Template id or alias from GET /templates, for example base, code, small, large or browser."},"snapshot":{"type":"string","description":"Name of a saved snapshot of your account to start from; replaces templateID."},"size":{"type":"string","description":"The standard image at this size; replaces templateID.","enum":["small","default","large","xlarge"]},"image":{"type":"string","description":"A container image to start from, for example alpine, python:3.12-slim or ghcr.io/org/app:tag; excludes templateID and snapshot. It starts on a node that holds a prepared build of the image; an image nobody prepared is a 404."},"timeout":{"type":"integer","description":"Seconds until the sandbox times out."},"idleTimeout":{"type":"integer","minimum":0,"maximum":3600,"description":"Seconds without a call or connection after which the sandbox sleeps even if a process runs inside it; it wakes on the next call. 0 or absent: it sleeps only when nothing of yours runs inside."},"autoPause":{"type":"boolean","description":"Pause instead of kill when the timeout is reached."},"autoResume":{"description":"Resume a paused sandbox on the next request: true, or {\"enabled\": true} as the SDKs send it.","oneOf":[{"type":"boolean"},{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}]},"lifecycle":{"type":"object","description":"What happens at the timeout.","properties":{"onTimeout":{"type":"string","description":"kill or pause.","enum":["kill","pause"]},"autoResume":{"type":"boolean","description":"Resume on the next request after a pause."}}},"secure":{"type":"boolean","description":"Require the access token on every sandbox call."},"allow_internet_access":{"type":"boolean","description":"false blocks outbound internet access from the sandbox. Snake case, as the E2B SDK sends it."},"network":{"type":"object","description":"Network rules.","properties":{"allowPublicTraffic":{"type":"boolean","description":"Serve the sandbox ports without the traffic token."},"allowOut":{"type":"array","description":"Outbound destinations allowed.","items":{"type":"string"}},"denyOut":{"type":"array","description":"Outbound destinations blocked.","items":{"type":"string"}},"maskRequestHost":{"type":"string","description":"Host header sent to the sandbox port."}}},"metadata":{"type":"object","description":"String keys and values.","additionalProperties":{"type":"string"}},"envVars":{"type":"object","description":"Environment variables set in every command of the sandbox.","additionalProperties":{"type":"string"}},"environment":{"type":"string","description":"Stored environment to start from; the account default when left out."},"vcpus":{"type":"integer","description":"vCPUs the sandbox needs; a request above the template size is refused."},"memory_mib":{"type":"integer","description":"Memory in MiB the sandbox needs; a request above the template size is refused."},"volumeMounts":{"type":"array","description":"Volumes of your account to mount, by name or id. The sandbox runs on the node that keeps them; see Volumes.","items":{"type":"object","properties":{"name":{"type":"string","description":"Volume name or id."},"path":{"type":"string","description":"Mount path inside the sandbox."},"readOnly":{"type":"boolean","description":"Mount read-only."}},"required":["name","path"]}}}}}}},"externalDocs":{"description":"Quickstart","url":"https://docs.styne.ai/quickstart"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/quickstart."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"sandboxes.list","summary":"List the account's sandboxes","tags":["Quickstart"],"parameters":[{"name":"state","in":"query","required":false,"description":"Comma-separated states to list (running, paused); running only when left out.","schema":{"type":"string"}},{"name":"metadata","in":"query","required":false,"description":"Encoded k=v&k2=v2 filter on metadata.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Most sandboxes to return.","schema":{"type":"integer"}}],"externalDocs":{"description":"Quickstart","url":"https://docs.styne.ai/quickstart"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/quickstart."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}":{"get":{"operationId":"sandboxes.get","summary":"Read one sandbox","tags":["Quickstart"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Quickstart","url":"https://docs.styne.ai/quickstart"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/quickstart."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"sandboxes.delete","summary":"Kill a sandbox","tags":["Quickstart"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Quickstart","url":"https://docs.styne.ai/quickstart"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/quickstart."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates":{"get":{"operationId":"templates.list","summary":"List the templates the key can start","tags":["Quickstart"],"externalDocs":{"description":"Quickstart","url":"https://docs.styne.ai/quickstart"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/quickstart."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/regions":{"get":{"operationId":"regions.list","summary":"List the regions and whether a machine there takes new VMs now","tags":["Quickstart"],"externalDocs":{"description":"Quickstart","url":"https://docs.styne.ai/quickstart"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/quickstart."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates/{id}":{"get":{"operationId":"templates.get","summary":"One template by id or alias","tags":["Quickstart"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Quickstart","url":"https://docs.styne.ai/quickstart"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/quickstart."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"templates.delete","summary":"Delete a saved snapshot by its template id, at the path the E2B SDK uses; answers 204","tags":["Templates"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Templates","url":"https://docs.styne.ai/guide-templates"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/guide-templates."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/templates/aliases/{alias}":{"get":{"operationId":"templates.aliases","summary":"Resolve a template alias to its template id","tags":["Templates"],"parameters":[{"name":"alias","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Templates","url":"https://docs.styne.ai/guide-templates"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/guide-templates."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/default-templates":{"get":{"operationId":"templates.default","summary":"List the templates the key can start, at the path the E2B SDK reads","tags":["Templates"],"externalDocs":{"description":"Templates","url":"https://docs.styne.ai/guide-templates"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/guide-templates."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v2/templates":{"get":{"operationId":"templates.v2","summary":"List the templates the key can start, at the E2B v2 path","tags":["Templates"],"externalDocs":{"description":"Templates","url":"https://docs.styne.ai/guide-templates"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/guide-templates."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/exec":{"post":{"operationId":"sandboxes.exec","summary":"Run a command and stream its output","tags":["Run commands"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Run one command and wait for it to finish. Give cmd (run through a shell unless argv is set) or argv.","properties":{"cmd":{"type":"string","description":"The command line."},"args":{"type":"array","items":{"type":"string"},"description":"Arguments appended to cmd."},"argv":{"type":"array","items":{"type":"string"},"description":"The command as an argument vector, run without a shell."},"shell":{"type":"string","description":"Shell used for cmd; /bin/sh when left out."},"envs":{"type":"object","additionalProperties":{"type":"string"},"description":"Environment variables for this command (also accepted as env or envVars)."},"cwd":{"type":"string","description":"Working directory."},"user":{"type":"string","description":"User to run as."},"timeoutMs":{"type":"integer","description":"Milliseconds before the command is stopped."},"stdin":{"type":"boolean","description":"Keep standard input open for later input calls."},"pty":{"description":"Run on a pseudo-terminal of this size ({rows, cols})."}}}}}},"externalDocs":{"description":"Run commands","url":"https://docs.styne.ai/exec"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/exec."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/commands":{"post":{"operationId":"commands.start","summary":"Run a command to its exit, or start it detached","tags":["Run commands"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Start a command and return its pid at once; read it with the command calls. Same fields as exec, plus detached.","properties":{"cmd":{"type":"string","description":"The command line."},"args":{"type":"array","items":{"type":"string"},"description":"Arguments appended to cmd."},"argv":{"type":"array","items":{"type":"string"},"description":"The command as an argument vector, run without a shell."},"shell":{"type":"string","description":"Shell used for cmd; /bin/sh when left out."},"envs":{"type":"object","additionalProperties":{"type":"string"},"description":"Environment variables for this command (also accepted as env or envVars)."},"cwd":{"type":"string","description":"Working directory."},"user":{"type":"string","description":"User to run as."},"timeoutMs":{"type":"integer","description":"Milliseconds before the command is stopped."},"stdin":{"type":"boolean","description":"Keep standard input open for later input calls."},"pty":{"description":"Run on a pseudo-terminal of this size ({rows, cols})."}}}}}},"externalDocs":{"description":"Run commands","url":"https://docs.styne.ai/exec"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/exec."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/commands/{pid}":{"get":{"operationId":"commands.status","summary":"Read a command's status by pid","tags":["Run commands"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"pid","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Run commands","url":"https://docs.styne.ai/exec"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/exec."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"commands.stop","summary":"Signal a running command","tags":["Run commands"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"pid","in":"path","required":true,"schema":{"type":"string"}},{"name":"signal","in":"query","required":false,"description":"15 or TERM (default), 9 or KILL.","schema":{"type":"string"}}],"externalDocs":{"description":"Run commands","url":"https://docs.styne.ai/exec"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/exec."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/commands/{pid}/stream":{"get":{"operationId":"commands.stream","summary":"Replay and follow a command's output","tags":["Run commands"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"pid","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Run commands","url":"https://docs.styne.ai/exec"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/exec."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/commands/{pid}/input":{"post":{"operationId":"commands.input","summary":"Write text to a running command's stdin, and close it with eof","tags":["Run commands"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"pid","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Send input to a running command.","properties":{"data":{"type":"string","description":"Text written to the command's standard input."},"eof":{"type":"boolean","description":"Close standard input after the data."}}}}}},"externalDocs":{"description":"Run commands","url":"https://docs.styne.ai/exec"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/exec."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/command-history":{"get":{"operationId":"commands.history","summary":"List the sandbox's commands, newest first","tags":["Run commands"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Most entries to return.","schema":{"type":"integer"}},{"name":"status","in":"query","required":false,"description":"Only commands with this status.","schema":{"type":"string"}}],"externalDocs":{"description":"Run commands","url":"https://docs.styne.ai/exec"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/exec."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/command-history/{cid}":{"get":{"operationId":"commands.get","summary":"Read one command of the history","tags":["Run commands"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cid","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Run commands","url":"https://docs.styne.ai/exec"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/exec."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/command-history/{cid}/logs":{"get":{"operationId":"commands.logs","summary":"Read a command's stdout and stderr, also after it ended","tags":["Run commands"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"cid","in":"path","required":true,"schema":{"type":"string"}},{"name":"stream","in":"query","required":false,"description":"stdout, stderr or all (default).","schema":{"type":"string","enum":["all","stdout","stderr"]}},{"name":"encoding","in":"query","required":false,"description":"text (default) or base64.","schema":{"type":"string","enum":["text","base64"]}}],"externalDocs":{"description":"Run commands","url":"https://docs.styne.ai/exec"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/exec."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/code":{"post":{"operationId":"sandboxes.code","summary":"Run code in a kernel context; answers its output, results and error","tags":["Run commands"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Run a code cell in a persistent interpreter context.","properties":{"code":{"type":"string","description":"The source to run."},"language":{"type":"string","description":"Interpreter language, for example python or javascript."},"contextId":{"type":"string","description":"Run in this context to keep its variables; a new context when left out."},"env":{"type":"object","additionalProperties":{"type":"string"},"description":"Environment variables for this run."}}}}}},"externalDocs":{"description":"Run commands","url":"https://docs.styne.ai/exec"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/exec."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/files":{"get":{"operationId":"sandboxes.files.read","summary":"Read a file: the bytes of the file at the path query","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":false,"description":"Absolute path of the file or directory in the sandbox.","schema":{"type":"string"}}],"externalDocs":{"description":"Files","url":"https://docs.styne.ai/files"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/files."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"sandboxes.files.write","summary":"Write a file: the request body is the content; folders on the way are created","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":false,"description":"Absolute path of the file or directory in the sandbox.","schema":{"type":"string"}}],"externalDocs":{"description":"Files","url":"https://docs.styne.ai/files"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/files."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"sandboxes.files.delete","summary":"Delete a file or folder; answers 204","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":false,"description":"Absolute path of the file or directory in the sandbox.","schema":{"type":"string"}}],"externalDocs":{"description":"Files","url":"https://docs.styne.ai/files"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/files."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/files/list":{"get":{"operationId":"sandboxes.files.list","summary":"List a directory","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"path","in":"query","required":false,"description":"Absolute path of the file or directory in the sandbox.","schema":{"type":"string"}}],"externalDocs":{"description":"Files","url":"https://docs.styne.ai/files"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/files."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/files/search":{"post":{"operationId":"sandboxes.files.search","summary":"Find files by name under a path","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Files","url":"https://docs.styne.ai/files"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/files."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/files/find":{"post":{"operationId":"sandboxes.files.find","summary":"Find text in the files under a path","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Files","url":"https://docs.styne.ai/files"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/files."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/files/replace":{"post":{"operationId":"sandboxes.files.replace","summary":"Replace text across files","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Files","url":"https://docs.styne.ai/files"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/files."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/files/permissions":{"post":{"operationId":"sandboxes.files.permissions","summary":"Set mode, owner and group of a path","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Files","url":"https://docs.styne.ai/files"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/files."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/files/signed-url":{"post":{"operationId":"sandboxes.files.signed-url","summary":"Make a short-lived upload or download URL for one file","tags":["Files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Files","url":"https://docs.styne.ai/files"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/files."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/fork":{"post":{"operationId":"sandboxes.fork","summary":"Fork a running sandbox into copies","tags":["Fork"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Copy a running sandbox into one or more children. The body is optional.","properties":{"count":{"type":"integer","description":"Number of children, 1 to 1000; 1 when left out."},"timeout":{"type":"integer","description":"Seconds the children live; the parent's timeout when left out."},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"String keys and values set on every child."}}}}}},"externalDocs":{"description":"Fork","url":"https://docs.styne.ai/fork"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/fork."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/snapshots":{"post":{"operationId":"snapshots.save","summary":"Save a sandbox as a named snapshot","tags":["Snapshots"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Save the sandbox's memory and disk as a snapshot. The body is optional.","properties":{"name":{"type":"string","description":"Snapshot name; generated when left out."}}}}}},"externalDocs":{"description":"Snapshots","url":"https://docs.styne.ai/snapshots"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/snapshots."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"snapshots.list_of_sandbox","summary":"List the snapshots taken of one sandbox","tags":["Snapshots"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Snapshots","url":"https://docs.styne.ai/snapshots"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/snapshots."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/snapshots":{"get":{"operationId":"snapshots.list","summary":"List the account's saved snapshots","tags":["Snapshots"],"externalDocs":{"description":"Snapshots","url":"https://docs.styne.ai/snapshots"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/snapshots."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"snapshots.delete_all","summary":"Delete every saved snapshot of the account","tags":["Snapshots"],"externalDocs":{"description":"Snapshots","url":"https://docs.styne.ai/snapshots"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/snapshots."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/snapshots/{name}":{"get":{"operationId":"snapshots.get","summary":"Read one saved snapshot","tags":["Snapshots"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Snapshots","url":"https://docs.styne.ai/snapshots"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/snapshots."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"snapshots.delete","summary":"Delete a saved snapshot","tags":["Snapshots"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Snapshots","url":"https://docs.styne.ai/snapshots"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/snapshots."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/snapshots/{name}/tree":{"get":{"operationId":"snapshots.tree","summary":"List the files inside a saved snapshot","tags":["Snapshots"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Snapshots","url":"https://docs.styne.ai/snapshots"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/snapshots."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/snapshots/{name}/files":{"get":{"operationId":"snapshots.file","summary":"Download one file from a saved snapshot","tags":["Snapshots"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Snapshots","url":"https://docs.styne.ai/snapshots"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/snapshots."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/snapshots/{name}/archive":{"get":{"operationId":"snapshots.archive","summary":"Download a file or folder of a saved snapshot as a tar","tags":["Snapshots"],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Snapshots","url":"https://docs.styne.ai/snapshots"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/snapshots."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/volumes":{"post":{"operationId":"volumes.create","summary":"Create a volume","tags":["Volumes"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Create an empty ext4 volume.","required":["name"],"properties":{"name":{"type":"string","description":"Unique in the account."},"sizeMB":{"type":"integer","description":"Size in MiB, 1024 to 102400; 10240 by default."},"region":{"type":"string","description":"Region id; the default of a sandbox create when left out."}}}}}},"externalDocs":{"description":"Volumes","url":"https://docs.styne.ai/volumes"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/volumes."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"volumes.list","summary":"List the account's volumes","tags":["Volumes"],"externalDocs":{"description":"Volumes","url":"https://docs.styne.ai/volumes"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/volumes."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/volumes/{id}":{"get":{"operationId":"volumes.get","summary":"Read one volume by name or id","tags":["Volumes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Volumes","url":"https://docs.styne.ai/volumes"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/volumes."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"volumes.delete","summary":"Delete a volume","tags":["Volumes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Volumes","url":"https://docs.styne.ai/volumes"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/volumes."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/logs":{"get":{"operationId":"sandboxes.logs","summary":"Read the output of a sandbox's commands","tags":["Logs and metrics"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Most lines to return.","schema":{"type":"integer"}},{"name":"start","in":"query","required":false,"description":"First line offset.","schema":{"type":"integer"}},{"name":"end","in":"query","required":false,"description":"Last line offset.","schema":{"type":"integer"}},{"name":"stream","in":"query","required":false,"description":"stdout, stderr or all (default).","schema":{"type":"string","enum":["all","stdout","stderr"]}}],"externalDocs":{"description":"Logs and metrics","url":"https://docs.styne.ai/observability"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/observability."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/metrics":{"get":{"operationId":"sandboxes.metrics","summary":"Read a sandbox's CPU, memory and disk over time","tags":["Logs and metrics"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Logs and metrics","url":"https://docs.styne.ai/observability"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/observability."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/pause":{"post":{"operationId":"sandboxes.pause","summary":"Pause a sandbox at a tier","tags":["Timeouts, pause and resume"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Pause the sandbox. The body is optional.","properties":{"tier":{"type":"string","enum":["memory","hot","standby","archived"],"description":"Where the paused memory is kept: memory (or hot, the default) on the node, standby on the node's disk, archived also in object storage."}}}}}},"externalDocs":{"description":"Timeouts, pause and resume","url":"https://docs.styne.ai/pause-tiers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/pause-tiers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/resume":{"post":{"operationId":"sandboxes.resume","summary":"Resume a paused sandbox","tags":["Timeouts, pause and resume"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Resume a paused sandbox. The body is optional.","properties":{"timeout":{"type":"integer","description":"Seconds the sandbox lives after the resume."}}}}}},"externalDocs":{"description":"Timeouts, pause and resume","url":"https://docs.styne.ai/pause-tiers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/pause-tiers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/connect":{"post":{"operationId":"sandboxes.connect","summary":"Return a sandbox and resume it if it is paused","tags":["Timeouts, pause and resume"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Connect to a sandbox, resuming it if it is paused. The body is optional.","properties":{"timeout":{"type":"integer","description":"Seconds the sandbox lives from now, if longer than what is left."}}}}}},"externalDocs":{"description":"Timeouts, pause and resume","url":"https://docs.styne.ai/pause-tiers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/pause-tiers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/timeout":{"post":{"operationId":"sandboxes.timeout","summary":"Set a new lifetime for a running sandbox","tags":["Timeouts, pause and resume"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Set how long the sandbox lives from now.","properties":{"timeout":{"type":"integer","description":"Seconds the sandbox lives from now."}}}}}},"externalDocs":{"description":"Timeouts, pause and resume","url":"https://docs.styne.ai/pause-tiers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/pause-tiers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/refreshes":{"post":{"operationId":"sandboxes.refresh","summary":"Extend the lifetime of a running sandbox","tags":["Timeouts, pause and resume"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Extend the sandbox's life.","properties":{"duration":{"type":"integer","description":"Seconds the sandbox lives from now, if longer than what is left."}}}}}},"externalDocs":{"description":"Timeouts, pause and resume","url":"https://docs.styne.ai/pause-tiers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/pause-tiers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/run/usage":{"get":{"operationId":"usage.read","summary":"Read the plan, hours used and caps of the account","tags":["Plans and billing"],"externalDocs":{"description":"Plans and billing","url":"https://docs.styne.ai/billing"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/billing."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/run/balance":{"get":{"operationId":"balance.read","summary":"Read the dollar balance of the account","tags":["Plans and billing"],"externalDocs":{"description":"Plans and billing","url":"https://docs.styne.ai/billing"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/billing."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent/signup":{"post":{"operationId":"agent.signup","summary":"Create an account and a limited key without a person; returns a claim link","tags":["Agent sign-up"],"externalDocs":{"description":"Agent sign-up","url":"https://docs.styne.ai/agent-signup"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/agent-signup."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent/claim/{token}":{"get":{"operationId":"agent.claim.state","summary":"Read whether a claim link is open, claimed or expired","tags":["Agent sign-up"],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Agent sign-up","url":"https://docs.styne.ai/agent-signup"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/agent-signup."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/ports":{"get":{"operationId":"sandboxes.ports.list","summary":"List the ports a sandbox exposes, with URL and public flag","tags":["Ports and preview URLs"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Ports and preview URLs","url":"https://docs.styne.ai/ports"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/ports."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"sandboxes.ports.expose","summary":"Expose a port, public (no token) or token-gated","tags":["Ports and preview URLs"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Expose a sandbox port on a public URL.","properties":{"port":{"type":"integer","description":"The port inside the sandbox."},"public":{"type":"boolean","description":"Serve it without the traffic token."}}}}}},"externalDocs":{"description":"Ports and preview URLs","url":"https://docs.styne.ai/ports"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/ports."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/ports/{port}":{"delete":{"operationId":"sandboxes.ports.hide","summary":"Hide an exposed port again","tags":["Ports and preview URLs"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"port","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Ports and preview URLs","url":"https://docs.styne.ai/ports"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/ports."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/ssh-keys":{"get":{"operationId":"sandboxes.sshKeys.list","summary":"List the SSH public keys authorized on a sandbox","tags":["SSH and port forwarding"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"SSH and port forwarding","url":"https://docs.styne.ai/ssh"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/ssh."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"sandboxes.sshKeys.add","summary":"Authorize an OpenSSH public key and get the host, port and user to connect to","tags":["SSH and port forwarding"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Add an SSH public key to the sandbox.","properties":{"publicKey":{"type":"string","description":"The public key in authorized_keys format."}}}}}},"externalDocs":{"description":"SSH and port forwarding","url":"https://docs.styne.ai/ssh"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/ssh."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/ssh-keys/{keyId}":{"delete":{"operationId":"sandboxes.sshKeys.remove","summary":"Revoke an authorized SSH public key","tags":["SSH and port forwarding"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"keyId","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"SSH and port forwarding","url":"https://docs.styne.ai/ssh"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/ssh."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/prompt":{"post":{"operationId":"sandboxes.prompt","summary":"Prompt a coding agent (Claude Code, Codex) in a sandbox","tags":["Run a coding agent in a sandbox"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Send a prompt to the coding agent in the sandbox.","properties":{"prompt":{"type":"string","description":"The prompt (also accepted as message or text)."},"harness":{"type":"string","description":"The agent to run, for example claude-code."},"model":{"type":"string","description":"Model the agent uses."},"new":{"type":"boolean","description":"Start a new conversation."},"conversationId":{"type":"string","description":"Continue this conversation."},"env":{"type":"object","additionalProperties":{"type":"string"},"description":"The customer's model credentials and other variables the agent reads."},"permissionMode":{"type":"string","description":"The agent's permission mode."},"cwd":{"type":"string","description":"Working directory."},"partial":{"type":"boolean","description":"Claude Code: stream partial messages."}}}}}},"externalDocs":{"description":"Run a coding agent in a sandbox","url":"https://docs.styne.ai/agents"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/agents."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/prompts/{promptId}":{"get":{"operationId":"sandboxes.prompts.get","summary":"Read the status of one prompt","tags":["Run a coding agent in a sandbox"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"promptId","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Run a coding agent in a sandbox","url":"https://docs.styne.ai/agents"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/agents."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/conversations":{"get":{"operationId":"sandboxes.conversations.list","summary":"List the agent conversations of a sandbox","tags":["Run a coding agent in a sandbox"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Run a coding agent in a sandbox","url":"https://docs.styne.ai/agents"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/agents."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/conversations/{conversationId}":{"get":{"operationId":"sandboxes.conversations.get","summary":"Read one agent conversation","tags":["Run a coding agent in a sandbox"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"conversationId","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Run a coding agent in a sandbox","url":"https://docs.styne.ai/agents"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/agents."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/events":{"get":{"operationId":"sandboxes.events","summary":"Read or follow the agent events of a sandbox","tags":["Run a coding agent in a sandbox"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"after","in":"query","required":false,"description":"Only events after this sequence number.","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Most events to return.","schema":{"type":"integer"}}],"externalDocs":{"description":"Run a coding agent in a sandbox","url":"https://docs.styne.ai/agents"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/agents."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/steer":{"post":{"operationId":"sandboxes.steer","summary":"Steer a running agent turn with a new message","tags":["Run a coding agent in a sandbox"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Redirect the running agent turn with a new prompt. Same fields as the prompt call.","properties":{"prompt":{"type":"string","description":"The prompt (also accepted as message or text)."},"harness":{"type":"string","description":"The agent to run, for example claude-code."},"model":{"type":"string","description":"Model the agent uses."},"new":{"type":"boolean","description":"Start a new conversation."},"conversationId":{"type":"string","description":"Continue this conversation."},"env":{"type":"object","additionalProperties":{"type":"string"},"description":"The customer's model credentials and other variables the agent reads."},"permissionMode":{"type":"string","description":"The agent's permission mode."},"cwd":{"type":"string","description":"Working directory."},"partial":{"type":"boolean","description":"Claude Code: stream partial messages."}}}}}},"externalDocs":{"description":"Run a coding agent in a sandbox","url":"https://docs.styne.ai/agents"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/agents."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/interrupt":{"post":{"operationId":"sandboxes.interrupt","summary":"Interrupt the running agent turns of a sandbox","tags":["Run a coding agent in a sandbox"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Interrupt the running agent turn.","properties":{"conversation":{"type":"string","description":"The conversation to interrupt."}}}}}},"externalDocs":{"description":"Run a coding agent in a sandbox","url":"https://docs.styne.ai/agents"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/agents."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/state":{"get":{"operationId":"state.usage","summary":"The account's state usage and ceilings","tags":["State store"],"externalDocs":{"description":"State store","url":"https://docs.styne.ai/state"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/state."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/state/{ns}":{"get":{"operationId":"state.list","summary":"List the keys of a state namespace","tags":["State store"],"parameters":[{"name":"ns","in":"path","required":true,"schema":{"type":"string"}},{"name":"prefix","in":"query","required":false,"description":"Only keys starting with this.","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"Continue after this cursor.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Most keys to return.","schema":{"type":"integer"}},{"name":"values","in":"query","required":false,"description":"Include the values.","schema":{"type":"boolean"}}],"externalDocs":{"description":"State store","url":"https://docs.styne.ai/state"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/state."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"state.drop","summary":"Delete a state namespace","tags":["State store"],"parameters":[{"name":"ns","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"State store","url":"https://docs.styne.ai/state"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/state."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/state/{ns}/{key}":{"get":{"operationId":"state.get","summary":"Read a state value","tags":["State store"],"parameters":[{"name":"ns","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"State store","url":"https://docs.styne.ai/state"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/state."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"state.put","summary":"Write a state value, optionally at a version","tags":["State store"],"parameters":[{"name":"ns","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"State store","url":"https://docs.styne.ai/state"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/state."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"state.delete","summary":"Delete a state value","tags":["State store"],"parameters":[{"name":"ns","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"State store","url":"https://docs.styne.ai/state"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/state."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/state":{"get":{"operationId":"sandboxes.state.list","summary":"List the keys of a sandbox's own state","tags":["State store"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"prefix","in":"query","required":false,"description":"Only keys starting with this.","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"Continue after this cursor.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Most keys to return.","schema":{"type":"integer"}},{"name":"values","in":"query","required":false,"description":"Include the values.","schema":{"type":"boolean"}}],"externalDocs":{"description":"State store","url":"https://docs.styne.ai/state"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/state."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/state/{key}":{"get":{"operationId":"sandboxes.state.get","summary":"Read a value of a sandbox's own state","tags":["State store"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"State store","url":"https://docs.styne.ai/state"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/state."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"sandboxes.state.put","summary":"Write a value of a sandbox's own state","tags":["State store"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"State store","url":"https://docs.styne.ai/state"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/state."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"sandboxes.state.delete","summary":"Delete a value of a sandbox's own state","tags":["State store"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"State store","url":"https://docs.styne.ai/state"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/state."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/names":{"get":{"operationId":"names.list","summary":"List the account's sandbox names","tags":["Calls between sandboxes"],"externalDocs":{"description":"Calls between sandboxes","url":"https://docs.styne.ai/calls"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/calls."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/triggers":{"post":{"operationId":"triggers.create","summary":"Add a schedule or webhook trigger to a sandbox","tags":["Wake triggers and schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Create a trigger that delivers events into the sandbox.","properties":{"type":{"description":"schedule or webhook."},"schedule":{"description":"For a schedule trigger: when it fires (see the triggers page)."},"webhook":{"description":"For a webhook trigger: {verify, secret}."},"deliver":{"description":"Where an event goes: {type: http, port, path}, {type: file, dir} or {type: command, command, timeout_seconds}."},"keep_awake_seconds":{"type":"integer","description":"Seconds the sandbox is kept awake after an event."}},"required":["type","deliver"]}}}},"externalDocs":{"description":"Wake triggers and schedules","url":"https://docs.styne.ai/wake-triggers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/wake-triggers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"triggers.list","summary":"List a sandbox's triggers","tags":["Wake triggers and schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Wake triggers and schedules","url":"https://docs.styne.ai/wake-triggers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/wake-triggers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/triggers/{trigger}":{"get":{"operationId":"triggers.get","summary":"One trigger, with next_fire_at for a schedule","tags":["Wake triggers and schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"trigger","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Wake triggers and schedules","url":"https://docs.styne.ai/wake-triggers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/wake-triggers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"triggers.update","summary":"Enable or disable a trigger, or change its keep-awake time","tags":["Wake triggers and schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"trigger","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Change a trigger. Every field is optional.","properties":{"enabled":{"type":"boolean","description":"Turn the trigger on or off."},"keep_awake_seconds":{"type":"integer","description":"Seconds the sandbox is kept awake after an event."}}}}}},"externalDocs":{"description":"Wake triggers and schedules","url":"https://docs.styne.ai/wake-triggers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/wake-triggers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"triggers.delete","summary":"Delete a trigger","tags":["Wake triggers and schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"trigger","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Wake triggers and schedules","url":"https://docs.styne.ai/wake-triggers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/wake-triggers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/triggers/{trigger}/events":{"get":{"operationId":"triggers.events","summary":"List a trigger's events with their delivery status","tags":["Wake triggers and schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"trigger","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Only events in this state.","schema":{"type":"string","enum":["pending","delivering","delivered","dead"]}},{"name":"body","in":"query","required":false,"description":"Include each event's body.","schema":{"type":"boolean"}},{"name":"limit","in":"query","required":false,"description":"Most events to return.","schema":{"type":"integer"}}],"externalDocs":{"description":"Wake triggers and schedules","url":"https://docs.styne.ai/wake-triggers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/wake-triggers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/triggers/{trigger}/events/{event}/retry":{"post":{"operationId":"triggers.retry","summary":"Send a dead event again","tags":["Wake triggers and schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"trigger","in":"path","required":true,"schema":{"type":"string"}},{"name":"event","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Wake triggers and schedules","url":"https://docs.styne.ai/wake-triggers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/wake-triggers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/triggers/{trigger}/fire":{"post":{"operationId":"triggers.fire","summary":"Fire a trigger now with the request body, for testing","tags":["Wake triggers and schedules"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"trigger","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"The event payload, any JSON or text; it is delivered as it came.","additionalProperties":true}}}},"externalDocs":{"description":"Wake triggers and schedules","url":"https://docs.styne.ai/wake-triggers"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/wake-triggers."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/checkpoints":{"post":{"operationId":"checkpoints.take","summary":"Save a checkpoint of a sandbox as the next step of its timeline","tags":["Checkpoints and rewind"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Save a checkpoint of the sandbox. Every field is optional.","properties":{"label":{"type":"string","description":"A name for the step."},"keepLast":{"type":"integer","description":"After saving, keep only this many newest steps of the sandbox (at most 1000)."}}}}}},"externalDocs":{"description":"Checkpoints and rewind","url":"https://docs.styne.ai/checkpoints"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/checkpoints."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"checkpoints.list","summary":"List a sandbox's checkpoints, oldest first","tags":["Checkpoints and rewind"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Checkpoints and rewind","url":"https://docs.styne.ai/checkpoints"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/checkpoints."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sandboxes/{id}/rewind":{"post":{"operationId":"sandboxes.rewind","summary":"Go back to a checkpoint or saved snapshot; the sandbox keeps its id","tags":["Checkpoints and rewind"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"Go back to a checkpoint; the sandbox keeps its id.","properties":{"checkpoint":{"type":"string","description":"The checkpoint id from the timeline."}},"required":["checkpoint"]}}}},"externalDocs":{"description":"Checkpoints and rewind","url":"https://docs.styne.ai/checkpoints"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/checkpoints."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/images/{digest}":{"get":{"operationId":"images.get","summary":"The registered image: its references, its config and the machines that hold a ready build","tags":["Container images"],"parameters":[{"name":"digest","in":"path","required":true,"schema":{"type":"string"}}],"externalDocs":{"description":"Container images","url":"https://docs.styne.ai/images"},"responses":{"2XX":{"description":"Success. The answer is described on https://docs.styne.ai/images."},"default":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your Styne API key: Authorization: Bearer $STYNE_API_KEY."}},"schemas":{"Error":{"type":"object","description":"Every error answer has this shape; the codes are listed on the errors page.","properties":{"code":{"type":"integer","description":"The HTTP status."},"error_code":{"type":"string","description":"A stable machine-readable code, for example free_tier_limit."},"message":{"type":"string","description":"What happened and what to do, in plain words."},"origin":{"type":"string","description":"Where the fault came from, for example client, customer_limit or infrastructure."},"request_id":{"type":"string","description":"Quote it to support; the same value is in the x-request-id header."}},"required":["code","message"]}}}}