v1.0.0 · Free · Open Source · Local-First

Stop your AI agents from bankrupting you

ToastyKey sits between your code and every AI provider — tracking every call, calculating every cent, and stopping runaway agents before they drain your budget.

$ npm install -g toastykey
View on GitHub
7
AI Providers
13
MCP Tools
148
Tests Passing
0
Telemetry
MIT
License
localhost:3000 — ToastyKey Dashboard
Overview
Projects
Key Vault
Triggers
Reports
Overview
Real-time API cost monitoring and analytics
Today's Spend
₹3,439
This Month
₹3,439
API Calls
470
Projects
5
Spend Trend (30 Days)
Provider Breakdown
openai
₹1.9K 54%
anthropic
₹1.3K 36%
stability
₹168 5%
elevenlabs
₹144 4%

Everything you need to control AI spending

From real-time tracking to anomaly detection — built for developers who run AI agents and don't want surprises on their billing page.

Real-Time Cost Tracking

Every API call to every AI provider is intercepted, logged, and priced in real-time. See your spend for today, this week, this month — broken down by provider, project, and model. Never discover overspending after the fact.

Budget Alerts That Stop Things

Set daily or monthly budgets per provider, project, or globally. At 80% you get a warning. At 100%, ToastyKey auto-pauses the responsible provider or kills all API calls outright. Hard stops, not soft suggestions.

Anomaly Detection

Six trigger types — rate spikes, cost spikes, error storms, token explosions, silent drain, new providers. Each fires a configurable action: log, webhook, dashboard alert, Claude Code notification, auto-pause, or auto-kill.

Encrypted Key Vault

Store all your API keys in one encrypted vault (AES-256-GCM). Auto-detect keys from .env files across your filesystem. Keys never leave your machine. Never.

MCP for Claude Code

Claude Code can query its own costs, set budgets, and get optimization recommendations without leaving the conversation. "How much have I spent today?" "Set my daily budget to ₹5,000." 13 MCP tools, fully integrated.

Any Provider via Generic Proxy

OpenAI, Anthropic, ElevenLabs, Cartesia, Replicate, Stability AI — all native handlers with model-level pricing. Plus a generic HTTP proxy for any REST API. Point it anywhere.

Three-minute setup, lifetime visibility

ToastyKey is a transparent proxy. Your code still calls the same APIs — you just swap one base URL. No SDK changes, no code refactoring.

1
Install and start
One command installs and launches the proxy server and dashboard. On first run, the setup wizard scans for your existing API keys.
$ npm install -g toastykey
$ toastykey
✓ Found 3 API keys in .env files
Proxy listening on :4000
Dashboard: http://localhost:3000
2
Point your code at the proxy
Change one environment variable in each project. The proxy forwards your requests transparently — same response, same latency, now fully tracked.
# .env — change just this line
OPENAI_BASE_URL=http://localhost:4000/openai/v1

# Anthropic, ElevenLabs, etc. — same pattern
ANTHROPIC_BASE_URL=http://localhost:4000/anthropic
3
Watch the dashboard
Every call appears in real-time. Per-project cost attribution happens automatically. Set budgets, add triggers, generate reports — all from the dashboard.
4
Let Claude Code see its own costs
Add the MCP config to your Claude Code settings. Now Claude can answer cost questions, set limits, and alert you — all within the conversation.
# Ask Claude Code directly:
"How much have I spent this week?"
→ ₹2,847 across 3 projects
"Pause Anthropic if I hit ₹1,000 today"
→ Budget trigger created ✓

Claude Code that knows what it costs

Add ToastyKey to your Claude Code settings.json and get 13 tools that let your AI agent monitor and control its own spending.

{
  "mcpServers": {
    "toastykey": {
      "command": "node",
      "args": [
        "/path/to/toastykey/src/index.js",
        "mcp"
      ]
    }
  }
}

The Settings page generates this config automatically — just copy and paste.

get_spend_summaryToday / week / month spend
get_project_costCost for a project directory
get_session_costCurrent session cost
set_budgetCreate or update a budget
get_budget_statusRemaining budget + alert state
pause_providerHalt calls to a provider
get_recommendationsCost optimization suggestions
+ 6 more tools

Every AI provider you use, tracked

Native handlers with model-level pricing for the biggest providers. Plus a generic proxy for any REST API you want to monitor.

NATIVE
OpenAI
/openai/*
NATIVE
Anthropic
/anthropic/*
NATIVE
ElevenLabs
/elevenlabs/*
NATIVE
Cartesia
/cartesia/*
NATIVE
Replicate
/replicate/*
NATIVE
Stability AI
/stability/*
GENERIC
Any REST API
/custom/:name/*

Why not Helicone, Portkey, or LiteLLM?

Those are great tools. But they're cloud-based, they charge for features, and none of them speak MCP. ToastyKey is the only local-first, Claude Code-native option.

Feature ToastyKey Helicone Portkey LiteLLM
Local-first, no cloud✗ Cloud✗ Cloud
Free foreverFreemiumFreemium
MCP / Claude Code native✓ 13 tools
Visual dashboard✗ CLI
Anomaly detection✓ 6 types
Encrypted key vault✓ AES-256-GCM
Budget auto-pausePartialPartial
Zero telemetry

Ready to track every API call?

Free, open source, runs on your machine. Up in 3 minutes.

$ npm install -g toastykey
View on GitHub →