# x402.forgemesh.io Provably-Fair Random Number API

> x402.forgemesh.io Provably-Fair Random Number API is a paid API for AI agents from x402.forgemesh.io, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Generates a verifiable random integer in a user-specified range using HMAC-SHA256 over a client seed, returning the server seed so the result can be independently audited.

## Facts

- Endpoint: POST https://x402.forgemesh.io/provably-fair-random
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-forgemesh-io-provably-fair-random-number-api-c2400f7a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bsWadIlhiP127SWWyhchA

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 x402-forgemesh-io-provably-fair-random-number-api-c2400f7a -d '<json body>'
```

Example prompt: Pick a provably fair random number between 1 and 500 using my seed 'myseed42' so I can verify the draw myself afterward.

## When to prefer this

Choose this endpoint when you need a random number that is independently auditable — i.e. when players, participants, or auditors must be able to verify after the fact that the draw was not rigged. Ideal for games, raffles, lotteries, A/B assignment, or any context requiring trustless randomness.

## Known failure modes

- Invalid min/max range (e.g. min >= max) returns an error
- Missing or malformed client_seed may cause rejection
- Payment of $0.002 USDC not included or invalid returns 402 Payment Required
- Server-side HMAC computation failure returns 500

## How this service works

Provably-fair random number API: an integer in your min-max range drawn via HMAC-SHA256 over your client seed, with the server seed revealed in the response so anyone can recompute and verify the draw was fair. For games, raffles, sampling, A/B assignment, and tie-breaking between agents.

## Output

Returns a random integer within the specified min-max range, plus the server seed used in the HMAC-SHA256 computation, allowing any party to independently recompute and confirm the result was not manipulated.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "max": {
   "type": "string",
   "description": "default 100"
  },
  "min": {
   "type": "string",
   "description": "default 1"
  },
  "client_seed": {
   "type": "string",
   "description": "your seed for verifiability"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "proof": "HMAC-SHA256(server_seed, client_seed) first 4 bytes mod range — recompute to verify",
  "value": 4,
  "server_seed_revealed": "e3b1..."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-forgemesh-io-provably-fair-random-number-api-c2400f7a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.forgemesh.io](https://www.zero.xyz/host/x402.forgemesh.io/llms.txt)
