# Echo Router – E2B Code Execution

> Echo Router – E2B Code Execution is a paid API for AI agents from echo.router.merit.systems, paid per call via x402, $0.00028/call, status unknown (last checked 2026-09-14).

Executes arbitrary code snippets in secure, isolated E2B sandbox environments and returns stdout, stderr, results, and execution metadata

## Facts

- Endpoint: POST https://echo.router.merit.systems/resource/e2b/execute
- Price: $0.00028/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/echo-router-e2b-code-execution-8e319e57
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_SHSk-1DCTcrMTBVT5GUcj

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 echo-router-e2b-code-execution-8e319e57 -d '<json body>'
```

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

## When to prefer this

Choose this endpoint when you need to safely execute arbitrary code snippets in an isolated, ephemeral sandbox without setting up a local environment. Ideal for running untrusted code, testing transformations, performing computations, or generating outputs (charts, PDFs, images) from code. Backed by E2B's proven sandboxing infrastructure, it is preferred over general LLM code interpretation when you need real, deterministic execution with actual stdout/stderr capture.

## Known failure modes

- Syntax or runtime error in snippet — returns error object with name, value, and traceback; stdout/stderr may still contain partial output
- Sandbox timeout — execution exceeds time limit, returns error with timeout traceback
- Unsupported language or invalid snippet format — returns error indicating parse failure
- Network or sandbox provisioning failure — HTTP 5xx error from the service
- Payment failure or insufficient balance — HTTP 402 response blocking execution

## How this service works

Executes code in secure sandboxed environments using E2B. Supports multiple programming languages with isolated execution and real-time output capture.

## Output

Returns an object containing stdout and stderr log arrays, an array of result objects (with optional text, HTML, PNG, SVG, PDF, JSON, chart, markdown, LaTeX, and JavaScript representations), an error object if execution failed (name, value, traceback), execution duration in milliseconds, sandbox ID, execution count, and cost incurred.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "snippet": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "cost": {
  "type": "number"
 },
 "logs": {
  "type": "object",
  "required": [
   "stdout",
   "stderr"
  ],
  "properties": {
   "stderr": {
    "type": "array",
    "items": {
     "type": "string"
    }
   },
   "stdout": {
    "type": "array",
    "items": {
     "type": "string"
    }
   }
  },
  "additionalProperties": false
 },
 "error": {
  "type": "object",
  "required": [
   "name",
   "value",
   "traceback"
  ],
  "properties": {
   "name": {
    "type": "string"
   },
   "value": {
    "type": "string"
   },
   "traceback": {
    "type": "string"
   }
  },
  "additionalProperties": false
 },
 "results": {
  "type": "array",
  "items": {
   "type": "object",
   "required": [
    "isMainResult",
    "raw"
   ],
   "properties": {
    "pdf": {
     "type": "string"
    },
    "png": {
     "type": "string"
    },
    "raw": {
     "type": "object",
     "additionalProperties": {}
    },
    "svg": {
     "type": "string"
    },
    "data": {
     "type": "object",
     "additionalProperties": {}
    },
    "html": {
     "type": "string"
    },
    "jpeg": {
     "type": "string"
    },
    "json": {
     "type": "string"
    },
    "text": {
     "type": "string"
    },
    "chart": {},
    "extra": {},
    "latex": {
     "type": "string"
    },
    "markdown": {
     "type": "string"
    },
    "javascript": {
     "type": "string"
    },
    "isMainResult": {
     "type": "boolean"
    }
   },
   "additionalProperties": false
  }
 },
 "duration": {
  "type": "number"
 },
 "sandboxId": {
  "type": "string"
 },
 "executionCount": {
  "type": "number"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/echo-router-e2b-code-execution-8e319e57/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from echo.router.merit.systems](https://www.zero.xyz/host/echo.router.merit.systems/llms.txt)
