{"uid":"cap_-cFolCMm6bKG5nSAnKx9G","slug":"x402-gateway-production-up-railway-app-a592818c","name":"x402 Code Execution Sandbox","description":"Run code in isolated sandbox — Python, JavaScript, Bash, R (up to 5 min)","url":"https://x402-gateway-production.up.railway.app/api/code/run","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","bodyType","body","method"],"properties":{"body":{"type":"object","required":["code"],"properties":{"code":{"type":"string","example":"print(\"hello\")","description":"Code to execute"},"timeout":{"type":"number","default":60,"example":60,"description":"Execution timeout in seconds (1-300)"},"language":{"type":"string","default":"python","example":"python","description":"Programming language (python, javascript, bash, r)"}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"code":"print('Hello from sandbox'); result = sum([1, 2, 3, 4, 5]); print(f'Sum: {result}')","language":"python"},"response":{"stderr":"","stdout":"Hello from sandbox\nSum: 15\n","outputs":[],"success":true,"exit_code":0,"execution_time_ms":380}},"exampleRequest":{"code":"print('Hello from sandbox'); result = sum([1, 2, 3, 4, 5]); print(f'Sum: {result}')","language":"python"},"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_03zdtspIM3OWfENfI7DHR","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Executes Python, JavaScript, Bash, or R code in an isolated sandbox and returns stdout, stderr, exit code, and execution time","exampleAgentPrompt":"Can you run this Python snippet for me and show me the output: `import statistics; data = [4, 8, 15, 16, 23, 42]; print(statistics.mean(data), statistics.stdev(data))`?","exampleUseCases":null,"resultDescription":"Returns a JSON object with: stdout (string output from the code), stderr (any error messages), success (boolean), exit_code (integer), execution_time_ms (how long it took), and outputs (array of any structured outputs). On success, stdout contains the printed results of the code run.","failureModes":["Code syntax error — success:false, non-zero exit_code, error message in stderr","Execution timeout — code runs longer than 5 minutes, process killed","Unsupported language specified — returns error for languages other than python/javascript/bash/r","Runtime error — unhandled exceptions cause non-zero exit code and traceback in stderr","Missing required fields — no code or language provided returns 400-level error"],"whenToPreferThis":"Use this endpoint when you need to execute arbitrary code in Python, JavaScript, Bash, or R without a local runtime environment. Ideal for dynamic computation, data transformation, math-heavy tasks, scripting, or testing small code snippets. Prefer this over LLM-only computation when you need exact numerical results, file processing logic, or reproducible scripted outputs. Supports up to 5 minutes of runtime, making it suitable for moderate data processing tasks.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":1,"lastUsedAt":"2026-08-05T05:23:30.154Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:42:27.269Z","isFirstParty":false}