# Baby Blue Viper — Python Sandbox Code Execution

> Baby Blue Viper — Python Sandbox Code Execution is a paid API for AI agents from api.babyblueviper.com, paid per call via x402, $0.182088/call, status unknown (last checked 2026-09-15).

Executes Python code in a sandboxed container with configurable tiers, persistent workspace, and pay-per-use Lightning/x402 billing

## Facts

- Endpoint: POST https://api.babyblueviper.com/execute
- Price: $0.182088/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/baby-blue-viper-python-sandbox-code-execution-efbbb53c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_J0Rm2jykCN-P2E-IyjBrB

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 baby-blue-viper-python-sandbox-code-execution-efbbb53c -d '<json body>'
```

Example prompt: Run this Python snippet in a premium-tier sandboxed container with a persistent workspace and give me the stdout: `import math; print(math.pi * 42**2)` — use tier 2 and allow any imports.

## When to prefer this

Choose this endpoint when an AI agent needs to execute arbitrary Python code in a secure, metered sandbox — especially when persistent workspace state between calls is needed, when import restrictions must be configurable, or when pay-per-use Lightning/x402 billing is required. Prefer over general cloud functions when agent-native billing and tier-based resource control matter.

## Known failure modes

- Timeout exceeded — exit_code non-zero and stderr contains timeout message
- Import error in restrictive (non-permissive) container — stderr shows ModuleNotFoundError
- Invalid tier value — API returns validation error
- Insufficient balance — payment required error (402) if Lightning/USDC balance is depleted
- Syntax error in submitted Python code — exit_code 1, stderr contains traceback

## How this service works

invinoveritas /execute — sandboxed Python that returns a SIGNED PROVENANCE PROOF of the exact output you recompute offline to confirm the run is untampered.

## Output

A JSON object containing the execution status ('success' or error), stdout and stderr strings, exit code, action_id (e.g. 'exec_…'), artifact_id if any file was produced, and duration in milliseconds.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "code": {
   "type": "string",
   "description": "Python source to execute in the sandbox"
  },
  "tier": {
   "enum": [
    0,
    1,
    2,
    3
   ],
   "type": "integer",
   "description": "0 starter, 1 default, 2 premium, 3 enterprise"
  },
  "stdin": {
   "type": "string"
  },
  "language": {
   "enum": [
    "python"
   ],
   "type": "string"
  },
  "permissive": {
   "type": "boolean",
   "description": "Permissive container (any import, full builtins) at a premium"
  },
  "use_workspace": {
   "type": "boolean",
   "description": "Mount a persistent per-agent /workspace"
  },
  "timeout_seconds": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "status": "success",
  "stderr": "",
  "stdout": "…",
  "action_id": "exec_…",
  "exit_code": 0,
  "artifact_id": "",
  "duration_ms": 1820
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/baby-blue-viper-python-sandbox-code-execution-efbbb53c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.babyblueviper.com](https://www.zero.xyz/host/api.babyblueviper.com/llms.txt)
