PulseAugur
EN
LIVE 18:43:57

AI Gateways May Under-Report Token Usage Due to Optional API Fields

A technical article explains how AI gateway providers can silently under-report token usage, leading to discrepancies between usage panels and invoices. The issue stems from the optional 'usage' field in OpenAI-compatible API responses, which is often omitted for streaming requests by default. When streaming is enabled with specific options, a special chunk containing usage data is sent, but gateway proxies may skip this chunk if it contains an empty 'choices' array. The article provides three curl commands to help users diagnose if their gateway is under-reporting token counts, highlighting the potential for reconciliation gaps and difficulties in accurately tracking input versus output token costs. AI

IMPACT Highlights potential discrepancies in AI API billing and provides tools for developers to verify token usage.

RANK_REASON Technical article detailing a specific implementation detail and diagnostic method for AI API usage reporting.

Read on dev.to — LLM tag →

AI-generated summary · Google Gemini · from 1 sources. How we write summaries →

AI Gateways May Under-Report Token Usage Due to Optional API Fields

How we ranked this

Signal score
9 / 100
Composite score across the factors below. Higher = stronger signal that this story matters right now.
Newsworthiness bucket
Tool
Technical article detailing a specific implementation detail and diagnostic method for AI API usage reporting.
Source corroboration
Single-source cluster
Only one publisher covered this so far. Single-source stories can still rank when the publisher is high-authority, but they lack cross-source corroboration.
Topics
infra, product
Editorial topic classification. Feeds into how the story surfaces on /topic/<slug> hub pages and into the per-entity coverage mix.
AI-industry relevance
High
Clearly on-topic for AI-industry coverage.
Story freshness
Breaking (< 6h)
Fresh story with cross-source coverage still developing. Ranking may shift as more sources report.

Full methodology in our editorial standards.

COVERAGE [1]

  1. dev.to — LLM tag TIER_1 English(EN) · batonyzeng-sketch ·

    The usage field is optional: how a gateway silently under-reports your tokens

    <p>A team I worked with spent a week arguing with their AI gateway vendor about a 22% gap between the usage panel and the invoice. Both numbers were computed correctly. The panel was summing a field that the gateway only populated for non-streaming requests. Everything they serve…