API pricing math for 1k+ AI models from LLMTracker with multi-currency support.
| Library | Language | Package | Status |
|---|---|---|---|
| Python SDK | Python 3.12+ | tokenpricing |
Stable |
| TypeScript SDK | TypeScript / Node 18+ | tokenpricing |
Stable |
| Service | Language | Path | Status |
|---|---|---|---|
| Notifier | Python 3.12+ | services/notifier/ | Experimental |
pip install tokenpricingfrom tokenpricing import get_pricing_sync, compute_cost_sync
pricing = get_pricing_sync("openai/gpt-5.2", currency="EUR")
print(f"Input: €{pricing.input_per_million:.2f}/1M tokens")
cost = compute_cost_sync("openai/gpt-5.2", input_tokens=1000, output_tokens=500)
print(f"Total: ${cost:.6f}")npm install tokenpricingimport { getPricing, computeCost } from "tokenpricing";
const pricing = await getPricing("openai/gpt-5.2", "EUR");
console.log(`Input: €${pricing.inputPerMillion.toFixed(2)}/1M tokens`);
const cost = await computeCost("openai/gpt-5.2", 1000, 500);
console.log(`Total: $${cost.toFixed(6)}`);Install via pip, then use the tokenpricing command.
# Show price per 1M tokens (USD default)
tokenpricing pricing openai/gpt-5.2
# Convert to another currency (uses cached FX rates)
tokenpricing pricing openai/gpt-5.2 --currency EUR
# JSON output for scripting
tokenpricing pricing openai/gpt-5.2 --json
# Compute total cost for a usage
tokenpricing cost openai/gpt-5.2 --in 1000 --out 500 --currency EURThis repository ships a Claude Code marketplace manifest at .claude-plugin/marketplace.json and the canonical hidden skill at skills/tokenpricing/SKILL.md.
When the plugin is installed, Claude Code can pick up the skill automatically and shell out to the existing tokenpricing CLI for pricing lookups and workload cost calculations.
The canonical skill source in this repository is skills/tokenpricing/SKILL.md.
Pricing data is sourced from LLMTracker, which aggregates and updates pricing information from various LLM providers every six hours.
tokenpricing/
├── .claude-plugin/ Claude Code marketplace manifest
├── skills/ Canonical coding-agent skill
├── services/
│ └── notifier/ Webhook notification service
├── libraries/
│ ├── python/ Python SDK + CLI (PyPI)
│ └── typescript/ TypeScript SDK (npm)
├── .github/workflows/ CI/CD (path-filtered per library)
└── LICENSE
Each library is self-contained. See the individual READMEs for setup and development instructions:
- Pricing data: LLMTracker by MrUnreal
See LICENSE file for details.