calcis
v1.0.4
Published
Estimate LLM API costs from the command line
Downloads
667
Maintainers
Readme
calcis
Estimate LLM API costs from the command line.
Live pricing for 25+ models, side-by-side comparisons, and a web estimator: https://calcis.dev
- Full price index: https://calcis.dev/models
- Compare models: https://calcis.dev/compare
- API reference: https://calcis.dev/api-docs
Install
npm install -g calcisSetup
Get your API key at calcis.dev/dashboard, then:
# Quickest: one command writes it to ~/.calcisrc
calcis config set-key calc_your_key_here
# Or write the file yourself
echo '{"apiKey":"calc_your_key_here"}' > ~/.calcisrc
# Or use an environment variable
export CALCIS_API_KEY=calc_your_key_hereUsage
# Estimate cost of a prompt file
calcis estimate prompt.txt --model claude-sonnet-4-6
# Estimate inline text
calcis estimate "Explain how transformers work" --model gpt-5-4
# Pipe from stdin
cat system-prompt.md | calcis estimate --stdin --model gpt-4o
# Compare two models
calcis compare claude-sonnet-4-6 gpt-4o --tokens 1000
# List all models and pricing
calcis models
# JSON output
calcis estimate prompt.txt --model gpt-5-4 --jsonCommands
calcis estimate
Estimate the cost of a prompt against a specific model. The positional
argument can be a file path (read as UTF-8) or literal text. Use
--stdin to pipe prompts from another command.
Requires an API key (Pro tier or above). Get one at calcis.dev/dashboard.
calcis estimate <file-or-text> --model <id> [--effort <level>] [--key <api-key>] [--json]
calcis estimate --stdin --model <id>Output:
[calcis] estimate · claude-sonnet-4-6
Input tokens 243
Output tokens ~650 (predicted)
Input cost $0.000729
Output cost $0.009750
Total cost $0.010479
At 1k req/mo $10.48
Confidence highcalcis models
Print every supported model with current pricing. Data ships with the package: no network call, no API key required. Browse the same dataset on the web at calcis.dev/models.
calcis modelscalcis compare
Side-by-side per-request and at-scale cost comparison between two models. Uses the bundled pricing dataset: no API key required. For an interactive, multi-model version see calcis.dev/compare.
calcis compare <model-a> <model-b> --tokens <input> [--output <output>]--output defaults to 500 if omitted.
calcis config set-key
Persist an API key to ~/.calcisrc (mode 0600) so subsequent runs
don't need --key or CALCIS_API_KEY.
calcis config set-key <your-api-key>Running an auth-required command without a configured key prints a welcome message that links back to calcis.dev/dashboard rather than a terse error.
API key resolution
In order:
--key <value>CLI flagCALCIS_API_KEYenvironment variable~/.calcisrcJSON file:{ "apiKey": "calc_..." }
Links
License
MIT
