tokencost-dev

v0.1.3
io.github.jeff-atriumn/tokencost-dev Checked 4 days ago Published 9 months ago

LLM pricing oracle — model lookup, cost estimation, and comparison via LiteLLM

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_model_details

Look up pricing, context window, and capabilities for an LLM model. Uses fuzzy matching so you don't need the exact model key.

ParameterTypeDescription
model_name *stringModel name to look up (e.g. 'claude-sonnet-4-5', 'gpt-4o', 'gemini-2.0-flash')

calculate_estimate

Estimate the cost for a given number of input and output tokens on a specific model. Supports optional cached_tokens for prompt caching discounts.

ParameterTypeDescription
input_tokens *numberNumber of input tokens
model_name *stringModel name (fuzzy matched)
output_tokens *numberNumber of output tokens
cached_tokensnumberNumber of input tokens served from cache (prompt caching). Must be <= input_tokens. These tokens are billed at the cached rate instead of the standard input rate.

compare_models

Filter and compare models by provider, minimum context window, or mode. Returns top 5 most cost-effective matches.

ParameterTypeDescription
min_contextnumberMinimum context window size in tokens
modestringFilter by mode (e.g. 'chat', 'embedding', 'completion', 'image_generation')
providerstringFilter by provider (e.g. 'anthropic', 'openai', 'google', 'amazon')

refresh_prices

Force a re-fetch of pricing data from the LiteLLM registry. Use this if you suspect the cached data is stale.