X402 payment simulation

Autonomous paid specialist audit

A realistic X402-style flow shows how an agent can discover a paid API, evaluate budget, send payment, and log a receipt.

Paid service

Carbon Intensity API

Replaceable with a real provider later

API price

$4

Returned by HTTP 402 metadata

Agent budget

$12

Autonomous spend policy

Receipt

ackend_042

Logged in repair ledger

Payment flow

01Agentcompleted

Agent requests premium carbon data

The Carbon Accountant Agent asks for regional carbon intensity factors to refine the estimate.

GET /v1/carbon-intensity/premium?audit=bloated-saas-backend

02Paid APIHTTP 402completed

API returns HTTP 402 Payment Required

The API exposes a machine-readable price of $3.50 for a premium audit result.

03Budget policyapproved

Agent checks budget policy

Approved because $3.50 is within the $12.00 autonomous spend limit.

04Agentcompleted

Agent signs mock payment

A replaceable mock signer creates an X402-style payment payload for the paid service.

05Agentcompleted

Agent retries with X-PAYMENT header

The agent retries the same resource request with payment authorization attached.

GET /v1/carbon-intensity/premium

06Paid APIHTTP 200completed

API returns premium audit result

Premium data confirms 92 kgCO2e/month of avoidable waste with regional adjustment factors.

07Ledgerlogged

Receipt logged in repair ledger

Receipt rcpt_x402_bloated_saas_backend_042 is attached to the repair ledger for auditability and finance review.