Skill 4.2.3

Track and optimize cost metrics, including token consumption and resource usage

Key Concepts

Every model response reports usage: prompt tokens, completion tokens (including reasoning tokens for reasoning models) and cached prompt tokens. Recording these per request, per feature and per user in telemetry shows where tokens go, and Azure Monitor metrics show token totals per deployment. Azure Cost Management shows the billed cost of deployments, provisioned throughput, fine-tuned model hosting and supporting services such as Azure AI Search, with budgets and alerts.

Optimization reduces tokens or their price: shorter system messages, fewer or smaller retrieved chunks, output length limits, prompt caching of repeated prefixes, routing simple requests to smaller models, batch deployments at a lower price for work that can wait, and PTU reservations for steady volume. Unused fine-tuned deployments and idle managed compute should be removed, because they bill by the hour.