# Agent402 Stateless CAPTCHA Challenge Generator

> Agent402 Stateless CAPTCHA Challenge Generator is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Generates a stateless CAPTCHA challenge (human prompt + salted SHA-256 answer hash) that you can use to gate your own endpoint without any server-side state.

## Facts

- Endpoint: POST https://agent402.tools/api/captcha-generate
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-stateless-captcha-challenge-generator-066db972
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_plVp718ltHoa1EMekp0XC

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 agent402-stateless-captcha-challenge-generator-066db972 -d '<json body>'
```

Example prompt: Generate a difficulty-2 math captcha challenge I can use to gate my API endpoint — give me the human prompt and the salted SHA-256 answer hash so I can verify responses myself without any server state.

## When to prefer this

Choose this endpoint when you need a lightweight, serverless CAPTCHA mechanism to gate your own API or endpoint without maintaining any server-side session or state. It is ideal for stateless microservices, edge deployments, or any scenario where you want challenge-response bot protection with zero infrastructure overhead. Prefer it over traditional CAPTCHA services when you don't want a third-party verify step or shared secret.

## Known failure modes

- Invalid 'type' value (not 'math' or 'alnum') — likely 400 or default fallback to math
- Difficulty out of range (not 1–3) — likely 400 or clamped to nearest valid value
- Payment failure (x402 protocol) — 402 Payment Required if USDC payment not included
- Malformed JSON body — 400 Bad Request

## How this service works

Mint a stateless captcha challenge to gate your OWN endpoint: returns a human prompt plus a salted sha256 answer hash you keep and verify later (sha256(salt + normalized answer) === answerHash) - no server state, no shared secret. Types: math (arithmetic) or alnum (character code), difficulty 1–3. Deterministic tooling for running bot protection, not defeating it.

## Output

Returns a human-readable challenge prompt (e.g. a math question), a salt value, and a salted SHA-256 hash of the correct answer (sha256(salt + normalizedAnswer)). The caller keeps the hash and salt to verify user responses later without any server-side state or shared secrets.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "type": {
   "type": "string",
   "description": "math | alnum (default math)"
  },
  "difficulty": {
   "type": "integer",
   "description": "1–3 (default 1)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "algo": "sha256",
  "salt": "…",
  "type": "math",
  "prompt": "What is 3 + 4?",
  "verify": "sha256(salt + answer.trim().toLowerCase().replace(/\\s+/g,'')) === answerHash",
  "answerHash": "…"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-stateless-captcha-challenge-generator-066db972/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
