{"uid":"cap_aoh2vIlsO_mzqadKNr-bV","slug":"whatchuneed-code-test-runner-571f31a1","name":"WhatChuNeed Code Test Runner","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/test","method":"POST","headers":{},"bodySchema":{"type":"object","required":["code","tests","language"],"properties":{"code":{"type":"string"},"tests":{"type":"array"},"language":{"type":"string"}}},"responseSchema":{"type":"object","properties":{"failed":{"type":"integer"},"passed":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"pass":{"type":"boolean"},"input":{"type":"string"},"actual":{"type":"string"},"expected":{"type":"string"}}}}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.15","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.15/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.15","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.15","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_vixHZCdAsbF5CIoQifZLl","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.15","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Executes code against a set of test cases and returns pass/fail results with actual vs expected output for each test","exampleAgentPrompt":"Run my Python function `def add(a, b): return a + b` against these test cases — input [1,2] should return 3, input [5,5] should return 10, and input [-1,1] should return 0 — and tell me how many pass and which ones fail.","exampleUseCases":[{"title":"Validate coding challenge solution","prompt":"I wrote a JavaScript solution for a binary search problem — can you test it against these 5 test cases: input [1,3,5,7] target 3 expects index 1, input [2,4,6] target 5 expects -1, and so on — let me know which ones pass and which fail."},{"title":"Debug failing unit tests","prompt":"My Python function is supposed to reverse a string but I think it's broken — run it against inputs 'hello' expecting 'olleh', 'abc' expecting 'cba', and '' expecting '' so I can see what it's actually outputting."},{"title":"Auto-grade student code submission","prompt":"Check this student's Python submission that implements a factorial function — test it with input 0 expecting 1, input 5 expecting 120, and input 10 expecting 3628800, and give me a pass/fail breakdown."}],"resultDescription":"Returns a JSON object with the total number of passed and failed tests, plus a detailed results array where each entry shows the input, expected output, actual output, and whether the test passed or failed.","failureModes":["Invalid or unsupported programming language causes rejection","Malformed code syntax may cause execution errors or timeouts","Empty test array returns no results","Payment failure via x402 results in 402 response before execution","Code with infinite loops or excessive resource usage may timeout","Mismatched input/expected types in test cases may cause unexpected failures"],"whenToPreferThis":"Use this endpoint when you need to programmatically execute a code snippet against multiple test cases and get structured pass/fail feedback. Ideal for coding challenge grading, automated validation of AI-generated code, or debugging a function against known inputs and expected outputs. Prefer this over a generic code execution endpoint when you specifically need test comparison semantics with per-case pass/fail results.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T13:05:04.542Z","isFirstParty":false}