Codex Usage Tracker
Use the tracker as a factual local data plane. The tools return exact or
explicitly graded facts; the model owns inference, explanation, and
recommendations.
Use the three-step loop scope → batch → evidence:
- Scope. Start with the needed
usage_query whenever the question maps
to a curated template or a known typed request. The result carries its
generation, grade, history coverage, and cache state. Call usage_status
only when the query reports an absent or insufficiently fresh index, or
when the user explicitly asks about operational state. A committed
generation remains queryable while refresh is active or recommended. When
the needed fields are unfamiliar, set include_guidance=true on the same
usage_query call that carries the first batch; use an empty batch only for
standalone capability discovery.
- Batch. Prefer one batched
usage_query call. Its arguments always wrap
one or more query requests in the requests array. Execute a curated
server-side template with
{"requests":[{"template":"<name>"}]}; for the common thread leaderboard
use {"requests":[{"template":"top_threads"}]}. Templates query the
hydrated snapshot and report its coverage; refresh complete history only
when the user asks. For same five ranked threads, use result 1 for
labels, selectors, totals, shares, and token classes; use result 2 only for
cost/credits. Do not query again unless user asks for evidence. Use
{"requests":[{"template":"weekly_drivers"}]} for the latest indexed
seven-day thread leaderboard,
{"requests":[{"template":"week_over_week"}]} for that window versus the
immediately preceding seven days, and
{"requests":[{"template":"latest_incremental_change"}]} for the active
generation's inserted calls and leading affected thread. These templates
derive their anchors from the committed snapshot; do not discover dates or
generation numbers first. Use
{"requests":[{"template":"model_effort"}]} for model/effort mix and
{"requests":[{"template":"tools"}]} for structural tool facts. Do not repeat a
successful curated template or request guidance after it returns rows.
Supply parameters only when the selected template requires them.
Otherwise send only the typed dataset, operation, dimensions, measures,
filters, and limits needed for the question. Do not copy or reconstruct a
returned template body.
Preserve the returned generation, grade, coverage, counts, and explicit
row/byte limits. Compose filters as
{field, operator, value} using only the dataset fields and operators in
filter_grammar; in takes an array of 1–25 values. Phase queries require
one returned scope-filter template for a thread, turn, or time window.
- Evidence. Rank candidates from the facts first. Call
usage_evidence
only after ranking, and only with an exact returned logical selector. Use
live=true for the same timeline in live mode.
Label every claim:
- fact — returned exact/deterministic data; for
partial, state the
hydration preset/cutoff and never generalize to all history;
- estimate — returned estimated data with coverage and provenance;
- hypothesis — model inference that still needs evidence;
- unsupported — unavailable from the returned scope and not asserted.
The optional context dataset is aggregate-only private local evidence. Its
observed_bytes and events measures are exact for the structurally observed
payload strings that were indexed. estimated_tokens is available only when
an explicit tokenizer populated it; always preserve its estimator identity and
coverage. Never describe category bytes or estimates as exact billed input
tokens, and keep unattributed_input_tokens unsupported when the response
reports it as null. If context composition is disabled, continue with the
base accounting datasets instead of starting hidden work.
Call usage_refresh only when freshness matters. Reuse the returned job; never
start a duplicate. Use usage_job_status with a bounded wait_seconds value
so the host waits; do not short-interval poll from the model. Use
usage_allowance for observed allowance facts and preserve its provenance and
limitations. Do not infer waste or productivity from token totals alone.
Never inspect raw logs as a fallback, invent missing selectors, claim narrative
findings the tools did not return, or expose prompts, reasoning, tool
arguments/output, secrets, or local paths.
1---2name: usage-kernel3description: Use the six Codex Usage Tracker tools for exact local usage facts, bounded exploration, allowance observations, and evidence timelines.4---56# Codex Usage Tracker78Use the tracker as a factual local data plane. The tools return exact or9explicitly graded facts; the model owns inference, explanation, and10recommendations.1112Use the three-step loop **scope → batch → evidence**:13141. **Scope.** Start with the needed `usage_query` whenever the question maps15 to a curated template or a known typed request. The result carries its16 generation, grade, history coverage, and cache state. Call `usage_status`17 only when the query reports an absent or insufficiently fresh index, or18 when the user explicitly asks about operational state. A committed19 generation remains queryable while refresh is active or recommended. When20 the needed fields are unfamiliar, set `include_guidance=true` on the same21 `usage_query` call that carries the first batch; use an empty batch only for22 standalone capability discovery.232. **Batch.** Prefer one batched `usage_query` call. Its arguments always wrap24 one or more query requests in the `requests` array. Execute a curated25 server-side template with26 `{"requests":[{"template":"<name>"}]}`; for the common thread leaderboard27 use `{"requests":[{"template":"top_threads"}]}`. Templates query the28 hydrated snapshot and report its coverage; refresh complete history only29 when the user asks. For same five ranked threads, use result 1 for30 labels, selectors, totals, shares, and token classes; use result 2 only for31 cost/credits. Do not query again unless user asks for evidence. Use32 `{"requests":[{"template":"weekly_drivers"}]}` for the latest indexed33 seven-day thread leaderboard,34 `{"requests":[{"template":"week_over_week"}]}` for that window versus the35 immediately preceding seven days, and36 `{"requests":[{"template":"latest_incremental_change"}]}` for the active37 generation's inserted calls and leading affected thread. These templates38 derive their anchors from the committed snapshot; do not discover dates or39 generation numbers first. Use40 `{"requests":[{"template":"model_effort"}]}` for model/effort mix and41 `{"requests":[{"template":"tools"}]}` for structural tool facts. Do not repeat a42 successful curated template or request guidance after it returns rows.43 Supply `parameters` only when the selected template requires them.44 Otherwise send only the typed dataset, operation, dimensions, measures,45 filters, and limits needed for the question. Do not copy or reconstruct a46 returned template body.47 Preserve the returned generation, grade, coverage, counts, and explicit48 row/byte limits. Compose filters as49 `{field, operator, value}` using only the dataset fields and operators in50 `filter_grammar`; `in` takes an array of 1–25 values. Phase queries require51 one returned scope-filter template for a thread, turn, or time window.523. **Evidence.** Rank candidates from the facts first. Call `usage_evidence`53 only after ranking, and only with an exact returned logical selector. Use54 `live=true` for the same timeline in live mode.5556Label every claim:5758- **fact** — returned exact/deterministic data; for `partial`, state the59 hydration preset/cutoff and never generalize to all history;60- **estimate** — returned estimated data with coverage and provenance;61- **hypothesis** — model inference that still needs evidence;62- **unsupported** — unavailable from the returned scope and not asserted.6364The optional `context` dataset is aggregate-only private local evidence. Its65`observed_bytes` and `events` measures are exact for the structurally observed66payload strings that were indexed. `estimated_tokens` is available only when67an explicit tokenizer populated it; always preserve its estimator identity and68coverage. Never describe category bytes or estimates as exact billed input69tokens, and keep `unattributed_input_tokens` unsupported when the response70reports it as `null`. If context composition is disabled, continue with the71base accounting datasets instead of starting hidden work.7273Call `usage_refresh` only when freshness matters. Reuse the returned job; never74start a duplicate. Use `usage_job_status` with a bounded `wait_seconds` value75so the host waits; do not short-interval poll from the model. Use76`usage_allowance` for observed allowance facts and preserve its provenance and77limitations. Do not infer waste or productivity from token totals alone.7879Never inspect raw logs as a fallback, invent missing selectors, claim narrative80findings the tools did not return, or expose prompts, reasoning, tool81arguments/output, secrets, or local paths.