USAGE / PRICE VERSION / RECONCILIATION
Token-cost ledger: inspect input and output charges
Split cached input and thinking output, then keep incomplete costs visibly unresolved.
Run reconciliation
Inspected event history
Current snapshot
Offline response accounting fixture. No model execution, invoice or real prices. Primary usage metadata reference.
Trace reported tokens into an estimated cost
This offline experiment follows two synthetic final response reports through validation, pricing and reconciliation. It uses the names promptTokenCount, cachedContentTokenCount, candidatesTokenCount and thoughtsTokenCount to make token categories explicit. Cached input belongs inside the prompt count: subtract it before applying the uncached input rate. Candidate and thinking counts are separate in this fixture and both use its output rate. The experiment does not tokenize text, execute ADK, call Gemini or measure actual usage. All quantities are deliberately small enough to audit by hand.
Choose the cached input and thinking workload
Cached input for r1 selects zero, 600 or all 1000 prompt tokens. This changes the split between uncached and cached charges without changing the prompt total. Thinking tokens for r1 selects zero, 200 or 800; visible candidate output stays at 300 tokens. Response r2 normally contains 500 prompt tokens, no cached tokens, 100 candidate tokens and 50 thinking tokens. Its usage is independent of the first two controls. A long answer is therefore not the only way this fixture can incur output cost.
Select an explicit fictional price version
Price version v1 charges 2 micro-CU per uncached token, 1 per cached token and 6 per output or thinking token. Version v2 charges 3, 1 and 9 respectively. One CU equals one million micro-CU. These integer rates are invented teaching values, not Gemini prices or currency quotations. Unknown version leaves both valid usage records unpriced. Version selection applies to the entire fixture; it does not infer the correct price from a provider model name or date. Actual metering needs the model, service tier, modality, effective price version and any applicable context-length rule.
Reconcile exact baseline and boundary experiments
With 600 cached tokens, 200 thinking tokens and v1, r1 costs 400 times 2 plus 600 times 1 plus 500 times 6: 4400 micro-CU. Response r2 adds 500 times 2 plus 150 times 6: 1900. The complete total is 6300 micro-CU, or 0.006300 CU. Change only cached input to zero: the total becomes 6900. Set it to 1000: the total becomes 5900. Restore the defaults and select v2: r1 becomes 6300, r2 becomes 2850, and the total is 9150. No intermediate cents rounding hides these small costs.
Expose unknown usage and repeated delivery
Second response metadata selects complete, missing or invalid. Missing keeps the r2 amount unknown. Invalid supplies cached 600 against prompt 500 and must fail validation rather than silently producing a negative input charge. In either case the default known subtotal remains 4400, one response is unresolved, and complete run cost stays unknown. Report delivery selects one report or an exact duplicate of r1. The duplicate is ignored using response identity within this run, so the total cannot increase. This simplified identity policy assumes trusted stable identifiers and identical repeats; conflicting updates, partial streaming reports and distinct retry responses require separate production handling. A new model call is not a duplicate simply because its text matches.
Inspect the sequence and preserve comparisons
Play reveals eight decisions over sixty inspection seconds; Pause freezes them. Next event advances to the next seven-and-a-half-second boundary. Restart rewinds while retaining parameters and speed. Time seeks and pauses. Speed changes the teaching pace to quarter, half, normal or double speed, with elapsed time settled before the change. Changing any scenario input resets and pauses; hiding the tab also pauses. Later totals remain unavailable until their decision is inspected. Export events JSON saves both the full precomputed fixture and the inspected prefix. Capture baseline stores the view and choices; Replace baseline updates it and Clear baseline removes it. Notebook observations persist locally, and Export notes saves them. Expand experiment and Exit full screen adjust the view. Event history supports keyboard scrolling and every cost is visible as text.
Understand the accounting boundary
This is a response-level estimate, not an invoice, billing integration or price calculator for a real provider. It omits cache storage, tool fees, grounding, taxes, quotas, credits, multimodal pricing, multiple candidates and provider-specific rounding. Missing metadata cannot establish that a failed request was free. Production reconciliation must retain unknowns, record price provenance and compare estimates with actual billing records. The related readings discuss cost plugins and run attribution; the primary API reference defines the usage categories used here.