Skip to content

Quickstarts

Everything here is local, non-production proof-of-concept material. Each quickstart sets up exactly one component of the SubEtha flow; a complete payment needs all three roles running against the same local stack, which the local end-to-end tutorial walks through in order.

  • Payer — TypeScript — pay for HTTP resources from Node.js with the official x402 client (x402Client + wrapFetchWithPayment) and the @subetha/x402-scheme plugin.
  • Payer — Python — pay from Python with the subetha package: SubethaClient, an operator-configured SpendingPolicy, and the quote / pay / report workflow.
  • Provider — charge for an HTTP API behind 402 Payment Required with the official x402 Express middleware and the @subetha/provider scheme plugin, against an external facilitator.
  • Facilitator — build and run the settlement daemon from the product repository source (it has no npm package), validate its config, and start it against the local stack.

Every quickstart assumes the mental model from Start here and the flow vocabulary from x402 v2 on SubEtha: a request is answered with a 402 offer, the payment makes it accepted (the resource is served), and settlement finalizes later, asynchronously — the two states are never the same thing.

Paying end-to-end requires the local zERC20 stack (anvil on chain 31337, the deployed contracts, an indexer, and a prover) from the product repository’s canonical runbook — docs/RUNNING-THE-STACK.md. The tutorial sequences all of it.