Open Source · Apache 2.0

Know exactly what
your AI actually costs

Track every token, every dollar — per feature, per user, per project. Self-hosted, privacy-first. You keep your API keys.

Get Started See How It Works
Your App → TokenBudget (proxy or SDK)OpenAI / Anthropic
                    ↓
       Records: tokens, cost, model, latency
       Never records: prompts, responses, API keys
                    ↓
       Dashboard: costs by feature, user, project

Everything you need

Full visibility into AI spending with zero data exposure.

📊

Real-Time Dashboard

See costs as they happen. Break down by feature, user, project, or model. Spot anomalies before they become problems.

🔒

Privacy First

Self-hosted. Your API keys pass through — never stored. Only token counts and costs are recorded. No prompts, no responses.

5-Minute Setup

Docker Compose brings up everything: PostgreSQL, Redis, API, and dashboard. One command to deploy.

🔌

Multiple Integrations

Python SDK, JavaScript SDK, proxy mode, or direct API. Works with OpenAI, Anthropic, and more.

🏷️

Tag Everything

Tag by feature, user, team, or environment. Context tags let you slice costs any way you need.

🚨

Budget Alerts

Set spending limits per project or feature. Get notified before costs spiral. Rate limiting built in.

Up and running in minutes

Choose your integration method.

Python SDK
Proxy
Docker
import openai
import tokenbudget

# Wrap your existing client — one line change
client = tokenbudget.wrap(
    openai.Client(),
    api_key="tb_ak_YOUR_KEY",
    endpoint="http://localhost:2727"
)

# Use as normal — costs tracked automatically
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello"}]
)

Built for teams like yours

🚀

Startups using AI APIs

Track costs before they surprise you

👥

Multi-feature teams

See which feature costs the most

💰

Per-customer billing

Know your cost per user

💸

Shocked by AI bills

Never again

Start tracking your AI costs today

Open source. Free forever. Deploy in 5 minutes.

View on GitHub