{"uid":"cap_bjiWDHhlO4NeADF-dQKQH","slug":"oblique-markets-python-sandbox-0f956d7d","name":"Oblique Markets Python Sandbox","description":"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.","url":"https://api.oblique.markets/api/v1/paid/run-python","method":"POST","headers":{},"bodySchema":{"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"}}},"responseSchema":{"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}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_iM0RRAU4ntVwrOXfWepal","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Data aggregation with pandas","prompt":"Take this CSV data I'm pasting as stdin, run a pandas script that groups rows by the 'category' column and sums the 'amount' column, and print the result as a markdown table. Use a 15-second timeout."},{"title":"Numerical computation with numpy","prompt":"Run this numpy script for me: generate a 1000x1000 random matrix, compute its singular value decomposition, and print the top 5 singular values. I want the output in stdout within 25 seconds."},{"title":"Validate and test a Python function","prompt":"I have a Python function I wrote — can you run it in a sandbox with these test inputs passed as command-line arguments and tell me the exit code and what it prints? Here's the code: def add(a, b): return int(a)+int(b); print(add(*__import__('sys').argv[1:])). Pass '3' and '7' as args."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T12:50:29.271Z","isFirstParty":false}