Developer center / OpenAPI

Swagger API Explorer

Explore the REST and MCP contracts implemented in the Cloudflare Worker, inspect service availability, and integrate with an agent API key. Browser verification remains available on Verify Bets.

Swagger wordmark with green API icon

Checking API availability…

The OpenAPI specification describes implemented Worker routes. It is not proof of deployment; request execution remains disabled until this site can reach the API health endpoint.

API origin: https://api.provablyfair.click

Checking payment status… Certificate issuance remains separately controlled and requires human review.

OpenAPI 3.0 · API reference

Interactive API reference

Swagger executes requests only while the API service is reachable. An API key and X-Idempotency-Key are required for billable verification; certificate lookups and tool discovery are public.

Loading the Swagger UI explorer…

Reference verification

Implemented REST route for reference protocol checks. Single-bet verification is free — no key, 10 calls/day per IP. Paid calls require authentication, credit and an idempotency key.

Certificate lookup

Public certificate-status lookup is live. The first certificate, PFC-2026-0001 (CantonCrypto preview games), was issued 2026-11-24 and is active.

Agent integration

REST bearer keys, MCP tool discovery, D1 credit accounting and replay guards are deployed and live. Paid calls deduct from prepaid USDC credit.

Quick start

Call the API from an agent

Replace pfc_YOUR_KEY with a self-serve agent API key from the For Agents page. Every billable call needs a unique X-Idempotency-Key (12–120 characters); reusing one returns the original charge instead of billing twice. Prices: 0.002 USDC per verification, 0.001 USDC per batched bet, 15 USDC per assessment suite, 5 USDC per signed evidence export. Certificate lookups and balance checks are free.

1. Verify one bet over REST

curl -X POST https://api.provablyfair.click/api/v1/verify \
  -H "Authorization: Bearer pfc_YOUR_KEY" \
  -H "X-Idempotency-Key: verify-0001" \
  -H "Content-Type: application/json" \
  -d '{"protocol":"pfc-hmac-v1","game":"dice","serverSeed":"revealed-server-seed","clientSeed":"player-seed","nonce":1,"serverSeedHash":"64-hex-pre-bet-commitment","observedOutcome":4}'

2. Same call over MCP

Streamable HTTP JSON-RPC at POST /mcp. Use initialize, then tools/list to discover tools, then tools/call.

curl -X POST https://api.provablyfair.click/mcp \
  -H "Authorization: Bearer pfc_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"verify_bet","arguments":{"protocol":"pfc-hmac-v1","game":"dice","serverSeed":"revealed-server-seed","clientSeed":"player-seed","nonce":1,"serverSeedHash":"64-hex-pre-bet-commitment","observedOutcome":4}}}'

3. Top up prepaid credit

Agents pay from a prepaid USDC balance. Top up with a server-created invoice — direct transfers without an invoice are never credited.

# 1. Create a top-up invoice (minimum 10 USDC, exact amount, 30-minute window)
curl -X POST https://api.provablyfair.click/api/v1/credits/invoices \
  -H "Authorization: Bearer pfc_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"chain":"ethereum"}'
# 2. Pay the exact invoiced USDC amount to the recipient on Ethereum mainnet.
# 3. Claim it with the transaction hash (credited after 12 confirmations)
curl -X POST https://api.provablyfair.click/api/v1/credits/claim \
  -H "Authorization: Bearer pfc_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"invoiceId":"invoice-id-from-step-1","transaction":"0x..."}'
A laptop with code on its screen on a bright desk
Swagger is a third-party OpenAPI documentation tool, not an endorsement or certification of ProvablyFair.click.About Swagger UI