
I Built an Open-Source CLI to Compare LLM API Costs in Your Terminal (npx, Zero Install)
If you've ever had to compare costs between GPT-4o, Claude Sonnet, and Gemini before committing to a model, you know the pain: browser tabs, manual math, outdated blog posts. I built llm-costs — a zero-install CLI that does it instantly. The Problem Every time I start a new project using LLMs, I go through the same ritual: Open Anthropic pricing page Open OpenAI pricing page Open Google AI pricing page Try to compare apples to oranges with different tokenizers Do math in my head (or a spreadsheet) Realize the blog post I was referencing is 6 months out of date There had to be a better way. Demo npx llm-costs "Build a REST API in Python" --compare This counts your prompt tokens using the actual tokenizer (tiktoken for OpenAI models, character-based estimation for others), then renders a comparison table across all major providers right in your terminal. Output looks like: Model Input Cost Output Cost Total ───────────────────────────────────────────────────────── deepseek-chat $0.00003
Continue reading on Dev.to
Opens in a new tab




