Skip to content
Centriu
Centriu Gauge

AI Usage-Quota Consumption Timing Integrity Automation: Billed Before It Happened

Centriu Gauge's Income Tax module meters a client organization's plan-based usage — AI questions asked, documents processed — against a limited monthly allotment. A pre-launch certification audit found the meter was running ahead of the actual event in two separate places. Asking the AI chat a question consumed one unit of quota BEFORE the system had decided whether it would call an AI model at all — a question that ended without ever reaching a model (because it was out of scope, needed a human professional, or was a clarifying follow-up) still consumed the same quota as a question that was genuinely answered. Reading a document consumed one unit of quota BEFORE the system confirmed that document actually existed and belonged to the requester under the database's own access rules — a mistyped or someone-else's document identifier burned real quota and returned nothing but a not-found error. A related, compounding defect in the same chat code: the mechanism preventing an accidental duplicate charge (a double-click, a retried network request) built its uniqueness key from the current time measured to the millisecond, so even a genuine, immediate double-click produced two different keys and was billed twice. All three are fixed: quota consumption now happens only after the engine has decided a model will genuinely be called, and only after a document read has been confirmed against real, row-level-security-checked ownership — with the duplicate-charge key now built from a ten-second window instead of a raw timestamp.
Ten-second window, not a millisecond
Billed on outcome, not attempt
Person working on a laptop with notifications on screen
Charged only for what actually happened.

A meter that runs before the metered event happens will always overcharge

Charging for a unit of usage makes sense only once the specific thing being metered has genuinely occurred, or is guaranteed to occur as a direct consequence of the charge. The moment a metering step runs earlier than that — before a decision is made, before an identifier is confirmed valid — it necessarily also counts every case where the underlying work never actually happens: a request that gets rejected, redirected, or fails validation still gets charged, purely because charging happened first and the actual outcome was discovered second.

How the underlying problem shows up before you fix it

A usage-metering or billing step runs before the specific work it's meant to represent has been confirmed to actually happen — meaning a request that gets rejected, redirected, or short-circuited downstream still consumes the same unit as one that completes fully.

A resource-access charge (reading a document, calling an external service) is applied before the system has verified the underlying resource exists and genuinely belongs to the requester — so an invalid or mismatched identifier consumes real usage and returns nothing but an error.

A duplicate-prevention (idempotency) mechanism builds its uniqueness key from a value precise enough that two calls made a fraction of a second apart — an exact double-click, a network retry — are treated as two entirely distinct events rather than the same one.

Nobody notices a metering-timing defect from customer complaints alone, because it manifests as usage running out "faster than expected" rather than as an obvious error — exactly the kind of gap a dedicated, adversarial pre-launch audit is built to surface.

A cost or usage summary aggregates charges without distinguishing which of them correspond to work that was genuinely performed versus work that was charged for and then never actually happened.

Why "charge first, then find out" is an easy default to write

Writing the usage-consumption call at the very start of a request handler is often the simplest possible structure — it reads as "make sure they haven't hit their limit, then do the work," which sounds like the correct order at a glance. The problem only becomes visible once you separately ask a second question: does every code path that reaches this point definitely result in the metered work happening? When the honest answer is no — some paths reject the request, redirect it elsewhere, or fail a downstream check — the charge has already been applied to all of them regardless, and that gap tends to stay invisible because the charge itself never produces an error; it simply produces a slightly smaller remaining quota than the customer's real usage would justify.

How Centriu Gauge moved the meter to after the fact, twice, and fixed a related double-charge

This was found during the same pre-launch certification audit that identified the CRITICAL conversation-ownership gap and the HIGH-severity dual-approval defect covered on this pillar's companion pages — the review specifically traced not just whether a feature worked, but exactly when each metering call fired relative to the work it represented.

In the AI chat function, usage was being consumed as an early step, before the system had done any of the work of deciding how to handle the question — including the genuine possibility that no AI model would be called at all, because the question was outside the module's scope, needed to be routed to a human tax professional, or was answered with a clarifying follow-up question instead of a model call. Every one of those non-model outcomes had still been charged the same as a fully-answered question. The fix moves the quota-consumption call to after that determination is made, so quota is only spent on a question that genuinely reaches a model.

In the document-reading function, usage was being consumed before the system confirmed the requested document actually existed and belonged to the requester — a check enforced by the database's own row-level security when the read happens under the requesting user's own access, not the backend's elevated one. A wrong or someone else's document identifier would consume a unit of quota and return only a not-found response — charging for a document that was never actually read. The fix moves quota consumption to after that existence-and-ownership confirmation succeeds, and separately makes the charge idempotent by the document's own identifier, so deliberately re-reading the same already-processed document — a legitimate part of reprocessing a failed extraction — doesn't consume quota a second time.

A third, related defect lived in the same chat function's own duplicate-charge protection. The mechanism meant to stop an accidental double-charge — a double-click, a retried network request — built its uniqueness key using the exact current time, precise to well under a second. Two calls arriving a few milliseconds apart, which is exactly what an accidental double-click produces, generated two different keys and were treated, and billed, as two entirely separate questions. The fix rebuilds that key around a ten-second time window instead of an exact instant: two calls landing inside the same ten-second window are recognized as the same attempt and charged once, while a genuinely new question asked more than ten seconds later — even about the same topic — is correctly treated and charged as new.

What is actually built today

