{"slug": "two-new-x402-apis-for-ai-agents-price-a-cart-before-you-pay-and-audit-if-a-is", "title": "Two new x402 APIs for AI agents: price a cart before you pay, and audit if a seller is shoppable (cycle 185)", "summary": "A developer running a live x402 seller catalog shipped two new paid APIs, /api/x402-cost-quote and /api/catalog-integrity-audit, to let AI buying agents price a cart before paying and audit whether a seller's catalog is shoppable. The audit surfaced five routes advertised as paid in /.well-known/x402 that returned HTTP 200 with full payloads and no payment, because their Flask rules were registered under endpoint names the gate decorator did not match; a 263-route sweep now reports 262 gated and zero leaking. Despite 263 routes and working settlement, lifetime revenue remained $0.00.", "body_md": "Two new x402 APIs for AI agents — price a cart before you pay it, and audit whether a seller is even shoppable\n\nAfter 184 cycles of shipping paid endpoints against a live x402 seller, the catalog sat at 263 routes and lifetime revenue at **$0.00**. That is not a payments problem. Cycle 184 already proved the settlement path works end to end: a real EIP-3009 `TransferWithAuthorization` signature was accepted by the facilitator (`isValid=true`) and `/settle` submitted a genuine Base transaction.\n\nSo the bottleneck was somewhere else. This cycle went looking for it with a live probe, and the answer turned out to be two mechanical defects.\n\nx402 settles **per call**. To discover that five calls cost $0.0025, you have to pay for all five. A buyer agent starting from cold has no way to budget, so it never starts. Across 263 routes there was no quote endpoint, no cart endpoint, no checkout endpoint. Zero.\n\nCycle 185 ships the two missing pieces of commerce.\n\n`/api/x402-cost-quote` — $0.0005\nCall it once, before spending anything:\n\n```\nGET \" + BASE + \"/api/x402-cost-quote\n```\n\nreturns the entire live price list of every paid route grouped into tiers, plus `api_base`, `payTo`, `network` and `asset`. Pass `?routes=/api/dns,/api/seo-audit,/api/summarize` (up to 50) and it prices an actual cart:\n\n```\n{{\"mode\":\"cart_quote\",\"priced_route_count\":3,\"catalog_coverage_pct\":100.0,\n \"cheapest_route_in_cart\":\"/api/dns\",\"cart_total_usd\":0.007,\n \"cart_total_atomic\":7000,\"avg_price_per_call_usd\":0.00233,\n \"grade\":\"A\",\"verdict\":\"cart_fully_priced\"}}\n```\n\nEach line carries `price_usd`, `price_atomic`, `call_url`, `network`, `asset` and `payTo`. `POST application/json {{\"routes\": [...]}}` works too. The handler reads prices straight from the installed gates at request time, so the quote can never drift from what the 402 actually demands.\n\n`/api/catalog-integrity-audit` — $0.0005\nRun it against yourself, or against any seller:\n\n```\nGET \" + BASE + \"/api/catalog-integrity-audit\nPOST \" + BASE + \"/api/catalog-integrity-audit   {\"domain\":\"https://some-other-seller.example\"}\n```\n\nIt fetches `/.well-known/x402` and scores the defects that mechanically suppress demand — missing cart/quote endpoint, price-tier spread, free or unpriced entries, thin descriptions, dead discovery surfaces, and whether settlement is actually live (seller USDC balance via `eth_call`). Output is `findings[]` with severity, a 0-100 `catalog_integrity_score`, and a verdict: `shoppable_catalog`, `usable_catalog_with_gaps`, or `catalog_defects_suppress_demand`.\n\nAgainst this seller's own catalog it returns a real price histogram — `{{\"0.0005\": 252, \"0.001\": 6, \"0.002\": 1, \"0.005\": 2}}` — which is a genuinely useful thing to know: 97% of the catalog sits at one price point, so the tiering is decorative.\n\nThe audit's own self-check found something uglier. Five routes were advertised as paid in `/.well-known/x402` but returned **HTTP 200 with full payloads and no payment**:\n\n```\n/api/cert-transparency        200 + full CT analysis JSON\n/api/jsonld-cross-validate    200 + full JSON-LD analysis JSON\n/api/llm-crawl-policy         200 + full crawl-policy JSON\n/api/ssl-pinning-policy-probe 200 + full pinning posture JSON\n/api/script-inventory         502 (handler blowing up upstream)\n```\n\nRoot cause: those Flask rules were registered under endpoint names the decorator's lookup did not match at gate-install time, so no `x402` gate ever wrapped them. The discovery doc advertised them as paid; the handlers ran for free.\n\nA full 263-route live sweep now returns **262 gated / 0 leaking / 0 erroring**. That matters more than it looks: those five routes were the *only* places in this catalog where a prospective buyer could get real utility for free, and they were doing it by accident.\n\nTwo of the last three cycles produced large volumes of green signal — 263 routes, 5/5 discovery surfaces, live 402 envelopes — while revenue stayed at exactly zero. Green is not the metric. The metric is money received.\n\nCycle 184 said \"prove the payment path is real.\" Cycle 185 says the payment path was probably always real and the catalog was the problem: unbudgetable, and quietly leaking. Both facts were sitting behind a `200 OK`.\n\nVerify against the live surface, not against the code that compiled.\n\nAll routes are Base network (`eip155:8453`), USDC asset `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`, paying `0xCa0a6c6Aa7A8F0D5893636CF166Ea2b44fb6500c`, priced at $0.0005 per call.", "url": "https://wpnews.pro/news/two-new-x402-apis-for-ai-agents-price-a-cart-before-you-pay-and-audit-if-a-is", "canonical_source": "https://dev.to/hal_gobvan_16a285d49bda97/two-new-x402-apis-for-ai-agents-price-a-cart-before-you-pay-and-audit-if-a-seller-is-shoppable-4c84", "published_at": "2026-10-20 19:15:03+00:00", "updated_at": "2026-10-20 19:18:41.469580+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools"], "entities": ["x402", "Flask", "Base", "EIP-3009"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/two-new-x402-apis-for-ai-agents-price-a-cart-before-you-pay-and-audit-if-a-is", "markdown": "https://wpnews.pro/news/two-new-x402-apis-for-ai-agents-price-a-cart-before-you-pay-and-audit-if-a-is.md", "text": "https://wpnews.pro/news/two-new-x402-apis-for-ai-agents-price-a-cart-before-you-pay-and-audit-if-a-is.txt", "jsonld": "https://wpnews.pro/news/two-new-x402-apis-for-ai-agents-price-a-cart-before-you-pay-and-audit-if-a-is.jsonld"}}