AgentOps-AI/tokencost
A Python library that provides token counting and price estimation utilities for over 400 LLM APIs.

Velocity · 7d
+2.2
★ / day
Trend
→steady
star history
Tokencost offers client-side token counting and cost calculation functions for major LLM providers, enabling developers to estimate the USD cost of prompts and completions before sending API requests. The library tracks pricing changes across hundreds of models from OpenAI, Anthropic, and other providers, integrating with the AgentOps observability platform for broader agent monitoring.