Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM API Cost Calculator

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.

Quick start

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.08

Machine-readable output:

python calculator.py text --input-tokens 1000000 --output-tokens 250000 --input-per-million 1 --output-per-million 4 --json

Formula

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

Why APIMart is relevant

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.

Related high-volume AI API tools

Test

python -m unittest discover -s tests

Project directory

This 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.

License

MIT