TokenCost
Estimate token charges inside Python scripts.
Tool
Evaluation · Documentation reviewed 2026-11-10. Not independently tested.
When it helps
Adding approximate prompt and completion cost calculations to experiments.
What to consider
The reviewed repository’s last code push is older; verify its price tables and tokenizer support before budgeting.
Getting started
Try the documented cost functions with independently checked model rates.
Repository evidence
Stars: 2,005 · License: MIT
Last code push: 2025-09-05
Statistics retrieved: 2026-11-23T00:42:59+00:00
Counts are snapshots, not live rankings. Review the repository license and any hosted-service terms before adopting it.
Adding model calls?
Plan the tokens, retries, and fallback costs before connecting your tools.