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 and cached locally for 24 hours.
Install
pip install promptpricer
Or from source:
git clone https://github.com/Sreechandh22/Prompt-cost
cd Prompt-cost
pip install -e .
Usage
# 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 |
| gemini-2.5-pro, gemini-2.5-flash, gemini-2.0-flash |
Metadata
Release files for promptpricer 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| promptpricer-0.1.1.tar.gz | 4.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| promptpricer-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.6 kB
Release files / promptpricer-0.1.1.tar.gz
| Download URL | promptpricer-0.1.1.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bba337d76e5e4ef9550f60a23519775a8edfea5e399609882f8139c9b2904d47
|
|
BLAKE2b-256 checksum How to use checksums |
75d0ee42fd94567524b8bdfe897281b7e38c2472da15350962a326470a56fe2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Release files / promptpricer-0.1.1-py3-none-any.whl
| Download URL | promptpricer-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f75d05e10e6316c975053a32dc9e2e77b6291acaa317baee31b819e7e03f85e2
|
|
BLAKE2b-256 checksum How to use checksums |
e279bcad576d73abc18d2daf0e6a2e30c9371fde8339197b5f448c2643f3e9c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Security for promptpricer 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.