OVERHEAD
<1MS
PROMPT STORED
NONE
LICENSE
APACHE-2.1

Wrap the client you already have. Every completion that resolves is metered, priced and attributed — by model, by API key, by tenant, by feature — and lands on the dashboard within seconds. Cache reads and writes are billed at their own rates rather than folded in, because the cheap tokens are usually the loud ones
BATCH WINDOW
5 S / 20 EVENTS
INGEST BODY
1–100 EVENTS
MONEY UNIT
MICRO-USD, INT
PRICE SYNC
DAILY 06:00 UTC
Everything needed to integrate spendgraph: two minutes for the SDK, or plain HTTP if you prefer.
01 / BREAKDOWN
Provider dashboards give you one number a month. SpendGraph converts raw token usage into costs and slices it along the dimensions your team actually argues about.
BY MODEL
See which model quietly became your biggest line item.
BY FEATURE
Attribute spend to the product surface that generated it.
BY TENANT
Per-customer cost of goods, ready for margin analysis.
BY API KEY
Isolate environments, jobs, agents and rogue scripts.
BY REQUEST
Drill into a single event: tokens in, tokens out, dollars.
BY PERIOD
Hour, day, month — with drift against last period.
02 / SDK REFERANCE
Token accounting including cache reads and cache writes, priced per model and rolled up into a number you can put in front of a finance team.
Cost is computed at ingest against the newest published price and stored as an integer count of micro-USD — so the statement above is arithmetic, not an estimate.
03 / WIRE IT UP
Auto-instrument the SDKs you already use, or record usage manually when you own the transport. The collector batches, retries and never blocks a response.
APP/OPENAI.TS
import { spendgraph } from "@spendgraph/sdk";
// wrap the client you already have
const openai = spendgraph.instrument(new OpenAI(), {
feature: "support-triage",
tenant: user.orgId, });
await openai.chat.completions.create({ ... });
// -> usage, cache tokens and cost recorded async
AUTO-INSTRUMENTATION
OpenAI, Anthropic, Gemini, Bedrock, Vercel AI SDK.
MANUAL EVENTS
POST a usage event from any language or runtime.
BUDGETS & ALERTS
Thresholds per feature, tenant or key — Slack or webhook.
04 /PRIVECY
Auto-instrument the SDKs you already use, or record usage manually when you own the transport. The collector batches, retries and never blocks a response.
SELF-HOSTED
Runs in your own account. One container, one Postgres.
METADATA ONLY
Token counts and model metadata — never your prompts.
FAIL-OPEN
If SpendGraph is down, your requests still ship.
NON-BLOCKING
nstrumentation batches off the hot path. Sub-ms overhead.
OPEN SOURCE
Apache-2.0. Read every line that touches your traffic
NO LOCK-IN
Plain SQL schema. Export or query it yourself.
Meter everything
SELF-HOST IN 5 MINS
SEE THE BREAKDOWN
