# WhiteMagic Receipt Verification & Notarization API (`api.whitemagic.dev`)

> Stateless cryptographic verification for Causal Provenance Receipts (CPR `0.1`–`0.6`), AER-1 execution receipts (`draft-zambo-aer1-23` Section 6), OpenTimestamps anchor proofs, caller-claim context notarization, ERC-8004 validation statements, and owner-scoped Memory Crystals.

- Canonical site: https://www.whitemagic.dev
- Hosted recall MCP: https://mcp.whitemagic.dev/mcp
- OpenAPI 3.1 contract: https://api.whitemagic.dev/openapi.json
- Full API reference (`llms-full.txt`): https://api.whitemagic.dev/llms-full.txt
- Live verifier metadata: https://api.whitemagic.dev/info
- API catalog (RFC 9727): https://api.whitemagic.dev/.well-known/api-catalog
- MCP server card: https://api.whitemagic.dev/.well-known/mcp/server-card.json
- A2A agent card: https://api.whitemagic.dev/.well-known/agent-card.json
- x402 discovery & rate card: https://api.whitemagic.dev/.well-known/x402
- Crawler policy: https://api.whitemagic.dev/robots.txt

## Keyless Endpoints

- `GET /health` — keyless liveness check (`{"ok": true}`), even when TAP keyring and AWS x402 flags are enabled.
- `GET /info` — live verifier runtime version (`0.5.4`), supported specs, signing DID, and corpus digests.
- `GET /revocations/{issuer}` — stored revocation document for an issuer DID (ETag/304).
- `GET /anchors/{digest}` — hosted OpenTimestamps `.ots` proof by `sha256:<hex>` (ETag/304).
- `GET /notarize/{digest}` — hosted Ed25519-signed caller-claim context notarization statement (ETag/304).
- `GET /receipts/{tx}` — stored settlement receipt by transaction hash.
- `POST /aer1/verify` (or `POST /verify-aer1`) — keyless independent verification probe for AER-1 `0.3`/`0.4` receipts (`draft-zambo-aer1-23` Section 6).
- `POST /mcp` (`initialize`, `ping`, `tools/list`) — keyless MCP JSON-RPC 2.0 discovery.
- `GET /.well-known/x402` (and `/.well-known/x402.json`, `/.well-known/pricing`) — keyless multi-rail pricing & TAP capability discovery.

## Metered & Keyed Endpoints

Authenticate with `Authorization: Bearer <key|wm_pass_...>`, `X-WM-Key`, `X-Session-Pass`, opt-in trial header `X-WM-Trial: 1` (`10 calls/day` base trial; `3x` daily trial quota multiplier / `30 calls/day` when paired with verified RFC 9421 Trusted Agent Protocol `Signature` + `Signature-Input` headers), free instant evaluation key (`POST https://mcp.whitemagic.dev/api/keys/request` with `{}` -> 50 calls/day), `CRYPTO_X402` Base USDC (`PAYMENT-SIGNATURE` / `X-PAYMENT`, starting at `$0.002` call pass or `$0.01` task lease), or `AWS_BILLING_X402` (`aws.agentcorepayments.awsbilling.v1`, fail-closed AWS Marketplace rail when configured). `api.whitemagic.dev` and `mcp.whitemagic.dev` share a cross-lane flocked nano-credit ledger:

- `POST /verify` — verify a continuity-receipt bundle (`?receipt=1` for signed verification receipt, `?require_anchor=1`, `?cache=1`).
- `POST /verify-receipt` — verify a signed verification receipt.
- `POST /verify-confinement` (or `POST /confinement/verify`) — verify a signed `wm-confinement-receipt/1.1` bubblewrap confinement provenance receipt for sandboxed swarm runs (optional `?receipt=1` Ed25519 counter-signed verification receipt).
- `POST /verify-anchor` — verify a base64 OpenTimestamps `.ots` proof against `sha256:<hex>`.
- `POST /anchors` — host a verified `.ots` anchor proof for keyless lookup.
- `POST /notarize` — sign caller-supplied `context_digest` / `prompt_hash` (`sha256:<64 hex>` or `64 hex`) with optional `action`, `model`, `agent_id`, and bounded `claims`/`metadata` (does not observe underlying context or assert claim truth).
- `POST /conformance` — grade verifier outputs over the pinned corpus.
- `POST /erc8004/validate` — ERC-8004 validation adapter (`$0.01` task lease floor; returns Ed25519-signed canonical JSON, no onchain relay).
- `POST /crystals` — store sealed `wm-crystal/1.0` client-encrypted envelopes (`$0.01` task lease floor; requires provisioned owner-mapped credential).
- `POST /mcp` (`tools/call`) — `verify_bundle`, `verify_anchor`, `get_revocations`, `receipt_notarize`, `verify_aer1_receipt`.
