# agent-exec Sandboxed Code Execution

> agent-exec Sandboxed Code Execution is a paid API for AI agents from agent-exec.448c.org, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-10).

Executes Python or Node.js source code in an isolated, network-less sandbox and returns stdout, stderr, and exit code — pay-per-use via x402, no account required.

## Facts

- Endpoint: POST https://agent-exec.448c.org/execute?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-exec-sandboxed-code-execution-5117fbc8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CQI6IYz78d6I8zf5qFzBi

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 agent-exec-sandboxed-code-execution-5117fbc8 -d '<json body>'
```

Example prompt: Run this Python 3 script for me in a sandboxed environment and give me the stdout and exit code: `import math; print(math.factorial(20))`

## When to prefer this

Choose this endpoint when an AI agent needs to execute untrusted or dynamically generated code snippets without managing accounts, API keys, or infrastructure. It is ideal for pay-per-use one-off computations, agent pipelines that need on-demand scripting capability, or when the caller holds a USDC wallet (x402) and wants frictionless access. Prefer it over managed cloud functions when there is no persistent state needed and the network-isolated sandbox is a feature rather than a limitation. Not suitable for code that requires internet access, persistent disk storage, or runtimes beyond python3 and node.

## Known failure modes

- SANDBOX_TIMEOUT — code ran too long; no refund
- EXECUTION_MEMORY_LIMIT_EXCEEDED — script exceeded RAM budget
- RUNTIME_UNSUPPORTED — runtime enum value not allowlisted; charged after payment attempt
- REQUEST_MALFORMED — missing required fields source or runtime
- PAYMENT_INVALID / PAYMENT_AMOUNT_INSUFFICIENT — x402 payment missing or underfunded
- PAYER_RATE_LIMITED / PAYER_CONCURRENCY_LIMITED — too many requests from the same wallet
- SERVICE_BUSY / SANDBOX_UNAVAILABLE — backend capacity issue; retry
- EXECUTION_OUTPUT_LIMIT_EXCEEDED — stdout/stderr too large
- PAYMENT_REPLAYED — same payment token submitted twice

## How this service works

Accountless, pay-per-use code execution for software agents: submit source code, get stdout, stderr and exit code back from an isolated, network-less sandbox. No account, no API key -- possession of valid payment is sufficient.

## Output

Returns an outcome field ('completed', 'timeout', or 'error'), captured stdout, captured stderr, exit code, execution duration in milliseconds, truncation flags, a structured error object (null on success), payment details (payer wallet, amount, network, transaction hash), and a signed receipt with tier, price, resource limits, and an output digest for auditability.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "source",
  "runtime"
 ],
 "properties": {
  "files": {
   "type": "object",
   "description": "Extra files seeded alongside the entry file, as relative-path -> content."
  },
  "stdin": {
   "type": "string",
   "description": "Written to the payload's stdin, then stdin is closed."
  },
  "limits": {
   "type": "object",
   "description": "Per-request resource budget. Every field is optional; an omitted field takes its documented default. A field outside [minimum, maximum] is rejected outright, never clamped."
  },
  "source": {
   "type": "string",
   "description": "Program source, written to the runtime's entry file."
  },
  "runtime": {
   "enum": [
    "python3",
    "node"
   ],
   "type": "string",
   "description": "Must be one of the allowlisted runtimes named here -- this enum (and x-runtimes) is the free way to learn the set. An unsupported value is refused only AFTER a payment attempt, as RUNTIME_UNSUPPORTED, not before."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "outcome",
  "stdout",
  "stderr",
  "exitCode",
  "durationMs",
  "truncated",
  "error",
  "payment",
  "receipt"
 ],
 "properties": {
  "error": {
   "type": [
    "object",
    "null"
   ],
   "properties": {
    "code": {
     "enum": [
      "SANDBOX_INVALID_REQUEST",
      "RUNTIME_RESERVED_FILE_PATH",
      "REQUEST_MALFORMED",
      "PAYMENT_MALFORMED",
      "RUNTIME_UNSUPPORTED",
      "RUNTIME_LIMIT_OUT_OF_RANGE",
      "SANDBOX_TIMEOUT",
      "EXECUTION_MEMORY_LIMIT_EXCEEDED",
      "EXECUTION_OUTPUT_LIMIT_EXCEEDED",
      "SERVICE_BUSY",
      "PAYER_RATE_LIMITED",
      "PAYER_CONCURRENCY_LIMITED",
      "EXECUTE_IP_RATE_LIMITED",
      "EXECUTION_RUNTIME_ERROR",
      "EXECUTION_RUNTIME_ERROR_POSSIBLE_SANDBOX_DENIAL",
      "EXECUTION_RUNTIME_ERROR_NETWORK_DISABLED",
      "PAYMENT_INVALID",
      "PAYMENT_AMOUNT_INSUFFICIENT",
      "PAYMENT_REQUIREMENTS_MISMATCH",
      "PAYMENT_REPLAYED",
      "PAYMENT_SETTLEMENT_FAILED",
      "PAYMENT_SETTLEMENT_INDETERMINATE",
      "SANDBOX_UNAVAILABLE",
      "SANDBOX_SETUP_FAILED",
      "SERVICE_INTERNAL_FAILURE",
      "PAYMENT_FACILITATOR_UNAVAILABLE"
     ],
     "type": "string"
    },
    "message": {
     "type": "string"
    },
    "billable": {
     "type": "boolean"
    },
    "category": {
     "type": "string"
    }
   },
   "description": "Null when `outcome` is \"completed\"."
  },
  "stderr": {
   "type": "string"
  },
  "stdout": {
   "type": "string"
  },
  "outcome": {
   "enum": [
    "completed",
    "timeout",
    "error"
   ],
   "type": "string"
  },
  "payment": {
   "type": "object",
   "properties": {
    "asset": {
     "type": "string"
    },
    "payer": {
     "type": "string",
     "description": "The paying wallet's address."
    },
    "amount": {
     "type": "string",
     "description": "Atomic units of the settlement asset that were charged."
    },
    "network": {
     "type": "string"
    },
    "transaction": {
     "type": "string",
     "description": "On-chain settlement transaction hash."
    }
   },
   "description": "The payer is surfaced because it is this service's notion of identity (build.md: the wallet is the account) -- per-payer rate limits and standing are built on it."
  },
  "receipt": {
   "type": "object",
   "required": [
    "requestDigest",
    "payment",
    "priceUsd",
    "price",
    "tier",
    "limits",
    "usage",
    "status",
    "outputDigest"
   ],
   "properties": {
    "tier": {
     
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-exec-sandboxed-code-execution-5117fbc8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-exec.448c.org](https://www.zero.xyz/host/agent-exec.448c.org/llms.txt)
