{"uid":"cap_thPpX76rjbmlkp-6oHD2G","slug":"judge0-via-locus-x402-code-execution-8af11f26","name":"Judge0 via Locus x402 — Code Execution","description":"Online code execution — run source code in 60+ programming languages with sandboxed isolation.","url":"https://judge0.x402.paywithlocus.com/judge0/execute-code?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"stdin":{"type":"string"},"language_id":{"type":"integer"},"source_code":{"type":"string"},"stack_limit":{"type":"number"},"memory_limit":{"type":"number"},"cpu_time_limit":{"type":"number"},"enable_network":{"type":"boolean"},"expected_output":{"type":"string"},"wall_time_limit":{"type":"number"},"compiler_options":{"type":"string"},"command_line_arguments":{"type":"string"},"redirect_stderr_to_stdout":{"type":"boolean"}}},"responseSchema":{"type":"json","example":{"data":{},"payment":{"scheme":"exact","settledUsdc":"0.001000","authorizedMaxUsdc":"0.001000"},"request":{"id":"00000000-0000-4000-8000-000000000000","statusUrl":"/requests/00000000-0000-4000-8000-000000000000"},"success":true}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.006","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.006/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.006","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.006","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_aGgCwNSd2Ti6uX2qEvsWk","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.006","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 sandboxed environment supporting 60+ programming languages and returns stdout, stderr, and execution metadata","exampleAgentPrompt":"Run this Python 3 script (language ID 71) for me and return the output — the code reads two numbers from stdin and prints their sum, and I want to pass '3 5' as the input.","exampleUseCases":[{"title":"Algorithm solution testing","prompt":"Run this Python 3 code (language ID 71) against the input '10 20 30' and tell me if the output matches '60' — I want to verify my solution before submitting it."},{"title":"C++ compilation and execution","prompt":"Compile and run this C++ code (language ID 54) with the '-O2' compiler flag and a memory limit of 256000 KB — the program takes no stdin, just tell me what it prints."},{"title":"Interactive coding tutor check","prompt":"Execute this JavaScript snippet (language ID 63) and show me both the standard output and any errors — I want to debug why it's printing the wrong value."}],"resultDescription":"A JSON object containing a 'data' field with execution results (stdout, stderr, status code, compile output, execution time, memory used), a 'payment' object confirming USDC settled, a 'request' object with a UUID and status URL for async polling, and a 'success' boolean.","failureModes":["Invalid language_id returns an error indicating unsupported language","Source code that exceeds CPU or wall time limit returns a Time Limit Exceeded status","Memory usage beyond memory_limit returns Memory Limit Exceeded","Compilation errors for statically-typed languages are returned in compile_output field","Network errors within the sandbox if enable_network is false and code attempts network calls","Malformed JSON body or missing source_code field returns a 400-level error","Payment failure (insufficient funds or x402 protocol error) prevents execution"],"whenToPreferThis":"Choose this endpoint when you need remote, sandboxed code execution across a wide variety of programming languages (60+) without provisioning your own infrastructure, and when micropayment-per-execution billing via x402/USDC is acceptable. Ideal for AI agents that need to run untrusted or user-supplied code safely, evaluate algorithm correctness, or power coding assistants and educational tools. Prefer this over self-hosted runners when isolation, multi-language support, and pay-per-use economics matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T00:31:01.552Z","isFirstParty":false,"canonicalSlug":"judge0-via-locus-x402-code-execution-ec558582"}