{"openapi":"3.1.0","info":{"title":"RevRule by Payload","version":"1.0.0","description":"RevRule turns agreements and revenue into auditable economic entitlements. Upload the agreement. Connect the revenue. RevRule determines who is owed what. Your payment rail moves the money. RevRule determines the economics.","x-guidance":"Use POST /v1/x402/event to submit a machine-commerce revenue event. Send JSON with graphId, amountUsd, source, and participants. Without payment it returns 402 with x402 payment requirements (0.01 USDC on Base); include the paid txHash and retry. The response contains per-participant entitlements and an auditable ledger entry.","contact":{"email":"kylers.partners@gmail.com"}},"servers":[{"url":"https://payload-rail.fly.dev"}],"paths":{"/v1/x402/event":{"post":{"operationId":"submitX402Event","summary":"Submit a paid x402 economic event (API key required)","description":"Evaluates a machine-commerce revenue event against a Revenue Graph and returns per-participant entitlements with an auditable ledger entry. Requires API key authentication plus 0.01 USDC on Base per event via x402.","security":[{"ApiKeyAuth":[]}],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.010000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"graphId":{"type":"string","description":"Revenue Graph to evaluate against"},"amountUsd":{"type":"number","description":"Gross event amount in USD"},"source":{"type":"string","description":"Revenue source label, e.g. streaming, sync, api"},"participants":{"type":"array","items":{"type":"object"},"description":"Optional participant overrides"},"txHash":{"type":"string","description":"Base USDC payment tx hash (after 402)"}},"required":["graphId","amountUsd"]}}}},"responses":{"200":{"description":"Event evaluated; entitlements and ledger entry returned","content":{"application/json":{"schema":{"type":"object","properties":{"entitlements":{"type":"array","items":{"type":"object"}},"ledgerEntry":{"type":"object"}}}}}},"402":{"description":"Payment Required: 0.01 USDC on Base via x402"}}}},"/v1/x402/public/evaluate":{"get":{"operationId":"publicX402EvaluateProbe","summary":"Public x402 payment challenge probe (no auth required)","description":"Returns the x402 payment challenge (HTTP 402) for the public evaluation endpoint. Used by x402 discovery services to verify the paywall.","parameters":[{"name":"probe","in":"query","required":false,"description":"Optional probe identifier for discovery services","schema":{"type":"string"}}],"responses":{"402":{"description":"Payment Required: 0.01 USDC on Base via x402"}}},"post":{"operationId":"publicX402Evaluate","summary":"Public x402 machine-commerce evaluation (no auth required)","description":"Public endpoint for machine discovery. Send an economic event without payment to receive a 402 challenge. Pay 0.01 USDC on Base, retry with txHash, and RevRule evaluates your event against the public demo graph, returning computed entitlements. No API key required.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.010000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"object","description":"Economic event to evaluate"},"txHash":{"type":"string","description":"Base USDC payment tx hash (after 402)"}},"required":["event"]}}}},"responses":{"200":{"description":"Payment verified; entitlements returned"},"402":{"description":"Payment Required: 0.01 USDC on Base via x402"}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Bearer API key for authenticated endpoints"}}}}