The end-to-end flow of a PDF As You Go operation — request, 402 payment challenge, signed payment, settlement, and delivery.
Every operation follows the same shape, whether it arrives as an MCP tool call or an HTTP request: the service quotes a price, your client pays inline over x402, and the result comes back. No step requires an account or an API key.
The flow at a glance
Section titled “The flow at a glance”Agent / MCP client / HTTP client │ 1. call a tool or POST an endpoint (document by URL or upload) ▼┌─────────────────────────────────────────────┐│ PDF As You Go service ││ ││ x402 middleware ── 2. 402 Payment Required ││ │ 4. verify + settle ││ │ (via facilitator → chain)│ ▼ ││ Operation router (12 PDF ops) ││ │ ││ ▼ ││ PDF engine ──► 5. result stored, signed URL │└─────────────────────────────────────────────┘ │ result URL + X-PAYMENT-RESPONSE ▼ 6. Agent downloads the outputStep by step
Section titled “Step by step”-
Request. Your client calls a tool (e.g.
merge_pdfs) or hits an endpoint (e.g.POST /v1/merge) with the document and parameters. Documents are passed by URL or upload — not inline base64. -
402 Payment Required. If the request is unpaid, the server responds with HTTP
402and a body describing exactly how to pay: the price ($0.05 in USDC base units), the network, the token contract, and the receiving address. See The 402 flow for the full body. -
Sign. Your client builds a signed payment payload — a gasless authorization (EIP-3009 for USDC) — and retries the request with an
X-PAYMENTheader carrying the encoded payload. With an x402-aware client this is automatic; you never see it. -
Verify & settle. A facilitator verifies the signature and settles the transfer onchain, so the service itself holds no blockchain infrastructure. Settlement is typically sub-2-second.
-
Run & store. On confirmed payment, the operation runs and the resulting PDF is stored behind a short-lived download URL.
-
Deliver. The server returns the result (a download URL, and optionally streamed bytes) plus an
X-PAYMENT-RESPONSEheader confirming settlement. Your agent downloads the output.
What you don’t have to do
Section titled “What you don’t have to do”- No account. There is nothing to sign up for.
- No API key. There is no credential to issue, store, leak, or rotate — the payment authorization is the auth.
- No blockchain plumbing on your side beyond a funded wallet your client can sign with. The facilitator handles settlement.
- Quickstart: MCP server
- Quickstart: HTTP API
- x402 payments — a deeper look at the payment protocol.