Compute per-call and monthly cost of an LLM API from token counts and per-million-token pricing — the arithmetic behind any LLM pricing calculator. Holds no price table of its own, because published per-model prices change and a library that hardcodes them goes stale.
A worked table of per-model conversation costs is at KickLLM's chatbot cost breakdown.
import llmcost;
const auto perCall = callCost(2000, 500, 3.0, 15.0); // $/call
const auto perMonth = monthlyCost(1000, 2000, 500, 3.0, 15.0); // $/month, 1,000 convosLicense: MIT