Skip to content

Bug: Input/Output token counts always show 0 for all requests (recent regression) #74

@Wladefant

Description

@Wladefant

Bug Description

All input and output token counts show as 0 in the Usage & Analytics dashboard and as "-" in the Request Logger. This affects all requests, including successful ones (200 OK) routed through the Antigravity provider. Token tracking appears completely broken.

This is a regression — token counting was working in a version from about 2 weeks ago, and broke after updating to a recent version.

Observed Behavior

Usage Overview:

  • Total Requests: 44
  • Total Input Tokens: 0
  • Total Output Tokens: 0
  • Total Cost: $0.00

Usage by Model table:

  • claude-opus-4-5-thinking via antigravity: 44 requests, Input Tokens: 0, Output Tokens: 0, Total: 0

Request Logger:

  • All requests show "-" in both the In and Out columns, even for successful 200 OK responses

Possible Root Cause

After researching related issues, this is likely a 9Router-side issue (not Claude Code or Antigravity):

  1. The upstream CLIProxyAPI (which 9Router is based on) had the same bug: CLIProxyAPI #747 — streaming message_start SSE events returned input_tokens: 0 and output_tokens: 0 even though the upstream Antigravity response contained valid usageMetadata. This was fixed in CLIProxyAPI.

  2. It is known that Antigravity strips some token data from local API responses (see tokscale investigation), but the proxy layer (CLIProxyAPI) has workarounds to extract promptTokenCount and candidatesTokenCount from the Gemini/Antigravity response format and convert them to Anthropic usage format.

  3. The regression likely started with a recent update that changed "request logging and streaming" or "Usage type safety across all translators". Either of these changes may have broken the token extraction from streaming SSE responses.

Steps to Reproduce

  1. Update to a recent version of 9Router
  2. Configure Antigravity provider
  3. Send requests via Claude Code using claude-opus-4-5-thinking
  4. Check the Usage Overview — all token counts are 0
  5. Check the Logger — all requests show "-" for In/Out columns

Expected Behavior

Token counts should be extracted from the Antigravity/provider responses and displayed correctly in:

  • The Usage Overview dashboard (Total Input/Output Tokens)
  • The Usage by Model table
  • The Request Logger (In/Out columns)

This was working correctly about 2 weeks ago.

Environment

  • Provider: Antigravity
  • Model: claude-opus-4-5-thinking
  • Client: Claude Code
  • Last working: approximately 2 weeks ago, before a recent update

Related Issues

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions