THESIS

Working premise

Token totals are an input, not an outcome. Engineering teams need to understand which context is useful, which work is repeated, and how cache behavior affects cost and latency.

CONTEXT

Operational context

Token cost is shaped by context assembly, repeated instructions, conversation history, retrieved evidence, tool results, provider cache rules, and output length. A task may use the same model but have very different economics depending on how much context is reused or repeatedly transmitted.

Cache reporting needs a clear denominator. A high hit rate can be meaningless if only a small portion of expensive input is eligible, while a modest hit rate on large stable prefixes may create substantial savings. Provider-reported cached tokens should be reconciled with trace-level context structure.

Optimization should preserve evidence and behavior. Removing context may reduce input cost while increasing unsupported answers, tool retries, or human escalation. The accepted unit is therefore quality-adjusted cost per successful task, with token and cache metrics explaining the drivers.

INQUIRY

Questions to resolve first

Q1

Which context components are stable, reusable, or repeated across tasks?

Q2

How does each provider define cache eligibility, retention, and billing?

Q3

Which context growth is required evidence and which is accidental duplication?

Q4

How will a context or cache change be evaluated for quality and privacy impact?

PROTOCOL

Recommended method

  1. P1

    Attribute input, output, cached, and reasoning tokens to individual spans and complete tasks.

  2. P2

    Measure context growth across conversation turns and agent steps.

  3. P3

    Identify stable prefixes and repeated retrieval that may benefit from caching.

  4. P4

    Compare quality before and after context reduction or routing changes.

FAILURE

Common failure modes

Hit-rate vanity metric

The reported rate rises while the expensive, non-cacheable portion of the request continues growing.

Provider abstraction leak

One provider's cache semantics are treated as a universal application behavior.

Context diet regression

Cost falls because necessary instructions or evidence are removed, increasing failure or escalation.

CONTROL

Control points

  • Version provider pricing and caching rules.
  • Do not count theoretical cache savings as realized savings.
  • Monitor cache invalidation when prompts, tools, policies, or source content change.
  • Protect required evidence from aggressive context trimming.
DEPLOY

Implementation sequence

  1. S1

    Decompose input tokens into stable instructions, examples, history, retrieval, tools, and user content.

  2. S2

    Record eligible, written, read, and billed cache usage with provider and rate version.

  3. S3

    Compare context and cache candidates against task success, latency, and failure segments.

  4. S4

    Alert on repeated-context growth, falling effective savings, and routes with missing cache attribution.

MEASURE

Measures worth reviewing

Track tokens and cost per successful task, eligible-cache share, effective cache savings, repeated-context share, and context growth. Provider cache-hit rate should remain a diagnostic input rather than the business outcome.

Tokens per successful taskCache hit rateRepeated-context shareContext growthQuality-adjusted savings
SOURCES

Primary references

This note is an editorial synthesis of public standards, primary institutional guidance, and common engineering control patterns. It is intended to support engineering design and review. It is not a substitute for legal, security, safety, audit, or other professional advice for a specific system.