S
Study LibraryPractice Lab

Cost and Token Accounting

atomic-noteD5 · 16.8%Section: D5 Model Selection & OptimizationUpdated 2026-11-15

End-to-end costs include input, cache writes/reads, generated output, reasoning tokens, tool processing and retried or parallel agent calls.

Blueprint area: D5 - Model Selection and Optimization MOC (official domain weight 16.8%).

Engineering principles

  • Measure cost per successful business operation and track failure/retry multipliers.
  • Add request-budget policy: allowed model, maximum turns, max generated tokens, parallel fan-out, wall-time and quota.
  • Use batching for non-urgent bulk jobs and caching for repeated prefixes when current economics justify them.
  • Cap output length appropriately but do not truncate structured data needed by consumers.

Failure modes

  • Token count alone is not a performance KPI.
  • A cheaper model can be more expensive overall if it causes more failed runs or escalations.

Check your understanding

  • ☐ Run sensitivity analyses over cache hit rate, retry rate and model mix.
  • ☐ Page alerts on spend-per-success and cap overruns.

Model Routing and Thinking Effort · Agent Loop and Termination · Exam Blueprint and Coverage

Evidence and verification

  • Provenance: author-written engineering synthesis aligned to exam guide objectives; this is not a transcript or hidden Skilljar lesson.
  • Primary references:
  • Check currency: model options, pricing, API flags, release-specific behavior and runtime permissions can change after the source was read. See Source Register.