Skip to content
All Projects
AI EngineeringProduction Core

Anchor

AI Cost Attribution & Real-Time Outage Monitoring from Shared Provider Spend

Restores per-application cost visibility from a single shared AI invoice. A near-zero-touch SDK captures durable usage “receipts”, and invoice-anchored reconciliation turns one opaque bill — “$100 Gemini” — into a defensible split: “$84 image generation, $16 chatbot”. The same SDK now adds a real-time outage-monitoring path, turning silent, log-only failures — in a dependency or the app itself — into instant, structured incident alerts.

PythonSQLite (WAL)PostgreSQLOpenAIGeminiGrokOutbox PatternIdempotent IngestionReal-Time AlertingDocker
Problem Statement

Organizations run a fleet of applications against a few shared AI provider accounts (OpenAI, Gemini, Grok). It is operationally convenient but financially opaque: the provider issues one consolidated invoice with no breakdown of which application, team or feature drove the spend — and as AI scales from experiment to core infrastructure, that blind spot becomes a real governance and budgeting problem.

  • A shared provider key yields one aggregate invoice — finance cannot attribute cost to a product line and engineering cannot judge whether a feature is economically viable.
  • Issuing a key per app fragments account management, multiplies secret rotation, and still leaves cross-cutting features unattributed.
  • Client-side token math and bespoke per-app logging drift from the real bill, double-count on retries, and lose events when a process crashes before shipping.
Headline Outcomes
Reconciles to the cent

Per-application cost vs. real invoice

One opaque bill

Zero

Data loss under any component failure

Real-time alerts

Silent dependency & app failures

Log-only, unnoticed

144 passing

Integrity, resilience, accuracy & outage suite

The Solution

An accuracy-first platform that treats the provider as a passive source of truth: it captures a durable “receipt” for every AI call to establish each application’s share of usage, then anchors those proportions to the provider’s actual invoice — so every per-application dollar always sums to the real bill, regardless of estimation error.

Central insight — proportions × anchored total: trust captured events only for relative share, then scale to the invoice the org actually pays, so numbers reconcile and stay defensible to finance.

A durable local outbox plus at-least-once, idempotent ingestion yields an exactly-once effect — no loss, no double-count, even under repeated failure.

Universal duck-typed capture handles chat, embeddings, image, audio and streaming across OpenAI, Gemini and Grok — including custom or wrapped response shapes.

Versioned, effective-dated pricing auto-syncs from community feeds, so historical events stay correctly priced and stale-price drift is surfaced automatically.

A separate, real-time-first telemetry path auto-detects external dependency outages and internal application errors, raising immediate structured alerts (with a durable fallback so none are lost) plus a dashboard of outages by app, service, status code and type.

System Architecture

How the data flows

01

Capture

SDK reads usage receipts

02

Buffer (Outbox)

Durable local write

03

Ship & Ingest

At-least-once, idempotent

04

Price

Versioned, effective-dated

05

Reconcile

Anchor to real invoice

06

Visualize

Cost + outage dashboard

Result 01

Turns a single shared AI invoice into a defensible per-application, per-environment and per-model breakdown — the basis for chargeback, showback and budget governance.

Result 02

Independently audited “kill any component” resilience: an outage or crash of any part costs only data freshness, never accuracy.

Result 03

Surfaces silent, log-only failures — a failing dependency or the app itself — as real-time, de-duplicated incident alerts with an audit trail, from the same integration.

Result 04

Runs at a modest footprint — no message broker, embedded SQLite by default — with a documented, dialect-compatible PostgreSQL scale-out path.

Available for new work

Have a data, analytics, or AI problem worth solving?

From ETL pipelines to cloud warehouses and self-hosted AI, let's scope the work with clear outcomes. I reply within one business day.