# BlockRun.AI Sandbox Exec

> BlockRun.AI Sandbox Exec is a paid API for AI agents from blockrun.ai, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-13, last successful call 2026-07-22).

Execute a shell command inside an isolated sandbox environment and return stdout, stderr, and exit code.

## Facts

- Endpoint: POST https://blockrun.ai/api/v1/modal/sandbox/exec
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Last successful call: 2026-07-22
- Success rate: 100% of calls made through Zero
- Activations on Zero: 8
- Tags: x402
- Canonical page: https://www.zero.xyz/c/blockrun-ai-8e1573e5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ENLk72XWRb29bU43dzyv_

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability blockrun-ai-8e1573e5 -d '<json body>'
```

Example prompt: Run `python -c "import math; print(math.sqrt(144))"` inside my existing sandbox (ID: sb_abc123) with a 30-second timeout and give me the stdout, stderr, and exit code.

## When to prefer this

Choose this endpoint when you need to execute arbitrary shell or scripting commands in a secure, isolated environment and capture their output. Ideal for running Python snippets, shell scripts, or build commands without local environment access. Requires a sandbox to be pre-created via /sandbox/create.

## Known failure modes

- Sandbox ID not found or expired — returns error indicating invalid sandbox_id
- Command times out beyond specified or maximum 60-second limit — returns non-zero exit code or timeout error
- Invalid command array format — returns 400 bad request
- Sandbox resource limits exceeded — execution may fail with a non-zero exit code or infrastructure error
- Payment not authorized — returns 402 Payment Required

## How this service works

Execute command in sandbox, returns stdout/stderr/exit code.

## Output

Returns the standard output (stdout), standard error (stderr), and integer exit code produced by the executed command within the sandbox environment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "command": {
   "type": "array",
   "description": "Command to execute, e.g. [\"python\", \"-c\", \"print(1)\"]"
  },
  "timeout": {
   "type": "number",
   "description": "Execution timeout in seconds (max 60, default: 60)"
  },
  "sandbox_id": {
   "type": "string",
   "description": "Sandbox ID from /sandbox/create"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/blockrun-ai-8e1573e5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from blockrun.ai](https://www.zero.xyz/host/blockrun.ai/llms.txt)
