Skip to content

feat: add detailed token usage and model usage over time dashboard charts#5596

Open
ink-the-squid wants to merge 2 commits intoHelicone:mainfrom
ink-the-squid:feat/token-and-model-usage-charts
Open

feat: add detailed token usage and model usage over time dashboard charts#5596
ink-the-squid wants to merge 2 commits intoHelicone:mainfrom
ink-the-squid:feat/token-and-model-usage-charts

Conversation

@ink-the-squid
Copy link
Contributor

What

Adds two new charts to the dashboard:

1. Token Usage by Type

Line chart with separate lines for each token type:

  • Prompt tokens (blue)
  • Completion tokens (purple)
  • Reasoning tokens (orange) — for models with thinking/reasoning
  • Cache Read tokens (cyan) — prompt cache hits
  • Cache Write tokens (teal) — prompt cache writes

Only shows lines for token types with non-zero data, so it stays clean for users not using caching or reasoning models.

2. Model Usage Over Time

Line chart showing request count per model over time:

  • Shows top 8 models by total requests
  • Groups remaining models into "Other"
  • Uses safe CSS keys for model names with dots/slashes

Backend

  • POST /v1/metrics/detailedTokensOverTime — returns all token types per time bucket
  • POST /v1/metrics/modelUsageOverTime — returns request count + total tokens grouped by model and time

Both endpoints use existing ClickHouse columns (reasoning_tokens, prompt_cache_read_tokens, prompt_cache_write_tokens).

Why

Helps customers understand:

  • Where their tokens are going (e.g. spotting missing cache usage like the recent customer cost spike)
  • Which models are being used and how usage shifts over time

Adds two new dashboard panels:

1. Token Usage by Type - line chart showing prompt, completion,
   reasoning, cache read, and cache write tokens over time. Only
   shows lines for token types that have non-zero data.

2. Model Usage Over Time - line chart showing request count per
   model over time. Shows top 8 models with an 'other' bucket.

Backend:
- New POST /v1/metrics/detailedTokensOverTime endpoint
- New POST /v1/metrics/modelUsageOverTime endpoint
- Uses existing ClickHouse columns (reasoning_tokens,
  prompt_cache_read_tokens, prompt_cache_write_tokens)

Frontend:
- DetailedTokenUsagePanel and ModelUsageOverTimePanel components
- Added to dashboard grid layout
- Includes mock data for onboarding state
@vercel
Copy link

vercel bot commented Feb 20, 2026

@ink-the-squid is attempting to deploy a commit to the Helicone Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant