Stop AI agents from
burning your budget

AgentKavach wraps your LLM client with hard budget enforcement, real-time alerts, and a kill switch that fires before you overspend. One SDK for OpenAI, Anthropic, Google, and Mistral.

< 0.1ms

Budget check overhead

4

LLM providers

4

Alert channels

99.9%

Uptime SLA

from agentkavach import AgentKavach, Budget, ChannelType

def emergency_stop():
    agent.save_checkpoint()
    sys.exit(1)

guard = AgentKavach(
    api_key="cg_...",
    llm_key="sk-...",
    budget=Budget.daily(50),
    on_kill=emergency_stop,
)

response = guard.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
)

How it works

Three steps to hard budget enforcement. No infrastructure changes required.

STEP 01

Install the SDK

One pip install. No infrastructure changes, no sidecar processes.

pip install agentkavach
STEP 02

Wrap your LLM client

Replace your provider client with AgentKavach. Same API, same parameters, with budget enforcement built in.

guard = AgentKavach(
    api_key="cg_...",
    llm_key="sk-...",
    budget=Budget.daily(50),
    on_kill=emergency_stop,
)
STEP 03

Ship with confidence

Every call is tracked. Alerts fire at your thresholds. The kill switch engages at 100%. No surprises on your bill.

response = guard.create(
    model="gpt-4o",
    messages=[...],
)

Everything you need to control AI costs

From a single developer to a fleet of 10,000 agents. AgentKavach scales with your team.

Hard Budget Limits

Set daily, monthly, or total budgets per agent. The kill callback fires at 100% to halt runaway spend before it escalates.

Multi-Provider

OpenAI, Anthropic, Google, Mistral. Track costs across all providers with a single SDK and a unified guard.create() API.

Real-Time Alerts

Slack, email, PagerDuty, or custom webhooks. Configure escalating thresholds at 50%, 80%, 95%, and 100%.

Team Dashboards

See every agent's spend in real time. Drill into model usage, cost trends, and alert history from a single pane.

Guardrails

Token limits, call count caps, runtime limits, and runaway loop detection. Stop agents before they spiral out of control.

Shared Budgets

Pool a single budget across multiple agents and providers. Enforce team-wide spend limits with thread-safe accounting.

One SDK, every provider

The same guard.create() call works across OpenAI, Anthropic, Google, and Mistral. Switch providers without changing your budget logic.

OpenAI
Anthropic
Google
Mistral
from agentkavach import AgentKavach, Budget

guard = AgentKavach(
    provider="openai",       # "openai", "anthropic", "google", or "mistral"
    api_key="cg_...",        # your AgentKavach API key
    llm_key="sk-...",        # your LLM provider API key
    agent_name="my-agent",   # identifies this agent in the dashboard
    budget=Budget.daily(50), # $50/day hard limit
    on_kill=emergency_stop,  # callback at 100% utilization
    save_prompts=False,      # opt-in: log prompts to dashboard
)

response = guard.create(
    model="gpt-4o",          # any model from any supported provider
    messages=[{"role": "user", "content": "Hello!"}],
)

Escalating alerts, automatic shutdown

Configure alert channels at different budget thresholds. Start with an email at 50%, escalate to Slack at 80%, page your on-call at 95%, and trigger the kill switch at 100%. Each channel validates its credentials at construction time.

50%
Email notification to ops team
80%
Slack message to #cost-alerts channel
95%
PagerDuty incident for on-call team
100%
Kill switch fires, agent halted
guard = AgentKavach(
    provider="openai",
    api_key="cg_...",
    llm_key="sk-...",
    budget=Budget.daily(100),
    on_kill=emergency_stop,
    channels=[
        AgentKavach.channel(ChannelType.EMAIL,
            threshold=0.50,
            to="ops@acme.com",
        ),
        AgentKavach.channel(ChannelType.SLACK,
            threshold=0.80,
            webhook_url="https://hooks...",
            template="{agent_name} at {pct}% budget",
        ),
        AgentKavach.channel(ChannelType.PAGERDUTY,
            threshold=0.95,
            routing_key="R0abc...",
        ),
        AgentKavach.channel(ChannelType.KILL,
            threshold=1.0,
        ),
    ],
)
agentkavach.yaml
channels:
  slack:
    type: slack
    webhook_url: https://hooks.slack.com/...
    channel: "#cost-alerts"
  pagerduty:
    type: pagerduty
    routing_key: R0abc123
    service_url: https://events.pagerduty.com/v2/enqueue
    team: AI Ops Team

shared_budgets:
  engineering-pool:
    limit: 500
    period: daily
    agents: [research-bot, code-review]

agents:
  research-bot:
    provider: openai
    budget: { type: daily, limit: 50 }
    alerts:
      - { threshold: 0.80, channels: [slack] }
      - { threshold: 1.0, channels: [kill] }

  support-agent:
    provider: anthropic
    budget: default

