Skip to content

How it works

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.

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 output
  1. 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.

  2. 402 Payment Required. If the request is unpaid, the server responds with HTTP 402 and 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.

  3. Sign. Your client builds a signed payment payload — a gasless authorization (EIP-3009 for USDC) — and retries the request with an X-PAYMENT header carrying the encoded payload. With an x402-aware client this is automatic; you never see it.

  4. 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.

  5. Run & store. On confirmed payment, the operation runs and the resulting PDF is stored behind a short-lived download URL.

  6. Deliver. The server returns the result (a download URL, and optionally streamed bytes) plus an X-PAYMENT-RESPONSE header confirming settlement. Your agent downloads the output.

  • 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.