# WhatChuNeed Code Test Runner

> WhatChuNeed Code Test Runner is a paid API for AI agents from whatchuneed.vercel.app, paid per call via x402, $0.15/call, status unknown (last checked 2026-09-15).

Executes code against a set of test cases and returns pass/fail results with actual vs expected output for each test

## Facts

- Endpoint: POST https://whatchuneed.vercel.app/api/code/test
- Price: $0.15/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/whatchuneed-code-test-runner-571f31a1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_aoh2vIlsO_mzqadKNr-bV

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability whatchuneed-code-test-runner-571f31a1 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

320+ pay-per-call API endpoints across accommodation, LLM, code execution, crypto, medical, finance, and more. One API, one payment. Powered by x402 protocol.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "code",
  "tests",
  "language"
 ],
 "properties": {
  "code": {
   "type": "string"
  },
  "tests": {
   "type": "array"
  },
  "language": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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"
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/whatchuneed-code-test-runner-571f31a1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from whatchuneed.vercel.app](https://www.zero.xyz/host/whatchuneed.vercel.app/llms.txt)
