x402 protocol (an extension of the HTTP 402 Payment Required status) allows APIs to monetize individual endpoints by demanding a microtransaction before returning a resource.
While x402 is powerful for agent-to-agent (A2A) commerce, existing implementations suffer from a critical UX flaw: the wallet popup. Every time an agent hits a paywall, the human user must manually confirm a transaction in their browser wallet.
Delegare solves this by combining the x402 protocol with Intent Mandates, creating the first truly “set-and-forget” x402 client.
How It Works
With Delegare, the human user authorizes a spending budget once (e.g., “$50 per month”). When the AI agent encounters anx402 challenge, Delegare automatically signs an EIP-3009 TransferWithAuthorization using the mandate’s secure session key and resubmits the request.
- Agent requests
GET /api/premium-data. - Merchant returns
402 Payment RequiredwithX-PAYMENTrequirements (price, asset, network). - Delegare SDK intercepts the 402, verifies it’s within the agent’s monthly budget, and automatically signs the payment.
- Agent automatically retries the request with the
X-PAYMENTheader. - Merchant verifies the signature, settles the payment on-chain, and returns the data.
For Merchants: Monetizing APIs
If you are building an API and want to charge agents per request, you can use Vault’sx402 middleware to instantly monetize any Express route.
For Agents: Seamlessly Paying Paywalls
If you are building an AI agent, you can use the@delegare/sdk to seamlessly navigate x402 paywalls without interrupting the user.
Simply replace your standard fetch calls with delegare.fetch. Pass the user’s intentMandate as the third argument.
Model Context Protocol (MCP)
If your agent is powered by MCP (like Claude Desktop or OpenClaw), thedelegare_fetch tool handles this automatically. The LLM simply calls the tool with a URL, and Delegare handles the underlying economic negotiation.