{"uid":"cap_OMBM0r9y3N1z_TJH0ghJV","slug":"judge0-via-locus-x402-code-execution-ec558582","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/submit-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_nIbu9Nz9gprPAz2Kdle1-","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 across 60+ programming languages and returns the program output","exampleAgentPrompt":"Run this Python 3 script for me — here's the source code: `print(sum(int(x) for x in input().split()))` — with stdin set to '1 2 3 4 5', and tell me what it outputs.","exampleUseCases":[{"title":"Automated coding challenge judge","prompt":"Run this C++ solution (language ID 54) against the input '5\\n1 2 3 4 5' and check whether the output matches '15' — I need to know if my solution passes the test case."},{"title":"Live code snippet in docs pipeline","prompt":"Execute this JavaScript snippet (language ID 63) from our documentation to verify it still produces the expected output 'Hello, World!' — flag it if the output doesn't match."},{"title":"Python data processing in agent workflow","prompt":"Run this Python 3 script (language ID 71) with compiler flag '-O2' and stdin '10 20 30', then return whatever it prints to stdout so I can use the result in the next step."}],"resultDescription":"Returns a JSON object containing the program's stdout, stderr, execution status (accepted, wrong answer, time limit exceeded, runtime error, etc.), runtime and memory usage metrics, plus payment confirmation details (settled USDC amount) and a request ID for status polling.","failureModes":["Invalid language_id returns an error or unsupported language response","Source code that exceeds memory_limit results in a memory limit exceeded status","Programs running longer than cpu_time_limit or wall_time_limit return a time limit exceeded status","Compilation errors in statically typed languages (C++, Java) return a compile error status with compiler output","Runtime errors (exceptions, segfaults) return a runtime error status","Malformed JSON body or missing source_code field returns a 400-level error","Insufficient USDC payment or x402 payment failure blocks execution"],"whenToPreferThis":"Choose this endpoint when you need to execute arbitrary source code in a sandboxed, isolated environment without provisioning your own infrastructure. It is ideal for AI agents that need to validate code correctness, run user-submitted scripts, power online judges for competitive programming, or produce computed results from code within an automated workflow. Supports 60+ languages including Python, JavaScript, C++, Java, and many more. Prefer this over self-hosted runners when you want per-call micropayment billing via x402 and zero infrastructure management.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T18:30:02.571Z","isFirstParty":false,"canonicalSlug":"judge0-via-locus-x402-code-execution-ec558582"}