AI chat usage quota consumed only after the engine has determined a model will genuinely be called — a question that ends as out-of-scope, forwarded, or a clarifying follow-up no longer consumes the same quota as an answered one.

Document-read usage quota consumed only after the specific document has been confirmed to exist and to belong to the requester under row-level security — an invalid or foreign document identifier no longer consumes quota before failing.

Idempotent document-read charging keyed to the document's own identifier, so a deliberate re-read of an already-processed document (part of legitimate reprocessing) does not consume quota again.

A duplicate-charge protection key rebuilt around a ten-second time window rather than a millisecond-precision timestamp — an accidental double-click or network retry within that window is recognized and charged once.

A genuinely new question, even on the same topic, asked outside that ten-second window is still correctly treated and charged as a new, distinct request.

Confirmed today via direct inspection of both edge functions: the quota-consumption call in each sits after, not before, the relevant validation step.

A question that costs nothing when it goes nowhere (illustrative scenario, not a real client)

Someone asks the Income Tax AI chat a question that turns out to be outside the module's scope and gets routed to a human tax professional instead of an AI-generated answer. Before the fix, that question would still have consumed a unit of the organization's monthly quota, identical to a question the AI genuinely answered. After the fix, quota is only consumed once the system has determined a model will actually be called — a question redirected before that point costs nothing.

What changes operationally

An organization's AI usage quota for the Income Tax module now reflects genuine, completed work — questions actually answered by a model, documents actually read and processed — rather than every attempt regardless of outcome. A rejected request, an invalid document reference, or an accidental double-click no longer erodes a limited monthly allotment for work that never happened.

When this is not the right fit

This fix corrects WHEN usage is charged relative to the work it represents — it does not change the underlying plan limits or pricing themselves, which remain a separate, published commercial decision. It also covers the specific AI chat and document-reading paths of the Income Tax module; usage metering in other Centriu Gauge features or other modules is governed by its own, independently verified logic.

Charging on attempt vs. charging on genuine outcome

Metering usage at the earliest possible point in a request is simple to write and looks correct at a glance, but it silently bills every downstream rejection, redirection, or invalid reference the same as a fully completed unit of work. Centriu Gauge's fix moves each charge to the specific point where the metered work is confirmed to be genuinely happening — after the engine's own routing decision, after ownership is confirmed under row-level security — so the meter reflects outcomes, not attempts.

Related systems

Main system: Centriu Gauge.

What it does NOT do

  • Does not consume AI chat usage quota before the system has determined whether a model will actually be called — a question redirected, out-of-scope, or answered as a follow-up no longer costs the same as a genuinely answered one.
  • Does not consume document-read usage quota before confirming, under row-level security, that the specific document exists and belongs to the requester.
  • Does not charge quota a second time for a deliberate re-read of an already-processed document — the charge is idempotent by the document's own identifier.
  • Does not build its duplicate-charge protection key from a millisecond-precision timestamp — the key is built from a ten-second window, so an accidental double-click or retry within that window is charged only once.
  • Does not treat a genuinely new question asked outside that ten-second window as a duplicate, even if it covers a similar topic — it is correctly charged as new.
  • Does not change the module's published plan limits or pricing — this fix corrects the timing of when a charge is applied, not how much is charged or what the limits are.

Security and governance

Usage-quota consumption for both AI chat and document reading now occurs only after the corresponding access or routing decision has been confirmed, including row-level-security ownership checks for documents. Any personal or business data referenced in a metered request remains subject to Brazil's LGPD (Law No. 13,709/2018). Full detail on access control lives at /governanca and /iso.

Pricing and contracting

Available by custom proposal, arranged directly with the team. Values and terms come from the official pricing table at /precos (Centriu's central source — never restated here).

Frequently asked questions

Did asking a question that the AI never actually answered still cost quota before this fix?

Yes — quota was consumed before the system decided whether a model would be called at all, so an out-of-scope, forwarded, or follow-up question was charged the same as a genuinely answered one.

What happened if someone requested a document that didn't exist or belonged to someone else?

The read consumed a unit of quota before that was checked, so an invalid or foreign document identifier burned real quota and returned only a not-found error.

Why did an exact double-click get charged twice before this fix?

The duplicate-charge protection key was built from the current time measured to well under a second, so two calls made milliseconds apart generated two different keys and were billed as two separate questions.

Does re-reading the same document for reprocessing purposes cost quota again now?

No — the document-read charge is idempotent by the document's own identifier, so a deliberate re-read of an already-processed document doesn't consume quota a second time.

Does this fix change the plan's usage limits or pricing?

No — it corrects when a charge is applied relative to the actual work, not the limits or pricing themselves, which remain a separate commercial decision.

What does Centriu Gauge cost?

It is sold by subscription with a published starting price — exact current values are on the central pricing page.

See how Centriu Gauge only charges AI usage quota for work that actually happened

Reach our commercial team directly, or leave your details below — we'll follow up with guidance for your case.

Sources

  1. Centriu Gauge — public product page — Centriu, 2026-07-20 · link(primária)
  2. Centriu Gauge — public factsheet (API, JSON) — Centriu, 2026-07-21 · link
  3. Law No. 13,709/2018 — Brazil’s General Data Protection Law (LGPD) — Presidência da República (Brazil), 2018-08-14 · link

Last material update on .

By · AI-assisted production, with human review