Pay
Primary Spend is POST /spend/pay-url against any payable HTTPS URL. Secondary is POST /pay for Rill resources and handle transfers. Both require a wallet key.
Same flow in MCP: rill_pay
Auth
Send a wallet key on every call. Prefer Authorization: Bearer rill_vw_*. The x-rill-vw-key header is also accepted. Send Idempotency-Key on mutating pays so retries are safe.
Authorization: Bearer rill_vw_*Featured endpoints
Pay any MPP or x402 URL
POST /spend/pay-urlThis is the primary Spend path. Rill probes the URL, completes the open-rail 402 challenge under the VW policy, and debits prepaid balance. The paid platform does not need to know about Rill. Prefer this for external APIs and hosted /r/{id} gates that speak MPP or x402.
Request body
What to save
Open-rail (mpp/x402): save attempt_id, rail, receipt_id (alias of the upstream payment-receipt), tx_hash, and the unlocked body/headers. Ledger Accept gates also return a Rill receipt_id for POST /access/verify. body_truncated is true when the unlock body was cut at 8KB. Errors include request_id. Allowance or max-transaction failures mean mint a higher budget or wait for period reset.
- Send Idempotency-Key on the request headers for safe retries. A replay returns the stored unlock body when we saved it.
- Default method is GET. A POST-only 402 needs method POST and a JSON body. When the directory row has body_hint, copy that shape and substitute your own values.
- List prior open-rail spends with GET /spend/attempts.
Background ledger pay or transfer
POST /payBackground Network rail for in-Rill resource pays and FQDN transfers. Resource pays credit seller ledger balance and return a receipt. Transfers settle on the Rill ledger. For any external HTTPS MPP/x402 endpoint, use pay-url instead.
Transfer body
What to save
Save receipt_id. Unlock gates with X-Rill-Receipt, Payment-Receipt, or PAYMENT-RESPONSE, or call POST /access/verify. Resolve destinations with GET /handles/resolve/:destination before ledger transfers.
- Seed unlock: ledger-pay resource_id SEED23, then GET /demo/echo with X-Rill-Receipt.
- Send Idempotency-Key on every pay.
All endpoints
Usage notes
- Prefer POST /spend/pay-url (or MCP rill_pay_url) for third-party 402s and hosted Accept gates.
- Every response includes request_id in the body and X-Request-Id.
- MCP twins: rill_pay_url and rill_pay.