# Test Case Generator

> Test Case Generator is a paid API for AI agents from api.strale.io, paid per call via x402, $0.162/call, status unknown (last checked 2026-10-10).

Generates comprehensive test cases from a function description or signature, including happy path, edge cases, boundary tests, and error cases

## Facts

- Endpoint: GET https://api.strale.io/x402/test-case-generate?utm_source=zero.xyz
- Price: $0.162/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 2
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-7043d0cc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mgm68TEEfxb4Kxc1gyFf_

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 api-strale-io-7043d0cc
```

Example prompt: Generate comprehensive test cases for a Python function that validates email addresses — include happy path, edge cases, boundary tests, and error cases.

## When to prefer this

Use this endpoint when you need to quickly scaffold a comprehensive test suite for a function and want coverage across happy path, edge, boundary, and error scenarios without writing them manually. Especially useful for TDD workflows, code review automation, or when onboarding to an unfamiliar codebase.

## Known failure modes

- Missing required function_description parameter returns 400 Bad Request
- Ambiguous or very short function description may produce generic or low-quality test cases
- Unsupported language value may result in language-agnostic output or error
- Payment failure (402) if USDC balance is insufficient
- Service timeout for very complex or lengthy function descriptions

## How this service works

Generate test cases from a function description or signature. Includes happy path, edge cases, boundary tests, and error cases.

## Output

A structured list of test cases covering: happy path scenarios (valid inputs that should succeed), edge cases (unusual but valid inputs), boundary tests (limit values like empty strings, max length), and error cases (invalid inputs that should raise exceptions or return errors). Results are keyed to the function description provided.

## Example request

```json
{
 "language": "python",
 "include_edge_cases": true,
 "function_description": "A function that validates a user email address format and checks if the domain exists. It takes a string parameter representing an email address and returns a boolean indicating whether the email is valid. The function should check for proper email format (local-part@domain.extension) and verify that the domain has valid MX records."
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "function_description"
     ],
     "properties": {
      "language": {
       "type": "string"
      },
      "include_edge_cases": {
       "type": "boolean"
      },
      "function_description": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-7043d0cc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
