Documentation

CLI Reference

Complete guide to all llm-cost commands and options.

Installation

Install llmprices via pip:

pip install llmprices

Verify installation:

llm-cost --version

llm-cost list

List all available models and their prices.

Usage

llm-cost list [OPTIONS]

Options

-p, --provider TEXT
Filter by provider (e.g., openai, anthropic)
-s, --sort FIELD
Sort by: input | output | context | name | value
-q, --search TEXT
Search by model or provider name
-t, --tier TIER
Filter by tier: flagship | advanced | standard | budget

Examples

llm-cost list
llm-cost list --provider openai
llm-cost list --sort output --tier budget
llm-cost list --search gemini

llm-cost calc

Calculate cost for a prompt and find the cheapest models.

Usage

llm-cost calc [PROMPT] [OPTIONS]

Arguments

PROMPT
Prompt text to estimate cost for (optional if --input is provided)

Options

-i, --input INTEGER
Input token count (auto-estimated from prompt if not provided)
-o, --output INTEGER
Expected output token count (default: 500)
-n, --top INTEGER
Show top N cheapest models (default: 10)
-p, --provider TEXT
Filter by provider
-m, --model TEXT
Show only a specific model
-t, --tier TIER
Filter by efficiency tier
-s, --sort FIELD
Sort by: cost | value (default: cost)

Examples

llm-cost calc "Build a Python REST API" --output 800
llm-cost calc --input 1000 --output 500 --top 5
llm-cost calc "Hello world" --provider anthropic
llm-cost calc --input 2000 --output 1000 --tier flagship
llm-cost calc --input 1000 --output 500 --sort value

llm-cost compare

Compare specific models side by side.

Usage

llm-cost compare MODEL1 MODEL2 [MODEL3...] [OPTIONS]

Arguments

MODELS
Model IDs to compare (at least 2 required)

Options

-i, --input INTEGER
Input token count (default: 1000)
-o, --output INTEGER
Output token count (default: 500)
--prompt TEXT
Estimate tokens from prompt text

Examples

llm-cost compare gpt-5 o3 gemini-2-5-pro
llm-cost compare claude-opus-4-6 gpt-5 --input 2000 --output 1000
llm-cost compare gpt-5-4-nano mistral-small-3-2 --prompt "Hello world"

llm-cost providers

List all supported providers and their models.

Usage

llm-cost providers

Examples

llm-cost providers

Efficiency Tiers

Models are categorized into four efficiency tiers based on their capabilities and pricing:

Flagship

Most capable models with advanced reasoning and largest context windows. Highest cost.

Examples: Claude Opus 4.6, GPT-5, Gemini 2.5 Pro

Advanced

High-performance models with strong reasoning capabilities. Balanced cost-performance.

Examples: o4 Mini, Claude Sonnet 4.6

Standard

General-purpose models suitable for most tasks. Moderate pricing.

Examples: GPT-5.4 Mini, Mistral Large 3

Budget

Fast, cost-effective models for simple tasks and high-volume use cases.

Examples: GPT-5.4 Nano, DeepSeek V4 Flash, Mistral Small 3.2

Tips & Tricks

Finding the right model

  • Use --tier budget for high-volume, simple tasks
  • Use --tier flagship for complex reasoning and analysis
  • Use --sort value to find the best cost-performance ratio

Token estimation

  • Provide a sample prompt to get automatic token estimation
  • Use --input for precise control when you know exact token counts
  • Rule of thumb: ~1.3 tokens per word for English text

Filtering results

  • Combine --provider and --tier to narrow down options
  • Use --search to quickly find models by name
  • Adjust --top to see more or fewer results