Paying as an agent (x402)
How a paid MCP tool call is quoted, verified and settled over the x402 rail.
An agent with a wallet can pay for a tool call without a human in the loop. Rushie implements the x402 pattern: a priced tool answers an unpaid call with what it costs and how to settle, the caller retries with a signed payment, and the server verifies it before doing the work and settles afterwards.
The exchange
- Call the tool with no payment. If the free daily allowance is spent, the reply is the payment requirements: amount, asset, network and the address to pay.
- Sign a payment for one of the offered requirements.
- Call again with the payment in
_meta. It is verified with the facilitator before the tool runs. - The tool runs, settlement is broadcast, and the receipt comes back in the response
_meta.
Verification happens before the work and settlement after it. A settlement that fails returns an error rather than the result.
Free allowance
Every caller gets a number of free calls a day before payment is required, counted per token or per payer address. It is a setting, not a promise.