{"uid":"cap_7Mdz-uZFPby_EyhAjopML","slug":"staging-toolkit-dev-58da75f2","name":"E2B Python Code Sandbox Runner","description":"Run Python code in a secure sandbox environment using E2B. Supports Jupyter Notebook syntax and returns execution results and logs.","url":"https://staging.toolkit.dev/api/tool/e2b/run-code?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"The Python code to execute in the sandbox"}}},"responseSchema":{"type":"object","required":["results","logs"],"properties":{"logs":{"type":"any","required":true,"description":"Execution logs"},"results":{"type":"array","required":true,"description":"The execution results from running the code"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":1,"rating":{"score":"0.00","successRate":"0.00","reviews":1,"stars":null,"state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_HCmmX5uxnDvby8dsCpjLO","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Executes Python code in a secure E2B sandbox environment and returns execution results and logs","exampleAgentPrompt":"Run this Python code in a secure sandbox and show me the output: `import pandas as pd; df = pd.DataFrame({'x': [1,2,3], 'y': [4,5,6]}); print(df.describe())`","exampleUseCases":[{"title":"Analyze customer data and generate insights","prompt":"I have a CSV with sales data. Can you run some Python code to calculate average order value by region and show me which regions are performing best?"},{"title":"Validate and test data transformations","prompt":"Before we deploy this data pipeline, can you run the transformation logic in a sandbox to make sure it handles our edge cases correctly? I'll give you sample data and the Python script."},{"title":"Generate visualizations from research datasets","prompt":"I've got experimental results in JSON format. Can you run Python code to create charts showing the correlation between variables and save the plots?"}],"resultDescription":"Returns a JSON object with an array of execution results (output values, plots, or data produced by the code) and logs (stdout/stderr and runtime messages) from the Python sandbox execution.","failureModes":["Syntax error in provided Python code returns error in logs","Unsupported library or missing package causes import failure","Code timeout for long-running computations","Invalid input schema if 'code' field is missing","Network/sandbox provisioning failure returns 5xx error"],"whenToPreferThis":"Choose this endpoint when you need to execute arbitrary Python code in a secure, isolated cloud sandbox powered by E2B, especially for data analysis, mathematical computation, or code testing without a local Python environment. Prefer this over general scripting when you need Jupyter Notebook-compatible execution with structured results and logs returned.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":1,"lastUsedAt":"2026-05-06T03:23:53.734Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T15:29:15.369Z","isFirstParty":false,"canonicalSlug":"staging-toolkit-dev-58da75f2"}