{"uid":"cap_Yy-J7PMkVWrSpCs1u7uP_","slug":"payweave-sandbox-pay-per-call-code-execution-b08c704b","name":"PayWeave Sandbox · Pay-per-call Code Execution","description":"Run untrusted code in isolated sandboxes, one payment per execution.","url":"https://sandbox.payweave.services/run","method":"POST","headers":{},"bodySchema":{"type":"object","required":["code"],"properties":{"env":{"type":"object","description":"Environment variables visible to this execution only"},"code":{"type":"string","description":"Source code to execute"},"language":{"enum":["python","javascript","typescript"],"type":"string","description":"Interpreter to run the code with. Defaults to python."},"timeout_ms":{"type":"integer","description":"Execution wall-clock limit in milliseconds (1000 to 60000, default 30000). Executions that exceed it are killed."}}},"responseSchema":{"type":"object","required":["success","language","logs","results","error"],"properties":{"logs":{"type":"object","required":["stdout","stderr"],"properties":{"stderr":{"type":"array","items":{"type":"string"},"description":"Captured stderr chunks, in order"},"stdout":{"type":"array","items":{"type":"string"},"description":"Captured stdout chunks, in order"}},"additionalProperties":false},"error":{"anyOf":[{"type":"object","required":["name","message","traceback"],"properties":{"name":{"type":"string"},"message":{"type":"string"},"traceback":{"type":"array","items":{"type":"string"}}},"additionalProperties":true},{"type":"null"}]},"results":{"type":"array","items":{"type":"object","properties":{"png":{"type":"string","description":"Base64 PNG when the code produced an image, e.g. a matplotlib chart"},"html":{"type":"string"},"text":{"type":"string"}},"additionalProperties":true},"description":"Rich outputs from the final expression, Jupyter-style"},"success":{"type":"boolean","description":"True when the code ran without raising an error"},"language":{"type":"string"}},"additionalProperties":true},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.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_OEogh__GGMcJT_0WqW1Y-","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Executes arbitrary source code in an isolated sandbox environment, returning stdout/stderr logs and rich outputs, charged per execution via x402 micropayment.","exampleAgentPrompt":"Run this Python script in an isolated sandbox and give me the output — it generates a bar chart using matplotlib: `import matplotlib.pyplot as plt; plt.bar(['A','B','C'],[3,7,2]); plt.savefig('out.png')` — set a 10-second timeout and pass ENV_MODE=production as an environment variable.","exampleUseCases":null,"resultDescription":"Returns a JSON object with a success boolean, the language used, captured stdout and stderr as ordered arrays, Jupyter-style rich results (including base64 PNG images, HTML, or text from the final expression), and a structured error object (name, message, traceback) if execution failed — all null on success.","failureModes":["Code raises an unhandled exception — success=false, error contains name/message/traceback","Execution exceeds timeout_ms — process is killed, success=false with timeout error","Unsupported language specified — error returned indicating unknown interpreter","Payment fails or is insufficient via x402 — 402 response before execution begins","Malformed request body missing required 'code' field — validation error returned"],"whenToPreferThis":"Choose this endpoint when you need to execute arbitrary or untrusted code in a secure, isolated environment on a pay-per-use basis without provisioning persistent infrastructure. Ideal for AI agents that need to run generated code snippets, data analysis scripts, or chart-rendering code dynamically. The micropayment model (x402, $0.01 USDC) makes it cost-effective for low-frequency or one-off executions compared to spinning up a persistent container.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:34:36.222Z","isFirstParty":false}