Manage entire teams with YAML

Define budgets, alerts, and shared pools for all your agents in a single configuration file. AgentKavach validates every channel reference, budget type, and shared pool name at load time. Misconfigured alerts fail fast, not at 3 AM.

Shared budgets across agents and providers
Channel definitions with type validation
Defaults with per-agent overrides
Load all agents with one AgentKavach.from_yaml() call

Security

AgentKavach is built with security at every layer. Your API keys, spend data, and agent communications are protected by industry-standard practices from day one. We never use your LLM provider API key for any purpose other than proxying your requests. We only read the response metadata (token counts, model used) to track costs — we never store, log, or access your prompts or completions.

  • TLS 1.2+ on all API traffic
  • JWT + API key authentication
  • Role-based authorization, keys scoped per org
  • Parameterized queries, no SQL injection
  • Redis-backed rate limiting
  • HMAC webhook signing
  • Your provider API key is never used for any purpose beyond proxying your requests

Simple, transparent pricing

Start free. Scale when you need to.

Free

$0forever

For solo developers and prototypes.

  • Up to 3 agents
  • 10,000 events/day
  • Email alerts
  • Kill switch
Most Popular

Pro

$20/month

For teams running production agents.

  • Up to 100 agents
  • 1 million events/day
  • Email alerts
  • Kill switch
  • Agent-level budgets

Max

$100/month

For fleets of AI agents at scale.

  • Up to 10,000 agents
  • 1,000,000 events/day
  • All alert channels (Slack, PagerDuty, Webhooks)
  • Kill switch
  • Shared budgets across teams

Model Pricing Reference

Sourced from provider pricing pages: OpenAI, Anthropic, Google, Mistral

ProviderModelInput / 1K tokensOutput / 1K tokens
Anthropicclaude-3-5-haiku-20241022$0.000800$0.004000
Anthropicclaude-3-5-sonnet-20241022$0.003000$0.015000
Anthropicclaude-3-haiku-20240307$0.000250$0.001250
Anthropicclaude-3-opus-20240229$0.015000$0.075000
Anthropicclaude-haiku-4-5$0.000800$0.004000
Anthropicclaude-opus-4-0$0.015000$0.075000
Anthropicclaude-opus-4-6$0.015000$0.075000
Anthropicclaude-sonnet-4-0$0.003000$0.015000
Anthropicclaude-sonnet-4-6$0.003000$0.015000
Googlegemini-1.5-flash$0.000075$0.000300
Googlegemini-1.5-pro$0.001250$0.005000
Googlegemini-2.0-flash$0.000100$0.000400
Googlegemini-2.5-flash$0.000150$0.003500
Googlegemini-2.5-pro$0.001250$0.010000
Mistralcodestral-latest$0.000300$0.000900
Mistralministral-8b-latest$0.000100$0.000100
Mistralmistral-embed$0.000100$0.000100
Mistralmistral-large-latest$0.002000$0.006000
Mistralmistral-small-latest$0.000100$0.000300
Mistralpixtral-large-latest$0.002000$0.006000
OpenAIcodex-mini$0.001500$0.006000
OpenAIgpt-3.5-turbo$0.000500$0.001500
OpenAIgpt-4$0.030000$0.060000
OpenAIgpt-4-turbo$0.010000$0.030000
OpenAIgpt-4.1$0.002000$0.008000
OpenAIgpt-4.1-mini$0.000400$0.001600
OpenAIgpt-4.1-nano$0.000100$0.000400
OpenAIgpt-4.5-preview$0.075000$0.150000
OpenAIgpt-4o$0.002500$0.010000
OpenAIgpt-4o-mini$0.000150$0.000600
OpenAIo1$0.015000$0.060000
OpenAIo1-mini$0.003000$0.012000
OpenAIo3$0.010000$0.040000
OpenAIo3-mini$0.001100$0.004400
OpenAIo4-mini$0.001100$0.004400

Frequently Asked Questions (FAQ)

Can I change plans anytime?

Yes. Upgrade or downgrade at any time. Changes take effect immediately. Downgrades are prorated.

What counts as an event?

Each LLM API call tracked through the SDK counts as one event. Batch calls count as one event per item in the batch.

Is there a free trial for paid plans?

Pro comes with a 14-day free trial. No credit card required to start. Max does not include a trial.

What happens when I hit my event limit?

Once you exceed your event limit, monitoring, alerts, and the kill switch stop functioning until your limit resets at midnight. New agents cannot be onboarded past the limit either. To avoid disruption, upgrade to a higher plan before reaching your cap.

Do you support custom invoicing?

Max customers can request custom invoicing and payment terms. Contact us for details.

Start controlling costs in 2 minutes

pip install agentkavach

Create Your Account