# E2B Sandbox Creation

> E2B Sandbox Creation is a paid API for AI agents from e2b.x402.paysponge.com, paid per call via x402, $0.04/call, status unknown (last checked 2026-10-13).

Spins up a new isolated cloud sandbox environment for safe AI agent code execution

## Facts

- Endpoint: POST https://e2b.x402.paysponge.com/sandboxes?utm_source=zero.xyz
- Price: $0.04/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/e2b-sandbox-creation-4fccc667
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6ztRbsPGbyc2GR7gWnpb_

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-sandbox-creation-4fccc667 -d '<json body>'
```

Example prompt: Spin up a new E2B sandbox using the python-default template, with a 60-second timeout, auto-pause enabled, and block all outbound traffic except to api.openai.com.

## When to prefer this

Choose this endpoint when you need to programmatically provision a fresh, isolated cloud sandbox for AI agent code execution, especially when you need fine-grained control over network egress, environment variables, lifecycle (timeout, auto-pause, auto-resume), or template selection. Prefer E2B over generic VMs when you want a purpose-built, agent-friendly sandbox API with per-call billing and MCP support.

## Known failure modes

- Invalid templateID returns a 404 or error indicating the template does not exist
- Timeout value below minimum (0) causes a validation error
- Malformed CIDR blocks in network deny/allow lists cause a 400 bad request
- Insufficient payment or missing x402 payment header returns a 402 Payment Required
- Network or provisioning failures may return a 500 or 503 error
- Conflicting network rules (deny overridden by allow) may silently resolve without error

## How this service works

POST /sandboxes

## Output

Returns a sandbox object including a unique sandbox ID, access URL(s), status, and metadata for the newly created isolated execution environment. The agent can use this sandbox ID to interact with, monitor, or terminate the environment in subsequent API calls.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mcp": {
   "type": "object",
   "nullable": true,
   "description": "MCP configuration for the sandbox",
   "additionalProperties": {}
  },
  "secure": {
   "type": "boolean",
   "description": "Secure all system communication with sandbox"
  },
  "envVars": {
   "additionalProperties": {
    "type": "string",
    "description": "Environment variables for the sandbox"
   }
  },
  "network": {
   "type": "object",
   "properties": {
    "denyOut": {
     "type": "array",
     "items": {
      "type": "string"
     },
     "description": "List of denied CIDR blocks or IP addresses for egress traffic. Domain names are not supported for deny rules."
    },
    "allowOut": {
     "type": "array",
     "items": {
      "type": "string"
     },
     "description": "List of allowed destinations for egress traffic. Each entry can be a CIDR block (e.g. \"8.8.8.8/32\"), a bare IP address (e.g. \"8.8.8.8\"), or a domain name (e.g. \"example.com\", \"*.example.com\"). Allowed entries always take precedence over denied entries."
    },
    "maskRequestHost": {
     "type": "string",
     "description": "Specify host mask which will be used for all sandbox requests"
    },
    "allowPublicTraffic": {
     "type": "boolean",
     "default": true,
     "description": "Specify if the sandbox URLs should be accessible only with authentication."
    }
   }
  },
  "timeout": {
   "type": "integer",
   "format": "int32",
   "default": 15,
   "minimum": 0,
   "description": "Time to live for the sandbox in seconds."
  },
  "metadata": {
   "additionalProperties": {
    "type": "string",
    "description": "Metadata of the sandbox"
   }
  },
  "autoPause": {
   "type": "boolean",
   "default": false,
   "description": "Automatically pauses the sandbox after the timeout"
  },
  "autoResume": {
   "type": "object",
   "required": [
    "enabled"
   ],
   "properties": {
    "enabled": {
     "type": "boolean",
     "default": false,
     "description": "Auto-resume enabled flag for paused sandboxes. Default false."
    }
   },
   "description": "Auto-resume configuration for paused sandboxes."
  },
  "templateID": {
   "type": "string",
   "description": "Identifier of the required template"
  },
  "volumeMounts": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "name",
     "path"
    ],
    "properties": {
     "name": {
      "type": "string",
      "description": "Name of the volume"
     },
     "path": {
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/e2b-sandbox-creation-4fccc667/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from e2b.x402.paysponge.com](https://www.zero.xyz/host/e2b.x402.paysponge.com/llms.txt)
