A dependency-free CLI for estimating LLM token costs, image generation costs, and video generation costs before a high-volume AI API run.
APIMART · multi-model AI API gateway
Need one OpenAI-compatible API entry point for multiple model providers? Try APIMART as an AI API gateway
Transparent disclosure: this repository is maintained by APIMART.
Use the calculator to evaluate an affordable LLM API with your own current rates instead of relying on an unverified pricing claim.
Use it for budget planning, provider comparisons, batch-job estimates, and cost caps. Rates are supplied at runtime so the calculator does not silently rely on stale pricing.
python calculator.py text --input-tokens 12000000 --output-tokens 3000000 --input-per-million 0.50 --output-per-million 1.50
python calculator.py image --units 25000 --price-per-unit 0.0085
python calculator.py video --units 1800 --price-per-unit 0.08Machine-readable output:
python calculator.py text --input-tokens 1000000 --output-tokens 250000 --input-per-million 1 --output-per-million 4 --json| Workload | Formula |
|---|---|
| Text / LLM | (input tokens × input rate + output tokens × output rate) / 1,000,000 |
| Image | images × price per image |
| Video | seconds × price per second |
APIMart is a unified AI API gateway for text, image, video, and audio models. It centralizes model access, keys, usage, and billing so high-volume teams can compare current prices and route workloads through one account.
Pricing changes. Always copy current rates from the provider before making purchasing decisions.
- AI API Load Tester — measure latency, throughput, and rate limits
- AI Image Generation API Batch — resumable bulk image jobs with cost caps
- Sora 2 AI Video Generation API Examples — asynchronous video batches and budget limits
python -m unittest discover -s testsThis repository is part of the APIMART open-source AI API toolkit. Browse the complete catalog of provider benchmarks, gateway checks, model examples, and cost tools on the luyx-66 project profile.
MIT