{"uid":"cap_HpRmmJZTZyXTxgOFWMz5m","slug":"whatchuneed-code-execution-api-905bdd21","name":"whatchuneed Code Execution API","description":"320+ pay-per-call API endpoints across accommodation, LLM, code execution, crypto, medical, finance, and more. One API, one payment. Powered by x402 protocol.","url":"https://whatchuneed.vercel.app/api/code/execute","method":"POST","headers":{},"bodySchema":{"type":"object","required":["code","language"],"properties":{"code":{"type":"string","description":"Source code to execute"},"stdin":{"type":"string","description":"Standard input"},"version":{"type":"string","description":"Language version (optional)"},"language":{"type":"string","description":"Language name (python, javascript, rust, etc.)"}}},"responseSchema":{"type":"object","properties":{"stderr":{"type":"string"},"stdout":{"type":"string"},"version":{"type":"string"},"exitCode":{"type":"integer"},"language":{"type":"string"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.1","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.1/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_i02VLBnXN8_-VBJolcC38","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.1","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Executes source code in a specified programming language (Python, JavaScript, Rust, etc.) and returns stdout, stderr, and exit code","exampleAgentPrompt":"Run this Python script for me and tell me what it prints: `import math; print(math.factorial(10))`","exampleUseCases":[{"title":"Dynamic calculation in agent workflow","prompt":"Execute this Python snippet for me and return the result: `def compound_interest(p, r, t): return p * (1 + r/100)**t; print(compound_interest(1000, 5, 10))`"},{"title":"Test JavaScript string parsing logic","prompt":"Run this JavaScript code and show me the output: `const s = 'hello world'; console.log(s.split(' ').map(w => w[0].toUpperCase() + w.slice(1)).join(' '));`"},{"title":"Compile and run a Rust program","prompt":"Execute this Rust code and tell me if it compiles and what it outputs: `fn main() { let v: Vec<i32> = (1..=5).collect(); println!(\"{:?}\", v); }`"}],"resultDescription":"Returns an object with stdout (standard output string), stderr (standard error string), exitCode (integer process exit code), language (the language used), and version (runtime version used). A zero exit code indicates successful execution.","failureModes":["Unsupported language name returns an error or non-zero exit code","Syntax errors in code surface in stderr with non-zero exitCode","Infinite loops or long-running code may time out","Missing required fields (code or language) return a 4xx error","Runtime exceptions appear in stderr with non-zero exitCode"],"whenToPreferThis":"Choose this endpoint when an AI agent needs to dynamically execute untrusted or generated code in a sandboxed remote environment without provisioning local compute. It is well-suited for agent workflows that need to evaluate mathematical expressions, test code snippets, or run scripts across multiple languages (Python, JavaScript, Rust, etc.) on a pay-per-call basis with no setup overhead.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:50:12.843Z","isFirstParty":false}