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.
Pick your role
Section titled “Pick your role”- Payer — TypeScript — pay for HTTP
resources from Node.js with the official x402 client (
x402Client+wrapFetchWithPayment) and the@subetha/x402-schemeplugin. - Payer — Python — pay from Python with the
subethapackage:SubethaClient, an operator-configuredSpendingPolicy, and thequote/pay/reportworkflow. - Provider — charge for an HTTP API behind
402 Payment Requiredwith the official x402 Express middleware and the@subetha/providerscheme 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.
Before you start
Section titled “Before you start”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.