Metadata-Version: 2.4
Name: promptpricer
Version: 0.1.1
Summary: Instant token count and cost estimate across all major LLMs
Project-URL: Homepage, https://github.com/Sreechandh22/Prompt-cost
Project-URL: Repository, https://github.com/Sreechandh22/Prompt-cost
Author: Sreechandh
License: MIT
Keywords: anthropic,cost,gemini,llm,openai,pricing,tokens
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Requires-Dist: pyperclip
Requires-Dist: rich
Requires-Dist: tiktoken
Description-Content-Type: text/markdown

# promptpricer

Token count and cost estimate across all major LLMs. One command, no API keys.

```
$ promptpricer "You are a helpful assistant. Summarize this document in detail."

Prompt: 12 tokens   Expected output: 500 tokens

 Model              Input tokens   Output tokens   Input cost   Output cost      Total
 ──────────────────────────────────────────────────────────────────────────────────────
 gpt-4.1-nano                 12             500   <$0.0001      $0.0002        $0.0002
 gemini-2.0-flash             12             500   <$0.0001      $0.0002        $0.0002
 gpt-4o-mini                  12             500   <$0.0001      $0.0003        $0.0003
 gpt-4.1-mini                 12             500   <$0.0001      $0.0008        $0.0008
 gemini-2.5-flash             12             500   <$0.0001      $0.0013        $0.0013
 o4-mini                      12             500   <$0.0001      $0.0022        $0.0022
 claude-haiku-4               12             500   <$0.0001      $0.0025        $0.0025
 gpt-4o                       12             500   <$0.0001      $0.0050        $0.0051
 claude-sonnet-4              12             500   <$0.0001      $0.0075        $0.0075
 claude-opus-4                12             500    $0.0002      $0.0375        $0.0377
```

Prices are fetched from [LiteLLM](https://github.com/BerriAI/litellm) and cached locally for 24 hours.

## Install

```bash
pip install promptpricer

```

Or from source:

```bash
git clone https://github.com/Sreechandh22/Prompt-cost
cd Prompt-cost
pip install -e .
```

## Usage

```bash
# pass a prompt directly
promptpricer "your prompt here"

# specify expected output tokens (default: 500)
promptpricer "your prompt" --output 1000

# read from a file
promptpricer --file prompt.txt

# read from clipboard
promptpricer

# filter by provider
promptpricer "your prompt" --filter anthropic
promptpricer "your prompt" --filter openai
promptpricer "your prompt" --filter google

# show only the N cheapest models
promptpricer "your prompt" --top 3

# output as JSON (pipe into other tools)
promptpricer "your prompt" --json

# force refresh pricing cache
promptpricer --update
```

## Providers

| Provider  | Models |
|-----------|--------|
| OpenAI    | gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, o3, o4-mini |
| Anthropic | claude-opus-4, claude-sonnet-4, claude-haiku-4 |
| Google    | gemini-2.5-pro, gemini-2.5-flash, gemini-2.0-flash |
