x402 Protocol Payments
Conto integrates with the x402 protocol to let AI agents pay for HTTP APIs that return402 Payment Required. Conto acts as a policy layer between your agent and the x402 facilitator.
How It Works
- Agent sends a request to an x402-enabled API
- API returns HTTP 402 with payment details (amount, recipient, facilitator)
- Agent calls Conto to pre-authorize the payment against policies
- If approved, agent signs the payment and retries the API call
- Agent records the transaction in Conto for tracking
Pre-Authorization
Before making an x402 payment, check it against your policies and budget limits:serviceDomain from resourceUrl, so you do not need to send it separately.
Response (Approved):
Recording Transactions
After the x402 payment is executed onchain, record it in Conto:Batch Recording
For high-frequency micropayments, batch multiple records:batchItems; the record endpoint does not accept a top-level payments array.
Querying Services
View which x402 services your agent has used:Budget Tracking
Check remaining budget and burn rate:?sessionId=... when you want the burn-rate and remaining-budget view scoped to a specific
x402 session. Session spend is counted from recorded x402 transactions with the same sessionId,
so generic payments do not reduce the protocol session budget.
If an agent has an active approved budget request, /pre-authorize returns a budgetRequest
snapshot and /record decrements the remaining budget automatically.
Unified Machine Spend View
If this agent also uses MPP or multiple paid services, use the shared machine-spend endpoints for a combined view:x402 Policy Rules
Configure x402-specific policies to control micropayment behavior. The complete list of x402 rule types, value formats, and operators lives in Advanced Policies > x402 Protocol Rules.Anomaly Detection
Conto automatically monitors x402 spending patterns and creates alerts for:| Alert | Trigger |
|---|---|
| Price Spike | API suddenly charging more than usual |
| High Frequency | Unusual burst of API calls |
| New Service | Agent paying an API for the first time |
| Budget Burn | Approaching per-service budget limit |
| Duplicate Payment | Same amount + endpoint in quick succession |
| Failed Streak | Repeated authorization failures |
Next Steps
Advanced Policies
Configure x402-specific policy rules
Machine Spend
View unified x402 and MPP service spend
Error Handling
Handle x402 authorization errors