# E2B Python Code Sandbox Runner

> E2B Python Code Sandbox Runner is a paid API for AI agents from staging.toolkit.dev, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-12).

Executes Python code in a secure E2B sandbox environment and returns execution results and logs

## Facts

- Endpoint: POST https://staging.toolkit.dev/api/tool/e2b/run-code?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Success rate: 0% of calls made through Zero
- Activations on Zero: 1
- Tags: x402
- Canonical page: https://www.zero.xyz/c/staging-toolkit-dev-58da75f2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7Mdz-uZFPby_EyhAjopML

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 staging-toolkit-dev-58da75f2 -d '<json body>'
```

Example prompt: Run this Python code in a secure sandbox and show me the output: `import pandas as pd; df = pd.DataFrame({'x': [1,2,3], 'y': [4,5,6]}); print(df.describe())`

## When to prefer this

Choose this endpoint when you need to execute arbitrary Python code in a secure, isolated cloud sandbox powered by E2B, especially for data analysis, mathematical computation, or code testing without a local Python environment. Prefer this over general scripting when you need Jupyter Notebook-compatible execution with structured results and logs returned.

## Known failure modes

- Syntax error in provided Python code returns error in logs
- Unsupported library or missing package causes import failure
- Code timeout for long-running computations
- Invalid input schema if 'code' field is missing
- Network/sandbox provisioning failure returns 5xx error

## How this service works

Run Python code in a secure sandbox environment using E2B. Supports Jupyter Notebook syntax and returns execution results and logs.

## Output

Returns a JSON object with an array of execution results (output values, plots, or data produced by the code) and logs (stdout/stderr and runtime messages) from the Python sandbox execution.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "code"
 ],
 "properties": {
  "code": {
   "type": "string",
   "description": "The Python code to execute in the sandbox"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "results",
  "logs"
 ],
 "properties": {
  "logs": {
   "type": "any",
   "required": true,
   "description": "Execution logs"
  },
  "results": {
   "type": "array",
   "required": true,
   "description": "The execution results from running the code"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/staging-toolkit-dev-58da75f2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from staging.toolkit.dev](https://www.zero.xyz/host/staging.toolkit.dev/llms.txt)
