# Lucid Sandbox Agent

> Lucid Sandbox Agent is a paid API for AI agents from lucid-sandbox-agent-production.up.railway.app, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Executes JavaScript code in a secure, isolated sandbox environment and returns console output and execution metadata

## Facts

- Endpoint: POST https://lucid-sandbox-agent-production.up.railway.app/api/execute
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/lucid-sandbox-agent-576e0bf4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_SzhHZMCZWtzY4ZNPHzLSm

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 lucid-sandbox-agent-576e0bf4 -d '<json body>'
```

Example prompt: Run this JavaScript snippet in the standard execution tier and give me the console output: `const nums = [1,2,3]; console.log(nums.reduce((a,b) => a+b, 0));`

## When to prefer this

Choose this endpoint when you need to safely execute JavaScript code snippets in an isolated environment without risking host system access, especially for running untrusted or user-submitted code. Prefer this over a local eval() when security isolation is required, or when you need consistent server-side execution with timing metrics.

## Known failure modes

- Code contains syntax errors — execution fails with success: false and error message in output
- Unsupported language specified — may return error or unexpected behavior
- Timeout exceeded for long-running scripts — execution terminates early
- Infinite loops or excessive resource usage may cause sandbox to kill the process
- Invalid or missing required fields (code, tier, language) — 400-level error response
- Payment of 0.02 USDC not fulfilled — 402 Payment Required response blocks execution

## How this service works

Execute JavaScript code in secure sandbox

## Output

Returns a JSON object with: `output` (string containing the console output from the executed code), `success` (boolean indicating whether execution completed without errors), and `executionTime` (number in milliseconds for how long execution took).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "code",
  "tier",
  "language"
 ],
 "properties": {
  "code": {
   "type": "string",
   "description": "JavaScript code to execute"
  },
  "tier": {
   "enum": [
    "basic",
    "standard",
    "premium"
   ],
   "type": "string",
   "description": "Execution tier"
  },
  "language": {
   "enum": [
    "javascript",
    "python"
   ],
   "type": "string",
   "description": "Programming language"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "output": {
   "type": "string",
   "description": "Console output"
  },
  "success": {
   "type": "boolean",
   "description": "Execution success status"
  },
  "executionTime": {
   "type": "number",
   "description": "Execution time in ms"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/lucid-sandbox-agent-576e0bf4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from lucid-sandbox-agent-production.up.railway.app](https://www.zero.xyz/host/lucid-sandbox-agent-production.up.railway.app/llms.txt)
