{"uid":"cap_wNPN9gQzO45mpO8OE2KId","slug":"sandboxd-code-run-python-js-ts-execute-4f0fe97f","name":"Sandboxd Code Run – Python/JS/TS Execute","description":"Runs Python, JavaScript or TypeScript code in an isolated one-shot sandbox and returns stdout, stderr, exit code and artifacts (Daytona CodeRunRequest/ExecuteResponse compatible)","url":"https://sandboxd-code-run.saastemly.com/v1/execute-code?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"env":{"type":"object","description":"Environment variables; keys must match [A-Za-z_][A-Za-z0-9_]* (Daytona's rule)"},"argv":{"type":"array","items":{"type":"string"},"description":"Command-line arguments for the program (sys.argv[1:] in Python, process.argv.slice(2) in Node)"},"code":{"type":"string","description":"The code to run (up to 1 MB of UTF-8)"},"files":{"type":"object","description":"Text files written into the work directory next to the program (up to 50, 1 MB each, 4 MB total); the entry point main.py/main.js/main.ts is reserved"},"outputs":{"type":"array","items":{"type":"string"},"description":"Relative paths to read back after the run (up to 20); up to 1 MB each comes back base64 in outputFiles, larger in tooLargeOutputs, absent in missingOutputs"},"timeout":{"type":"integer","description":"Run timeout in seconds, 1-120 (default 60); a timed-out run answers exitCode 124"},"language":{"enum":["python","javascript","typescript"],"type":"string","description":"\"python\", \"javascript\" or \"typescript\""}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_82rNkjyn7Xzj-EYca9jbl","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Executes Python, JavaScript, or TypeScript code in an isolated one-shot sandbox and returns stdout, stderr, exit code, and output file artifacts","exampleAgentPrompt":"Run this Python script in an isolated sandbox and give me the stdout, stderr, and exit code — the script reads a CSV from a file I'll provide called data.csv, computes the column averages, and writes the result to output.json; use a 30-second timeout.","exampleUseCases":[{"title":"Data transformation with Python","prompt":"Run this Python code in a sandbox for me — it takes a JSON array of numbers from an env variable called INPUT_DATA, computes their mean and standard deviation, prints the results to stdout, and writes a summary.json file; give me back the file contents and any errors."},{"title":"TypeScript snippet validation","prompt":"Execute this TypeScript snippet in an isolated environment and tell me if it compiles and runs without errors — the code defines a generic merge function and calls it with two sample objects, and I want to see the stdout and exit code."},{"title":"JavaScript data processing with argv","prompt":"Run this JavaScript script in a sandboxed Node environment, passing the arguments '--format csv --limit 100', and return everything that gets printed to stdout along with the exit code; timeout after 45 seconds."}],"resultDescription":"Returns a JSON object containing stdout (string), stderr (string), exit code (integer — 124 on timeout), base64-encoded contents of any requested output files (outputFiles), a list of output paths that were too large to inline (tooLargeOutputs), and a list of output paths that were absent after the run (missingOutputs).","failureModes":["Timeout: code runs longer than the specified timeout (1-120s, default 60) and exits with code 124","Code exceeds 1 MB UTF-8 limit — request rejected","More than 50 input files or total file size exceeds 4 MB — request rejected","Requested output file missing after run — path listed in missingOutputs","Output file exceeds 1 MB — path listed in tooLargeOutputs instead of inline","Invalid environment variable key (must match [A-Za-z_][A-Za-z0-9_]*) — request rejected","Unsupported language value — validation error","Payment failure via x402 protocol — 402 response returned"],"whenToPreferThis":"Choose this endpoint when you need to run Python, JavaScript, or TypeScript code safely in an isolated, one-shot sandbox with support for file I/O, environment variables, and argv — especially when the Daytona CodeRunRequest/ExecuteResponse API shape is expected. Prefer this over shell-command sandboxes when you need language-specific runtimes. Prefer this over persistent environments when statelessness and isolation are required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T18:35:44.462Z","isFirstParty":false,"canonicalSlug":"sandboxd-code-run-python-js-ts-execute-4f0fe97f"}