Skip to main content

x402 Micropayments

The x402 protocol lets AI agents pay for API services in USDC. No credit cards, no subscriptions. Call a 402-gated endpoint, and Aegis handles the payment negotiation.

How x402 Works

Aegis manages payment negotiation and settlement:
1

1. Agent requests a paid service

Call /v1/actions/pay. Provide the target URL, HTTP method, and spending limit.
2

2. Aegis negotiates the payment

Aegis sends an initial request to the target. If it returns 402 Payment Required, Aegis extracts the price and recipient address from the headers.
3

3. Policy check

Aegis checks the price against agent spending policies. If the cost exceeds limits, the payment fails immediately.
4

4. Payment execution

Aegis connects to the agent’s Circle Developer Controlled Wallet. It signs the USDC payment proof, then resubmits the request.
5

5. Data returned

The target verifies the proof and returns the data. Aegis forwards it to the agent.

Usage

Payment Parameters

Service Discovery

Agents discover x402 services through the Marketplace API. Inspect a service to check pricing before paying:

Cost Estimation

Estimate payment costs without executing:
maxAmount is a spending cap. If the price is lower, the agent pays the actual amount. If it exceeds maxAmount, the payment drops.