{"paid_route":"/api/v1/paid/run-python","method":"POST","price":"$0.05","what_you_get":"Runs a short Python program in an isolated sandbox and returns its exit code, stdout and stderr (64 KB each), wall-clock duration, up to 3 files it wrote to ./out/ as artifacts, the sandbox limits it ran under, and a payment receipt.","sandbox":{"runtime":"isolated","python":"3.12","libraries":["standard library","numpy","pandas","requests"],"network":false,"memory_mb":512,"timeout_s":{"default":15,"max":30},"filesystem":"ephemeral, discarded after the run"},"limits":{"code_bytes":32768,"stdin_bytes":32768,"args":16,"files":4,"file_bytes":262144,"artifacts":3,"artifact_bytes":262144,"runs_per_day":300,"runs_per_payer_per_day":60},"free_validate":{"method":"POST","path":"/api/v1/run-python/validate","note":"Compile-only syntax check with the same input shape; never executes; returns {ok, error?:{line, message}}."},"input_schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","minLength":1,"maxLength":32768,"description":"Python 3 program source, at most 32 KB. Runs as main.py in an empty working directory."},"stdin":{"type":"string","maxLength":32768,"description":"Text piped to the program on standard input (at most 32 KB)."},"args":{"type":"array","items":{"type":"string","maxLength":1024},"maxItems":16,"description":"Command-line arguments (sys.argv[1:]), at most 16."},"files":{"type":"array","maxItems":4,"items":{"type":"object","required":["name","content_base64"],"properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9._-]{1,128}$","description":"File name written into the working directory (no paths)."},"content_base64":{"type":"string","description":"File content, base64, at most 256 KB decoded."}}},"description":"Up to 4 input files written into the working directory before the run."},"timeout_s":{"type":"number","minimum":1,"maximum":30,"default":15,"description":"Wall-clock limit for the program in seconds (default 15, max 30)."}},"additionalProperties":false},"request_example":{"code":"import sys, json, numpy as np\nxs = [int(x) for x in sys.stdin.read().split()]\nprint('mean', float(np.mean(xs)))\nprint('argv', sys.argv[1:])\nimport os\nos.makedirs('out', exist_ok=True)\nwith open('out/result.json', 'w') as f:\n    json.dump({'n': len(xs), 'mean': float(np.mean(xs))}, f)\ntry:\n    import urllib.request; urllib.request.urlopen('https://example.com', timeout=3); print('net ok')\nexcept Exception as e:\n    print('net blocked:', type(e).__name__)\n","stdin":"3 5 8 13","args":["--fast"],"timeout_s":10},"response_example":{"run_id":"run_5f0c2a9d7b3e1c4d8a6f0b21","exit_code":0,"stdout":"mean 7.25\nargv ['--fast']\nnet blocked: URLError\n","stdout_truncated":false,"stderr":"","stderr_truncated":false,"duration_ms":168,"timed_out":false,"artifacts":[{"name":"result.json","size_bytes":22,"content_base64":"eyJuIjogNCwgIm1lYW4iOiA3LjI1fQ=="}],"sandbox":{"runtime":"isolated","python_version":"3.12.10","network":false,"memory_mb":512,"timeout_s":10},"receipt":{"payer":"0x1111111111111111111111111111111111111111","network":"eip155:8453","scheme":"exact","amount_atomic":"50000","payment_nonce":"0x7d1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f9","payment_tx":"settled after this response; the transaction hash is in the PAYMENT-RESPONSE header","run_id":"run_5f0c2a9d7b3e1c4d8a6f0b21"},"generated_at":"2026-09-09T00:31:12.000Z"},"fails_closed":"When the daily cap is reached or the sandbox is unavailable the paid route answers 503 {reason, retry_after_seconds} before any payment is verified; a run the sandbox cannot complete is never charged."}