Token Up

Inspiration

AI agents can generate enormous amounts of usage before anyone notices the bill. Existing provider dashboards often show costs after the fact, while finance teams still spend valuable time reconciling usage, contracts, invoices, and unexpected charges manually.

We built Token Up to make AI spending easily observable and understandable. Our goal was to detect runaway usage quickly, explain what happened, notify the right people, and preserve the evidence needed for month-end reconciliation.

What it does

Token Up is an AI spend monitoring and reconciliation platform.

It provides:

  • Real-time visualization of AI usage and estimated spending
  • Rapid detection of runaway-agent spending
  • In-app warnings and email alerts when a usage spike occurs
  • Anomaly cases containing the affected key, model, baseline, projected cost, and supporting evidence
  • Month-end usage accrual workflows
  • Provider invoice reconciliation and duplicate-invoice detection
  • Ownership and team mapping for provider API keys
  • Authenticated connections for importing OpenAI and Anthropic usage

How we built it

Token Up uses a Next.js and TypeScript frontend with a FastAPI backend.

TimescaleDB and PostgreSQL form the core data platform. Usage events are stored as time-series data and aggregated into minute, hourly, and daily views. Database jobs continuously evaluate recent usage against historical baselines and create anomaly cases when spending exceeds expected thresholds.

The backend provides:

  • Authentication and role-based access
  • OpenAI and Anthropic usage ingestion
  • Spend estimation using model-specific pricing
  • Durable notification queues with deduplication
  • Transactional email delivery through Postmark
  • Server-sent events for immediate browser alerts
  • Auditable close and reconciliation workflows

The demo includes a configurable usage simulator capable of generating normal traffic, runaway agents, price changes, late metering, and duplicate invoices.

Challenges we ran into

The hardest challenge was making anomaly detection both fast and credible. Minute-level aggregates were too slow for a short demonstration, while reacting directly to individual events created too much noise. We created a hybrid detector that combines historical baselines with a short real-time usage window.

We also had to optimize spike detection over millions of simulated events. An early implementation found the anomaly quickly but then spent too long searching historical data for its exact start time. Bounding that search reduced the complete detection process from nearly a minute to only a few seconds.

Other challenges included:

  • Keeping synthetic and authenticated provider data completely separate
  • Handling provider APIs that report hourly rather than minute-level usage
  • Encrypting API credentials without ever returning them to the browser
  • Coordinating database events, browser popups, and asynchronous email delivery
  • Designing a complex financial workflow that remains understandable during a short demo

Accomplishments that we're proud of

We are especially proud that Token Up can turn a runaway AI workload into an actionable case within seconds.

The resulting alert is more than a just a warning. It identifies the affected key and model, compares current spending with its normal baseline, estimates the financial impact, and links directly to supporting evidence.

We are also proud of:

  • A smooth, pitch-ready synthetic demonstration
  • Real OpenAI and Anthropic account connectivity
  • Durable and deduplicated email alerts
  • Clear separation between real and simulated data
  • Responsive spend visualizations

What we learned

We learned that cost monitoring is fundamentally a time-series problem, but resolving cost issues also requires business context.

A usage spike becomes useful only when it can be connected to:

  • The API key responsible
  • Its owner and team
  • The model being used
  • Historical behaviour
  • Current pricing
  • Expected invoices
  • The financial close process

We also learned that fast detection does not require sacrificing accuracy. Combining raw recent events with longer-term aggregates provides both immediate feedback and a defensible baseline.

Finally, we learned that demo experience matters. An alert can technically work and still feel confusing if it appears before the user sees the graph change. Small decisions around timing, loading states, navigation, and feedback made the product much easier to understand.

What's next for Token Up

Our next step is to bring the real-data workspace closer to the responsiveness of the synthetic demo.

Planned improvements include:

  • Real-data anomaly detection as provider reports become available
  • Configurable budgets and alert thresholds
  • Slack, Microsoft Teams, and PagerDuty notifications
  • User-managed notification preferences
  • More AI and cloud providers
  • Invoice ingestion from accounting platforms
  • Postmark delivery webhooks for confirmed email-delivery status
  • Organization-level workspaces and team invitations
  • Deployment, monitoring, and operational hardening

Our long-term goal is for Token Up to become the financial control plane for AI usage: detecting problems early, explaining their impact, and carrying them through reconciliation and close.

Built With

Share this project:

Updates

Submission history