# BlockRun.AI Managed Python Sandbox Create

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

Creates a managed Python 3.11 sandbox with configurable CPU, GPU, memory, and lifetime, using flat-rate or hourly billing depending on timeout duration.

## Facts

- Endpoint: POST https://blockrun.ai/api/v1/modal/sandbox/create
- Price: $0.01/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: 2
- Tags: x402
- Canonical page: https://www.zero.xyz/c/blockrun-ai-4754e82d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Ewwgy-hJy8VSwgLYwHs3r

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-4754e82d -d '<json body>'
```

Example prompt: Spin up a managed Python 3.11 sandbox on BlockRun with 4 CPU cores, 8192 MB of memory, a T4 GPU, and a 600-second lifetime so I can run a machine learning job.

## When to prefer this

Use this endpoint when you need an isolated, managed Python 3.11 execution environment with configurable resources, especially when GPU acceleration (T4, L4, A10G, A100, H100) is required. Prefer over raw cloud VM provisioning when you want a flat-rate short job (≤300s) or a longer-lived hourly-billed environment without managing infrastructure. Best for agentic workflows that need to programmatically create and execute sandboxed code.

## Known failure modes

- Invalid GPU type specified — must be one of T4, L4, A10G, A100, H100
- CPU cores exceed limit — CPU-only sandboxes max 1 core, GPU sandboxes max 8
- Memory exceeds limit — CPU-only max 1024 MB, GPU max 32768 MB
- Timeout exceeds 86400 seconds (24h)
- Payment failure — insufficient USDC balance or x402 payment rejected
- Image not available — only python:3.11 is currently supported
- Billing mode mismatch — timeout >300s triggers hourly billing without proration on early termination

## How this service works

Create a managed Python 3.11 sandbox. Two billing modes selected by 'timeout': ≤300s = flat rate (CPU $0.01, GPU varies). >300s = per-hour billing for the full requested lifetime, no refund on early terminate. Max 24h.

## Output

Returns a sandbox object including a unique sandbox ID, connection details, and metadata about the provisioned environment (CPU, GPU, memory, timeout, billing mode). The sandbox is ready to accept command execution calls.

## Example request

```json
{
 "image": "python:3.11"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "cpu": {
   "type": "number",
   "description": "CPU cores (max 1 CPU-only, 8 for GPU sandboxes, default: 1)"
  },
  "gpu": {
   "type": "string",
   "description": "Optional GPU type. One of: T4, L4, A10G, A100, H100. Flat (≤300s): T4 $0.05, L4 $0.08, A10G $0.1, A100 $0.2, H100 $0.4. Hourly: T4 $1.5, L4 $2, A10G $2.5, A100 $4, H100 $8/hour."
  },
  "image": {
   "type": "string",
   "description": "Managed image. Only `python:3.11` is currently available."
  },
  "memory": {
   "type": "number",
   "description": "Memory in MB (max 1024 CPU-only, 32768 for GPU sandboxes, default: 512)"
  },
  "timeout": {
   "type": "number",
   "description": "Sandbox lifetime in seconds (max 86400 = 24h, default: 300). >300s switches to hourly billing."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/blockrun-ai-4754e82d/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)
