Track AI costs: reported, estimated and unknown
Identify the amount’s source
A cost may be reported by a provider or estimated from prices and token counts. Missing prices, usage or currency should remain unknown, not become zero. Provider invoices remain the settlement authority.
AntDock’s AI reference supports explicit reportedCost, usage and metadata. Manual recording uses trace(). Obtain the current package and complete example from the AI SDK reference; do not assume a public npm release.
Verify one call first
Record a known call’s model, input and output tokens, and timing. Match it against the provider response or console, checking currency and amount source. Label estimates and do not invent missing usage.
Failed requests can still incur charges. Caching, batches, tools and different billing units require provider-specific checks; one universal token formula is insufficient.
Compare real tasks
Separate test and production, applications and models, then inspect recorded latency, status, tokens and cost. A small sample does not establish which model is cheaper or more reliable. Switching also requires task-quality evaluation.
This article gives no current model quotations or promised savings. Verify official provider pricing when making a decision.
Ready to simplify your stack?
Analytics, monitoring, and server metrics in one platform. Start free, no credit card required.