Skip to main content
POST /ask is a paid natural-language query interface over the entire history of x402 settlements on Base. Your agent asks a question — top recipients, daily volume, facilitator share, a specific address’s activity — and gets back a single answer plus the exact SQL that produced it. No subgraph schema to learn, no SQL to write, no hallucination to babysit.

What you get

Per-call payment in USDC on Base via x402.

Why derived over raw

The same dataset is queryable directly via the x402 Base subgraph on The Graph Network, but at row-level only — you’d write GraphQL paginate, aggregate client-side, and reason about the numbers yourself. /ask collapses that loop into a single call: the agent describes the question, Sonnet writes the SQL, DuckDB runs it against the parquet warehouse, and the answer comes back with every SQL step in sql_trace so the caller can audit the data path before trusting the number. For agents that need a single derived signal (“did volume inflect last week?”, “who’s the largest recipient?”) this is the cheapest end-to-end path.

Request body

Response shape

The sql_trace array is the receipt — every query the model ran is recorded, so the agent can verify the answer was derived from a real read (not a hallucination) and which slice of the data was actually inspected.

What the model can query

Two virtual tables are exposed: The model is steered to choose daily_stats for trend questions (cheap) and settlements for row-level or address-specific questions (expensive but precise), and to add a block_number predicate for parquet file pruning when reading raw rows.

Sample: ask in English

Returns a ranked answer plus the SQL that produced it. Use the answer to act; keep sql_trace for your audit log.

Sample: trend question

The model will pick daily_stats, return the inflection point with a date, and show you the single aggregate query in sql_trace.

Errors

Free tier

There is no free tier for /ask. To inspect routing without paying, send the plain-English question to POST / (A2A JSON-RPC) — Graph Advocate will name /ask as the right endpoint and hand back the exact paid curl, without charging.