Discover Packages
github.com/320exh/prompt-diff
internal
cost
package
Version:
v1.0.2
Opens a new window with list of versions in this module.
Published: Aug 13, 2026
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package cost estimates per-model pricing for prompt tokens.
Prices are per 1M input tokens, in USD, approximate list prices as of this
project's v1. The map is used for README-style "cost impact per 100k runs"
projections; it is not a substitute for live billing data.
EstimateBulk computes the cost to run each model's tokens n times.
Lookup returns the USD per-1M-token price for a model.
Unlisted models fall back to a neutral default so projections never crash.
type Estimated struct {
Model string `json:"model"`
Tokens int `json:"tokens"`
Per1M float64 `json:"price_per_1m"`
Cost float64 `json:"cost_usd"`
}
Estimated is a per-model cost estimate for a given token count.
Estimate computes the cost to run count tokens once, per model.
type Price struct {
Per1M float64
}
Price is the USD cost per 1M input tokens.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.