DEV Community

ModelHub Dev
ModelHub Dev

Posted on

How to Compare AI API Costs Across Providers: CLI Tool Walkthrough

API costs are the second-biggest expense (after compute) for AI startups. Here is a free CLI tool to compare them.

The Problem

You need to pick an AI API provider. Prices vary wildly:

  • DeepSeek V4 Flash: $0.15/M tokens
  • GPT-5.5: $5.00/M tokens
  • Claude Haiku 3.5: $0.80/M tokens

But comparing blends of input/output costs across models at your specific volume is tedious.

The Solution: ai-model-cost

A zero-config CLI tool. Install it in one command:

npx ai-model-cost --tokens=100M --compare
Enter fullscreen mode Exit fullscreen mode

Output shows every major model sorted by price with monthly cost at your volume.

Quick Examples

# Compare all models at 100M tokens
npx ai-model-cost -t=100M -c

# Check a specific model
npx ai-model-cost --model=gpt-5.5 --tokens=500M

# List all available models
npx ai-model-cost --list
Enter fullscreen mode Exit fullscreen mode

The Results at 100M Tokens/Month

Model Monthly Cost vs GPT-5.5
DeepSeek V4 Flash (ModelHub) $18 45x cheaper
Gemini 2.0 Flash $22 36x cheaper
DeepSeek V4 Flash (Official) $9 91x cheaper
GPT-5.5 $800 baseline

Bottom Line

Before signing up for a $2,000/month API bill, run this tool. It takes 5 seconds.

https://github.com/AdamXiao-eolab/ai-model-cost

Top comments (0)