package
Version:
v0.8.1
Opens a new window with list of versions in this module.
Published: Apr 20, 2026
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func Calculate(model string, inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens int64) float64
Calculate returns the estimated cost in USD for the given token usage.
Returns 0 if the model is unknown.
ModelPricing holds per-million-token pricing in USD.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.