lazymac2x avatar

Ai Cost Optimizer

lazymac2x/ai-cost-optimizer-api

This is a Cloudflare Workers-based server that helps you optimize AI API costs, though the source doesn't reveal specific operations or integrations. It's deployed as a remote MCP server over streamable HTTP, so you connect to it at api.lazy-mac.com rather than running it locally. The dual REST and MCP interface suggests it can work both as a traditional API and through Claude's MCP protocol. You'd likely reach for this if you're managing multiple AI provider costs and want centralized optimization logic without hosting your own service. Without more documentation on what cost optimization strategies it actually implements or which AI providers it supports, you'll need to explore the API directly to see if it fits your use case.

tools
5
transport
HTTP
last updated
May 16, 2026

Install

From registry metadata
$ npx add-mcp https://api.lazy-mac.com/ai-cost-optimizer/mcp --name ai-cost-optimizer

Run in your terminal. add-mcp asks which agents to add it to (Claude Code, Codex, Cursor and more). Add -g to install it for every project.

Review the command, arguments and environment values before installing. MCP servers run with your local permissions.

Other ways

Claude Code

$ claude mcp add --transport http ai-cost-optimizer https://api.lazy-mac.com/ai-cost-optimizer/mcp

Run in your terminal. Add --scope user to make it available in every project.

Tools

Verified live · 5 tools

Verified live against the running server on Nov 6, 2026.

cost_trackerRecord and retrieve AI API call costs by team. Persists to Cloudflare KV — survives cold starts and scale-out.6 params

Record and retrieve AI API call costs by team. Persists to Cloudflare KV — survives cold starts and scale-out.

Parameters* required
action*string
"record" to log a call, "get" to retrieve recent recordsone of record · get
inputTokensnumber
Number of input/prompt tokens consumed
metadataobject
Optional key-value metadata (request ID, user, feature flag, etc.)
modelstring
Model ID (e.g., claude-3-5-sonnet-20241022, gpt-4o, gemini-2.0-flash)
outputTokensnumber
Number of output/completion tokens generated
teamstring
Team or project identifier (default: "default")
token_calculatorCalculate cost from token counts for any supported AI model. Stateless — no KV required.3 params

Calculate cost from token counts for any supported AI model. Stateless — no KV required.

Parameters* required
inputTokens*number
Input token count
model*string
Model ID to price
outputTokens*number
Output token count
budget_alertSet and check budget limits for teams. Raises a flag when a configurable spending threshold is reached.4 params

Set and check budget limits for teams. Raises a flag when a configurable spending threshold is reached.

Parameters* required
action*string
"set" to configure a budget, "check" to get current statusone of set · check
budgetLimitnumber
USD budget cap
teamstring
Team identifier
thresholdnumber
Alert threshold percentage 0–100 (default: 80)
model_breakdownAnalyze costs broken down by model for a given team over a configurable time window.2 params

Analyze costs broken down by model for a given team over a configurable time window.

Parameters* required
daysnumber
Lookback window in days (default: 30)
teamstring
Team identifier
cost_forecastForecast future AI spend based on historical usage patterns using daily-average linear projection.3 params

Forecast future AI spend based on historical usage patterns using daily-average linear projection.

Parameters* required
forecastDaysnumber
Days to project ahead (default: 7)
historicalDaysnumber
Days of history to base the forecast on (default: 30)
teamstring
Team identifier

Sponsors

Readme

ai-cost-optimizer-api

Cloudflare Workers MCP server: ai-cost-optimizer. REST + MCP (JSON-RPC 2.0). Live: api.lazy-mac.com/ai-cost-optimizer

Details

Repository
github.com/lazymac2x/ai-cost-optimizer-api
Category
Cloud & Infrastructure
Transport
HTTP
Registry
MCP registry, active
Tools verified
Nov 6, 2026

More from lazymac2x

Related Cloud & Infrastructure MCP servers

View all
1lazymac2x avatarAi Guardrailslazymac2x/ai-guardrails-apiCloudflare Workers MCP server: ai-guardrails0stars
2lazymac2x avatarAi Model Routerlazymac2x/ai-model-router-apiCloudflare Workers MCP server: ai-model-router0stars
3lazymac2x avatarAi Prompt Optimizerlazymac2x/ai-prompt-optimizer-apiCloudflare Workers MCP server: ai-prompt-optimizer0stars
4lazymac2x avatarAi Provider Statuslazymac2x/ai-provider-status-apiCloudflare Workers MCP server: ai-provider-status0stars
5lazymac2x avatarAi Rate Limit Trackerlazymac2x/ai-rate-limit-tracker-apiCloudflare Workers MCP server: ai-rate-limit-tracker0stars
6lazymac2x avatarApi Changelog Trackerlazymac2x/api-changelog-tracker-apiCloudflare Workers MCP server: api-changelog-tracker0stars