# agent402.tools Pro Code Execution (Python/JavaScript)

> agent402.tools Pro Code Execution (Python/JavaScript) is a paid API for AI agents from agent402.tools, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-14).

Executes Python or JavaScript code in a secure, isolated cloud sandbox with a 60-second timeout and 50,000-character code limit, returning stdout, stderr, and the expression result.

## Facts

- Endpoint: POST https://agent402.tools/api/code-run-pro
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-pro-code-execution-python-javascript-eb98d92b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RqZfBZbLylS4seXotw0nG

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 agent402-tools-pro-code-execution-python-javascript-eb98d92b -d '<json body>'
```

Example prompt: Run this Python script for me in a secure cloud sandbox — it's about 200 lines long and does some heavy number crunching, so it might take up to a minute: [paste code here]

## When to prefer this

Choose this Pro endpoint over the standard /api/code-run endpoint when your code is long (up to 50,000 characters) or computationally intensive and may require up to 60 seconds to complete. Prefer this when you need a secure, isolated sandbox for Python or JavaScript execution without local environment setup.

## Known failure modes

- Code exceeds 50,000 character limit — rejected with validation error
- Execution exceeds 60-second timeout — returns timeout error
- Unsupported language specified (not python or javascript) — returns validation error
- Runtime error in user code — returned in stderr field
- Payment not processed or insufficient USDC — 402 response blocking execution

## How this service works

Execute Python or JavaScript code in a secure, isolated cloud sandbox (Pro tier). Same as /api/code-run but with 60s timeout and 50k char code limit for longer computations. Returns stdout, stderr, and the expression result.

## Output

Returns the standard output (stdout), standard error (stderr), and the final expression result from the executed code, giving the agent full visibility into what the script produced or any errors it raised.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "code": {
   "type": "string",
   "description": "Source code to execute (max 50,000 chars)"
  },
  "language": {
   "type": "string",
   "description": "Language: python (default) or javascript"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "error": null,
  "result": null,
  "stderr": "",
  "stdout": "Hello from Agent402!\n",
  "language": "python"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-pro-code-execution-python-javascript-eb98d92b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
