{"uid":"cap_uxgUvdBPwYM2BMvk4072o","slug":"e2b-sandboxed-python-code-execution-3497de0e","name":"E2B Sandboxed Python Code Execution","description":"Sandboxed Python code execution via E2B","url":"https://signal-engine-production-d88d.up.railway.app/v1/gateway/execute/e2b","method":"POST","headers":{},"bodySchema":{"output":{"required":["stdout","stderr"],"properties":{"error":{"type":"string","nullable":true},"stderr":{"type":"array","items":{"type":"string"}},"stdout":{"type":"array","items":{"type":"string"}}}}},"responseSchema":{"type":"json","example":{"error":null,"stderr":[],"stdout":["4\n"]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.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_npjk1KkcuUC8OCQlK_8al","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 arbitrary Python code in a secure E2B sandbox and returns stdout, stderr, and error output","exampleAgentPrompt":"Run this Python snippet in a sandbox and tell me what it outputs: `import math; print(math.factorial(10))`","exampleUseCases":[{"title":"Dynamic data calculation in an agent pipeline","prompt":"I need you to run this Python code to calculate compound interest for me: `principal = 1000; rate = 0.05; years = 10; print(principal * (1 + rate) ** years)`"},{"title":"Validating generated code before deployment","prompt":"Can you execute this Python function I wrote to verify it produces the right output before I use it? Here's the snippet: `def fib(n): return n if n <= 1 else fib(n-1)+fib(n-2); print(fib(10))`"},{"title":"Ad-hoc data transformation during analysis","prompt":"Run this Python code in a safe sandbox to parse and summarize my CSV data: `import csv, io; data='name,age\\nAlice,30\\nBob,25'; reader=csv.DictReader(io.StringIO(data)); [print(r) for r in reader]`"}],"resultDescription":"A JSON object containing an `error` field (null if successful), a `stdout` array of strings representing each line of standard output, and a `stderr` array of strings for any error output from the script.","failureModes":["Syntax error in submitted Python code returns a non-null error field with the exception message","Runtime exceptions (e.g. ZeroDivisionError, ImportError) surface in stderr or error field","Execution timeout if script runs too long","Unavailable third-party libraries not pre-installed in the sandbox environment","Network errors or sandbox provisioning failures returning HTTP 5xx"],"whenToPreferThis":"Choose this endpoint when you need to execute dynamic Python code safely in an isolated environment without setting up local infrastructure — ideal for AI agents that generate or validate code, perform numeric computations, transform data programmatically, or run user-submitted scripts securely. Prefer this over local execution when sandboxing and reproducibility matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T13:08:32.767Z","isFirstParty":false}