Every query is metered
· The datahashi team
- governance
- metering
When data access goes through a semantic layer, you get something that’s usually hard: a single, honest record of usage.
The summary endpoint
Every query the engine runs records its bytes scanned and row count against the
principal that asked. GET /v1/tenants/{id}/usage/summary?from=… gives you the
total over any window:
{
"queries": 1284,
"bytes_scanned": 41203847112
}
That’s it. No per-warehouse export, no reconciling three billing consoles.
Why it’s reliable here
The number is trustworthy because there’s no side channel. A member can’t drop to raw SQL to avoid the meter, and an agent on MCP is constrained to the same three tools as everyone else. If a byte was scanned on your warehouse through datahashi, it’s in the summary.
What we do with it
Today: a limiter and a cache in front of the engine, both keyed off the same usage signal. The cache means a repeated question doesn’t re-scan; the limiter means one runaway notebook doesn’t take the warehouse down for the tenant.
Pre-aggregation is the next step, and it’s deliberately not built yet — the
reasoning is in the repo’s known-issues.md.