# E2B Sandboxed Python Code Execution

> E2B Sandboxed Python Code Execution is a paid API for AI agents from signal-engine-production-d88d.up.railway.app, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-16).

Executes arbitrary Python code in a secure E2B sandbox and returns stdout, stderr, and error output

## Facts

- Endpoint: POST https://signal-engine-production-d88d.up.railway.app/v1/gateway/execute/e2b
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/e2b-sandboxed-python-code-execution-3497de0e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_uxgUvdBPwYM2BMvk4072o

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 e2b-sandboxed-python-code-execution-3497de0e -d '<json body>'
```

Example prompt: Run this Python snippet in a sandbox and tell me what it outputs: `import math; print(math.factorial(10))`

## When to prefer this

Choose this endpoint when you need to execute dynamic Python code safely in an isolated environment without setting up local infrastructure — ideal for AI agents that generate or validate code, perform numeric computations, transform data programmatically, or run user-submitted scripts securely. Prefer this over local execution when sandboxing and reproducibility matter.

## Known failure modes

- Syntax error in submitted Python code returns a non-null error field with the exception message
- Runtime exceptions (e.g. ZeroDivisionError, ImportError) surface in stderr or error field
- Execution timeout if script runs too long
- Unavailable third-party libraries not pre-installed in the sandbox environment
- Network errors or sandbox provisioning failures returning HTTP 5xx

## How this service works

Sandboxed Python code execution via E2B

## Output

A JSON object containing an `error` field (null if successful), a `stdout` array of strings representing each line of standard output, and a `stderr` array of strings for any error output from the script.

## Request schema (JSON Schema)

```json
{
 "output": {
  "required": [
   "stdout",
   "stderr"
  ],
  "properties": {
   "error": {
    "type": "string",
    "nullable": true
   },
   "stderr": {
    "type": "array",
    "items": {
     "type": "string"
    }
   },
   "stdout": {
    "type": "array",
    "items": {
     "type": "string"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "error": null,
  "stderr": [],
  "stdout": [
   "4\n"
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/e2b-sandboxed-python-code-execution-3497de0e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from signal-engine-production-d88d.up.railway.app](https://www.zero.xyz/host/signal-engine-production-d88d.up.railway.app/llms.txt)
