{"uid":"cap_RqZfBZbLylS4seXotw0nG","slug":"agent402-tools-pro-code-execution-python-javascript-eb98d92b","name":"agent402.tools Pro Code Execution (Python/JavaScript)","description":"Execute Python or JavaScript code in a secure, isolated cloud sandbox (Pro tier). Same as /api/code-run but with 60s timeout and 50k char code limit for longer computations. Returns stdout, stderr, and the expression result.","url":"https://agent402.tools/api/code-run-pro","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"code":{"type":"string","description":"Source code to execute (max 50,000 chars)"},"language":{"type":"string","description":"Language: python (default) or javascript"}}},"responseSchema":{"type":"json","example":{"error":null,"result":null,"stderr":"","stdout":"Hello from Agent402!\n","language":"python"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","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.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_GIXgCatFJyg74MuZD03Ee","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 or JavaScript code in a secure, isolated cloud sandbox with a 60-second timeout and 50,000-character code limit, returning stdout, stderr, and the expression result.","exampleAgentPrompt":"Run this Python script for me in a secure cloud sandbox — it's about 200 lines long and does some heavy number crunching, so it might take up to a minute: [paste code here]","exampleUseCases":null,"resultDescription":"Returns the standard output (stdout), standard error (stderr), and the final expression result from the executed code, giving the agent full visibility into what the script produced or any errors it raised.","failureModes":["Code exceeds 50,000 character limit — rejected with validation error","Execution exceeds 60-second timeout — returns timeout error","Unsupported language specified (not python or javascript) — returns validation error","Runtime error in user code — returned in stderr field","Payment not processed or insufficient USDC — 402 response blocking execution"],"whenToPreferThis":"Choose this Pro endpoint over the standard /api/code-run endpoint when your code is long (up to 50,000 characters) or computationally intensive and may require up to 60 seconds to complete. Prefer this when you need a secure, isolated sandbox for Python or JavaScript execution without local environment setup.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:14:04.658Z","isFirstParty":false}