{"uid":"cap_uRpq0xioGgsn9o9IY05Y-","slug":"anchor-x402-ledger-summary-ac182a3c","name":"Anchor-x402 Ledger Summary","description":"x402 spend accounting for any Base wallet — totals + per-service breakdown reconstructed from chain data. $0.01 USDC.","url":"https://api.anchor-x402.com/v1/ledger/summary","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"to":{"type":"string","description":"ISO date, end of range. Default: now."},"from":{"type":"string","description":"ISO date, start of range. Default: 30 days before `to`."},"wallet":{"type":"string","description":"EVM address (Base) whose x402 spend to reconstruct."},"group_by":{"enum":["service","recipient","day"],"type":"string"},"direction":{"enum":["outbound","inbound","both"],"type":"string","description":"outbound = spend (default), inbound = revenue."},"min_amount":{"type":"string","description":"Minimum USDC per transfer, e.g. 0.001."}}},"responseSchema":{"type":"json","example":{"chain":"base","daily":[{"date":"2026-06-01","usdc":"0.4110","tx_count":17}],"range":{"to":"2026-07-01T23:59:59Z","from":"2026-06-01T00:00:00Z"},"groups":[{"usdc":"8.8880","label":"anchor-x402","last_tx":"2026-07-01T20:03:14Z","first_tx":"2026-06-01T04:11:22Z","tx_count":231,"recipient":"0x127462e296fac1a7f5cf33ba57bb2f0fff5cd0b6","service_id":"anchor-x402.com","avg_call_price":"0.0384"}],"totals":{"usdc":"12.2910","tx_count":454,"identified_pct":99.9,"unique_recipients":4},"wallet":"0x7818cb9cead1e13e64a259f0867089db75e374c5","direction":"outbound","granularity":"day","spec_version":"1.0","registry_version":"2026-07-15"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_w2ZmILTuxgJ2mVhWlOH2i","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a paginated USDC spend summary for a wallet's x402 pay-per-call transactions, broken down by day and service recipient.","exampleAgentPrompt":"Pull my x402 ledger summary for wallet 0x7818cb9cead1e13e64a259f0867089db75e374c5 on Base for June 2026, broken down by day, and show me which services I spent the most on.","exampleUseCases":[{"title":"Monthly agent wallet cost audit","prompt":"Give me a full breakdown of outbound x402 spending for my agent wallet 0x7818cb9cead1e13e64a259f0867089db75e374c5 on Base for the month of June 2026 — I want daily totals and a list of which services I paid, sorted by total USDC spent."},{"title":"Per-service spend tracking for cost control","prompt":"Which x402 services has my wallet 0xABC123... been paying on Base this quarter? Show me the total USDC and call count per service so I can figure out where to cut costs."},{"title":"Automated weekly spend report for AI agent fleet","prompt":"Every Monday morning, fetch the prior week's x402 ledger summary for wallet 0x7818cb9cead1e13e64a259f0867089db75e374c5 on Base and tell me the total USDC spent, number of calls, and what percentage of payments were identified by service registry."}],"resultDescription":"Returns a JSON object containing: the queried wallet address, chain, direction, and date range; an array of daily USDC spend and tx_count entries; a groups array with per-service breakdown (recipient address, service_id, total USDC, tx_count, avg_call_price, first/last tx timestamps); and totals including overall USDC, tx_count, identified_pct, and unique_recipients. Also includes spec_version and registry_version fields.","failureModes":["Invalid or checksumless wallet address returns 400 with validation error","Unsupported chain value returns 400 with enum error","Date range too wide may return partial results or timeout","Wallet with zero x402 activity returns empty groups array and zero totals","Missing required wallet field returns 422 unprocessable entity","Payment failure (insufficient USDC balance) returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need structured, machine-readable USDC spend accounting for a specific wallet's x402 pay-per-call activity, especially when you want per-service grouping and daily granularity. Prefer it over a full expense report endpoint (which generates markdown/CSV asynchronously at higher cost) when you want lightweight, synchronous JSON data for programmatic analysis or dashboards.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:36:51.307Z","isFirstParty":false}