AI Spend Observability

TokenGoblin — Catch the little monsters eating your AI spend

Track, analyze, and optimize AI token spending across your autonomous agent workforce — and now find the agents burning money with enterprise telemetry: cost by model, ROI by feature, and zombie-agent detection on a high-volume analytics engine.

What it does

Track

Token ingestion

Ingest token usage from OpenAI, Anthropic, local models, and custom providers via simple API. Quota enforcement and per-tenant isolation from day one.
Analyze

Spend intelligence

Break down costs by model, agent, workflow, team, and time. Spot anomalies and drift automatically — every claim backed by the events that produced it.
Optimize

Efficiency recommendations

Get actionable suggestions: model routing, prompt compression, caching, batching, and routing rules.

Enterprise telemetry NEW — live in the stack

The analytics tier runs on a ClickHouse mirror alongside the transactional store — built for high-volume token telemetry, without letting an analytics outage ever touch ingestion. Real endpoints, real numbers:

Find waste

Zombie agents

Agents that keep spending while their output gets rejected. Zero-acceptance workers with unpriced spend surface too — invisible cost is the worst cost.
Attribute

Cost by model & feature

Windowed cost per model and per feature, with ROI defined as cost per accepted output — so "expensive" and "productive" stop being the same conversation.
Scale

Analytics that can't hurt ingestion

Events persist to the source of truth first, then mirror best-effort. Analytics degrade to a clear error — they never fabricate numbers and never block a write.
GET /v1/analytics/cost             → windowed spend summary
GET /v1/analytics/cost/by-model    → expensive-model $8.66 / 8 reqs vs efficient-model $0.001 / 9 reqs
GET /v1/analytics/cost/by-feature  → research ROI $1.24 per accepted output
GET /v1/analytics/zombie-agents    → worker-unknown: 0% acceptance · investigate

Plans

Free

Track

Token ingestion, dashboards, anomalies, cost overview. Everything you need to see the problem.
Pro
Optimize
Efficiency recommendations, model routing, exportable reports, and the paid analytics surface including zombie-agent detection.
Enterprise
Telemetry
High-volume analytics mirror, custom thresholds, retention controls, SSO-ready multi-tenant isolation, and priority support.

Stack

Cloudflare Workers

API + ingestion + scheduled analytics

Postgres / D1

Transactional source of truth (Postgres for self-hosted, D1 at the edge), RLS-enforced tenant isolation

ClickHouse telemetry mirror

High-volume cost analytics: rollups, ROI, zombie agents

Go + TypeScript SDKs

Language-agnostic ingestion clients

Current status

Worker: Deployed (tokengoblin-api)
Dashboard: Pages (tokengoblin-frontend)
Landing: Pages (tokengoblin-landing)
Billing: Stripe checkout + verified webhook lifecycle
Isolation: per-tenant RLS + API-key roles
Telemetry: ClickHouse analytics mirror (cost/ROI/zombie/anomaly endpoints live)

Next:
- Live Stripe test-mode checkout round trip
- Team/workspace admin UI