Skip to main content

x402 Protocol Payments

Conto integrates with the x402 protocol to let AI agents pay for HTTP APIs that return 402 Payment Required. Conto acts as a policy layer between your agent and the x402 facilitator.
x402 endpoints enforce explicit API-key scopes. Pre-authorization requires payments:request, recording execution requires payments:execute, and budget or service analytics require analytics:read.

How It Works

  1. Agent sends a request to an x402-enabled API
  2. API returns HTTP 402 with payment details (amount, recipient, facilitator)
  3. Agent calls Conto to pre-authorize the payment against policies
  4. If approved, agent signs the payment and retries the API call
  5. Agent records the transaction in Conto for tracking

Pre-Authorization

Before making an x402 payment, check it against your policies and budget limits:
Conto derives serviceDomain from resourceUrl, so you do not need to send it separately. Response (Approved):
Response (Denied):

Recording Transactions

After the x402 payment is executed onchain, record it in Conto:

Batch Recording

For high-frequency micropayments, batch multiple records:
Use the flat top-level settlement fields shown above. For multiple micropayments, put the per-call details in 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:
The response contains the authenticated agent’s aggregate daily, weekly, and monthly spend, effective limits, and usage trend. When sessionId is supplied, spend.session also reports the call count and amount recorded with that customer-defined ID.

Unified Machine Spend View

If this agent also uses MPP or multiple paid services, use the shared machine-spend endpoints for a combined view:
See Machine Spend for the combined x402 + MPP analytics 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: Configure alert thresholds in Alerts in the dashboard.

Next Steps

Advanced Policies

Configure x402-specific policy rules

Machine Spend

View unified x402 and MPP service spend

Error Handling

Handle x402 authorization errors