{"uid":"cap_PviAgSIxH3Emo5btxKZM8","slug":"batcave-python-sandbox-runner-a1a55cec","name":"Batcave Python Sandbox Runner","description":"Run supplied Python files in a disposable isolated environment and return execution evidence and requested artifacts. Use when you need to execute untrusted Python code, run tests, reproduce a failure, or collect stdout/stderr and generated artifacts without giving the code network, GPU, or host access.","url":"https://batcave-x402-gateway.darriel9.workers.dev/v1/run-python","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"cpus":{"type":"number","maximum":2,"minimum":0.1},"files":{"type":"object","description":"Relative file path -> UTF-8 text content.","maxProperties":64,"minProperties":1,"additionalProperties":{"type":"string"}},"stdin":{"type":"string"},"job_id":{"type":"string"},"command":{"type":"array","items":{"type":"string"},"description":"Optional argv; defaults to ['python','main.py']."},"runtime":{"enum":["python"],"type":"string"},"memory_mb":{"type":"integer","maximum":1024,"minimum":64},"artifact_paths":{"type":"array","items":{"type":"string"},"maxItems":16},"timeout_seconds":{"type":"integer","maximum":30,"minimum":1}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_oQU4gooh0LW1R9jIvWF5W","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Executes supplied Python files in a disposable, isolated sandbox and returns stdout, stderr, exit code, and requested output artifacts.","exampleAgentPrompt":"Run this Python script for me in an isolated sandbox — here are the files: main.py contains `print('hello world')` — give it 10 seconds, 256 MB of memory, and return all stdout and stderr.","exampleUseCases":[{"title":"Reproduce a reported Python bug","prompt":"I have a bug report with this Python script that supposedly fails — can you run it in an isolated sandbox with a 15-second timeout and 512 MB of RAM and send me back the exact stdout, stderr, and exit code so I can see the failure myself?"},{"title":"Run Python unit tests in CI","prompt":"Execute this test suite — the files are test_math.py and utils.py — using `python -m pytest test_math.py` as the command, with a 30-second timeout and 512 MB memory, and give me the full test output."},{"title":"Generate and retrieve a plot artifact","prompt":"Run this Python matplotlib script that generates a chart saved to output/chart.png — use a 20-second timeout, 512 MB memory, and make sure to return the chart.png file as an artifact so I can download it."}],"resultDescription":"Returns execution evidence including stdout, stderr, and exit code from the Python run, plus the binary or text content of any artifact files specified in artifact_paths that were written during execution.","failureModes":["Timeout exceeded (timeout_seconds limit reached) — execution halted, partial output may be returned","Memory limit exceeded (memory_mb cap hit) — process killed","Invalid or unparseable Python files — syntax errors reflected in stderr","Requested artifact path not found after execution — artifact missing from response","Payment failure — x402 payment of $0.01 USDC not processed","Too many files provided (exceeds maxProperties: 64) — request rejected"],"whenToPreferThis":"Choose this endpoint when you need to safely execute untrusted or user-supplied Python code in a fully isolated, disposable environment with no network, GPU, or host access. Ideal for reproducing bugs, running unit tests, executing data-processing scripts, or collecting generated file artifacts. Prefer this over general compute when strict sandboxing, artifact capture, and controlled resource limits (CPU ≤ 2, memory ≤ 1024 MB, timeout ≤ 30s) are required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:30:11.194Z","isFirstParty":false}