# Oblique Markets Python Sandbox

> Oblique Markets Python Sandbox is a paid API for AI agents from api.oblique.markets, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-13).

Executes a short Python 3.12 program in an isolated, sandboxed environment and returns exit code, stdout/stderr, duration, up to 3 output artifact files, and a receipt

## Facts

- Endpoint: POST https://api.oblique.markets/api/v1/paid/run-python
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/oblique-markets-python-sandbox-0f956d7d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bjiWDHhlO4NeADF-dQKQH

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 oblique-markets-python-sandbox-0f956d7d -d '<json body>'
```

Example prompt: Run this Python script for me in a sandbox and return the output — it reads a CSV from an input file called data.csv (I'll attach it), uses pandas to compute the mean of the 'revenue' column, and prints the result to stdout; give it a 20-second timeout.

## When to prefer this

Choose this endpoint when you need to execute arbitrary Python 3.12 code safely in an isolated environment with no setup overhead, especially for data processing tasks using numpy, pandas, or the standard library. Ideal when you need deterministic computation, file-in/file-out transforms, or want to validate logic without side effects. Prefer over client-side execution when sandboxing, reproducibility, or payment-gated auditability (receipt) matters. Not suitable for code requiring network access, GPU, or non-standard third-party libraries.

## Known failure modes

- Timeout: program exceeds wall-clock limit (max 30s) — returns non-zero exit code and partial stdout/stderr
- Code too large: source exceeds 32 KB limit — rejected at input validation
- Memory exceeded: program uses more than 512 MB — process killed
- Network access attempted: sandbox blocks all outbound network calls — requests will fail with connection error
- Invalid base64 in input files — returns 400 error
- Runtime exception in Python — captured in stderr with non-zero exit code
- Input file count exceeds 4 — rejected at validation

## How this service works

Use when an agent needs run python. Returns Runs a short Python program in an isolated sandbox and returns its output: exit code, stdout/stderr (64 KB each), duration, up to 3 artifact files in ./out/, and a receipt. Python 3.12 with the standard library plus numpy, pandas and requests; no network; 512 MB; up to 30 s. Input: code (32 KB), optional stdin, args and up to 4 input files. Free syntax check: POST /api/v1/run-python/validate; worked example: GET /api/v1/run-python/example. $0.05.

## Output

A JSON response containing: exit_code (integer), stdout (up to 64 KB of program output), stderr (up to 64 KB of error output), duration_ms (execution time in milliseconds), up to 3 artifact files written to ./out/ (returned as base64), and a payment receipt confirming the $0.05 USDC charge.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "args": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "code": {
   "type": "string"
  },
  "files": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "name",
     "content_base64"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "content_base64": {
      "type": "string"
     }
    }
   }
  },
  "stdin": {
   "type": "string"
  },
  "timeout_s": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "run_id": "run_5f0c2a9d7b3e1c4d8a6f0b21",
  "stderr": "",
  "stdout": "mean 7.25\nargv ['--fast']\nnet blocked: …",
  "receipt": {
   "payer": "0x1111111111111111111111111111111111111…",
   "run_id": "run_5f0c2a9d7b3e1c4d8a6f0b21",
   "scheme": "exact",
   "network": "eip155:8453",
   "payment_tx": "settled after this response; the transa…",
   "amount_atomic": "50000",
   "payment_nonce": "0x7d1b2c3d4e5f60718293a4b5c6d7e8f90a1b2…"
  },
  "sandbox": {
   "network": false,
   "runtime": "isolated",
   "memory_mb": 512,
   "timeout_s": 10,
   "python_version": "3.12.10"
  },
  "artifacts": [
   {
    "name": "result.json",
    "size_bytes": 22,
    "content_base64": "eyJuIjogNCwgIm1lYW4iOiA3LjI1fQ=="
   }
  ],
  "exit_code": 0,
  "timed_out": false,
  "duration_ms": 168,
  "generated_at": "2026-09-09T00:31:12.000Z",
  "stderr_truncated": false,
  "stdout_truncated": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/oblique-markets-python-sandbox-0f956d7d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.oblique.markets](https://www.zero.xyz/host/api.oblique.markets/llms.txt)
