Developers

Plug pay-per-pass into
any agent or AI tool.

1 · MCP server

Remote MCP over Streamable HTTP, no auth needed for the sandbox demo. Add it to any MCP client by URL:


    
ToolWhat it does
search_quality_indexRanks studios by money-backed pass rate (read-only).
draft_acceptance_checklistTurns the buyer's words into 3–6 checkable criteria.
create_outcome_orderOpens the order and a PayPal authorization. Returns approve_url for the human. The agent cannot approve it.
get_order_statusMoves the order forward and returns verdicts, evidence, money captured/released and the receipt URL.
verify_receiptChecks the Ed25519 signature of a verdict receipt.

Try it from a terminal:


  

2 · The money flow (PayPal REST, sandbox)

  1. POST /v2/checkout/orders with intent: "AUTHORIZE". The contract hash goes into purchase_units[0].custom_id; the line item is quantity × unit price.
  2. The buyer approves on PayPal. On return (or on the CHECKOUT.ORDER.APPROVED webhook) we call POST /v2/checkout/orders/{id}/authorize. Funds are held, not charged.
  3. The studio generates; two vision models judge each image against the checklist; a third breaks ties.
  4. If anything passed: POST /v2/payments/authorizations/{id}/capture for exactly passed × unit price with final_capture: true, which releases the remainder. If nothing passed: POST /v2/payments/authorizations/{id}/void.
  5. Buyer appeals that are upheld by a stronger model trigger POST /v2/payments/captures/{id}/refund for that item.
  6. Webhooks are verified with /v1/notifications/verify-webhook-signature and recorded on the order's PayPal trail.

3 · HTTP API

GET /api/indexQuality Index and latest receipts
POST /api/criteria{ brief } → { title, criteria[] }
POST /api/orders{ studio_id, brief, criteria[], quantity } → order + approve_url
GET /api/orders/:idOrder, items, verdicts, money and PayPal trail (also advances the order)
POST /api/orders/:id/appeal{ item, reason } → re-inspection, refund if upheld
GET /api/receipts/:idSigned receipt, canonical payload, signature

4 · Verify a receipt yourself

Receipts are Ed25519 signatures over canonical JSON (keys sorted). The public key is at /.well-known/earned-receipt-key.json.

const r = await (await fetch(origin + '/api/receipts/' + id)).json();
const { keys: [jwk] } = await (await fetch(r.public_key_url)).json();
const key = await crypto.subtle.importKey('jwk', jwk, { name: 'Ed25519' }, false, ['verify']);
const ok = await crypto.subtle.verify({ name: 'Ed25519' }, key,
  base64urlDecode(r.signature), new TextEncoder().encode(r.canonical));

Source

MIT licensed. Cloudflare Workers + D1 + R2, TypeScript, no frameworks. Run it locally with your own PayPal sandbox app and any OpenAI-compatible model gateway: see the README.