AI Cost Tracking
oncost provides dedicated views for AI provider costs (Anthropic and OpenAI), going beyond dollar amounts to show token usage and efficiency trends.AI cost view
Under Spend, the AI cost view shows:Cost by model
Bar chart comparing spend across models (e.g., Claude Opus vs. Sonnet vs. Haiku, GPT-4o vs. GPT-4).Token usage by model
Token counts per model, showing input and output token volumes. Helps identify which models consume the most capacity.Cost-per-token trend
Line chart showing how your cost-per-token changes over time. Useful for spotting rate changes or shifts in model mix.How it works
oncost pulls usage data directly from the Anthropic Usage API and OpenAI Usage API. This data is enriched with token counts and stored alongside cost data, enabling model-level drill-down.Tips for AI cost optimization
- Separate API keys per environment — dev, staging, and prod should use different keys so you can see where tokens are going
- Separate keys per team — enables tag-based cost attribution per team
- Monitor cost-per-token trends — a rising trend may indicate a shift toward more expensive models
- Use the Explorer — group by
sub_serviceto see per-model breakdown across all providers