---
title: "Run commands across sandboxes, one array-shaped call [rate class: sandbox_api_rps]"
method: POST
path: "/preview/sandboxes/execs"
tags: ["sandboxes"]
---

# Run commands across sandboxes, one array-shaped call \[rate class: sandbox_api_rps\]

`POST /preview/sandboxes/execs`

## Request

- Base URL: `https://autoresearch.sfcompute.com`
- URL: `https://autoresearch.sfcompute.com/preview/sandboxes/execs`
- Auth: HTTP bearer

Run shell commands in sandboxes - each inside one of your own forked microVMs, a single-tenant guest with its own kernel that holds only what you baked into it. Array-shaped ON PURPOSE: pass execs: [{sandbox, cmd, deadline_ms?}, ...] and one call runs across many sandboxes concurrently - the shape for rollouts, where one call per sandbox would only burn your rate budget. Results return in request order, each tagged with its sandbox id, carrying exit_code, stdout, stderr, duration_ms, and timed_out. Commands inside one sandbox run one at a time; different sandboxes run in parallel. For a single command, sandbox + cmd is accepted as shorthand for a one-entry array. A result carrying outcome: "void" is an infrastructure failure on OUR side - unbilled, and not a fact about your command: retry it on a fresh fork rather than scoring it as a failure. A result carrying cancelled: true means your own delete_sandbox won a race against this exec - the command's verdict is unknowable, the time is billed, and there is nothing to retry or score. `oom_kills` > 0 (with a note) means the guest kernel's OOM killer fired during the run: a bare "Killed" with exit 137 is the sandbox's own memory budget biting, billed - bake the env with more ram_gib or reduce memory use, and score it as your command's failure, never retry-as-void. The field absent means the env's baked agent predates measurement, not "no OOM".

## Query parameters

- `workspace` string

## Request body

- object
  - `cmd` string, nullable: Single-command shorthand's command (requires sandbox).
  - `deadline_ms` integer, nullable: Single-command shorthand's deadline in milliseconds (default 60000, max 600000).
  - `execs` SandboxExecItem[], nullable: The batch: [{sandbox, cmd, deadline_ms?}, ...]. One call fans across many sandboxes at once - THE shape for rollouts. Results come back in the same order, tagged with each sandbox id. (unresolved $ref)
  - `sandbox` string, nullable: Single-command shorthand: sandbox + cmd instead of a one-entry execs array. The response shape is identical ({results: [...]}).

## Response `200`

The capability's JSON result.

- Result: The capability's result: the same object the MCP tool returns as structuredContent. Resources carry an `object` type discriminator and an immutable id; money is integer micro-dollars in `*_usd_micros` fields.
  - `object` string: The resource type, when the result is one resource.

## Other responses

- `400`: Malformed request: bad JSON, a parameter that does not parse, or a value outside its range. Code `invalid`.
- `401`: No bearer token, or one this API cannot verify. Code `unauthenticated`.
- `403`: Authenticated, but the token's scopes or the account's role do not reach this operation. The message names the scope word to request. Code `forbidden`.
- `404`: No such route. Code `not_found`; the body names the OpenAPI document.
- `422`: A well-formed request the platform declined: no such node, a cap reached, a state that forbids the move. The message says which, and what to do instead. Code `refused`.
- `429`: Over this door's per-customer budget. Wait `Retry-After` seconds. Code `rate_limited`.
- `500`: Our fault. Retry; if it persists, quote the request-id. Code `internal`.

---

[API](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api.md) · [All operations](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/revisions/f88dcb70ac6c?raw)
