ai-cost-analyzer

v1.1.4
io.github.vpatser1/ai-cost-analyzer Checked 4 days ago Published 4 months ago

Analyze LLM API costs: token waste detection, caching savings estimates, model comparison

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

analyze_usage

Analyze AI API usage data and return cost breakdowns by model, average cost per request, token waste estimation, and daily/weekly trends.

ParameterTypeDescription
usage_data *arrayArray of API usage records with model, tokens, and timestamps

estimate_savings

Estimate potential monthly savings from prompt caching, model routing, and context pruning based on current usage patterns.

ParameterTypeDescription
usage_data *arrayArray of API usage records representing current usage patterns
monthly_multipliernumberIf the usage_data is a sample, multiply costs by this factor to project monthly totals (default: 1)

optimize_prompt

Analyze a system prompt and tool definitions, return an optimized version with redundant content removed, token counts before/after, and cost reduction estimates.

ParameterTypeDescription
system_prompt *stringThe system prompt text to optimize
tool_definitions *arrayArray of tool definition strings (JSON or plain text)
modelstringModel name for pricing calculation (default: claude-sonnet)
requests_per_monthintegerEstimated requests per month for cost projection (default: 10,000)

compare_models

Compare cost and quality tradeoffs across Claude, GPT-4o, GPT-4o-mini, and Gemini models for a given task. Returns cost per request, monthly projections, and recommendations.

ParameterTypeDescription
task_description *stringDescription of the task to compare models for
estimated_input_tokensintegerOverride estimated input tokens per request
estimated_output_tokensintegerOverride estimated output tokens per request

get_pricing

Return current pricing for all major LLM APIs (Claude, OpenAI, Gemini) with input, output, and cached token rates per million tokens.