{"uid":"cap_wC-8WjosXr5H6bxQrImOB","slug":"sasona-python-sandbox-code-runner-02f00792","name":"Sasona Python Sandbox Code Runner","description":"Runs Python you send in a sandbox and returns its stdout, exit status, time and memory. Use it to execute code an agent wrote - a calculation, a parse, a transformation - without a machine, an account or an API key of your own.","url":"https://router.sasona.ai/x402/run-code/payai?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object"},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"queryParams":{"type":"object","additionalProperties":{"type":"string"}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0079","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.0079/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0079","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0079","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OZjzWy0PYREMn8k5Fga0L","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0079","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Executes arbitrary Python code in an isolated sandbox and returns stdout, exit status, execution time, and memory usage","exampleAgentPrompt":"Run this Python snippet for me in a sandbox and tell me what it prints: `import math; print(math.factorial(20))`","exampleUseCases":[{"title":"Agent-generated calculation verification","prompt":"I need you to run this Python code and show me the output: `data = [3, 7, 2, 9, 4]; print(sorted(data)); print(sum(data)/len(data))`"},{"title":"CSV parsing and transformation","prompt":"Execute this Python data-parsing snippet for me and return whatever it prints to stdout: `import json; rows = [{'a':1,'b':2},{'a':3,'b':4}]; print(json.dumps([{k: v*2 for k,v in r.items()} for r in rows]))`"},{"title":"Quick math without local environment","prompt":"Can you compute the first 10 Fibonacci numbers for me by running this Python code in a sandbox: `a,b=0,1\nfor _ in range(10): print(a); a,b=b,a+b`"}],"resultDescription":"Returns the Python process's stdout as a string, the exit status code (0 for success, non-zero for errors), wall-clock execution time in milliseconds, and peak memory usage in bytes — giving the agent everything it needs to know whether the code ran successfully and what it produced.","failureModes":["Code raises an unhandled exception — exit status is non-zero and stderr/stdout may contain traceback","Execution timeout exceeded — sandbox kills the process and returns a timeout error","Memory limit exceeded — sandbox terminates the process with an out-of-memory exit status","Syntax errors in the submitted Python — exit status non-zero with SyntaxError in output","Import of disallowed or unavailable modules — ImportError in stdout and non-zero exit","Malformed request body — HTTP 400 or validation error returned before execution begins"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to run a small, self-contained Python snippet to perform a calculation, parse data, or apply a transformation without provisioning a local runtime, cloud function, or any personal infrastructure. It is ideal for agentic workflows where the agent itself writes code to solve a sub-problem and needs to execute it immediately. Prefer it over general compute services when simplicity and zero-setup are priorities and the task fits within a single Python script's stdout.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-13T06:31:31.489Z","isFirstParty":false,"canonicalSlug":"sasona-python-sandbox-code-runner-02f00792"}