Token & Activity Analytics
Track what every provider call costs - LLM or not - by feature, operation, tenant and piece.
Vertical: Analytics · Status: ✅ Live Back to Analytics · workflows index
Trigger
Written on every outbound call the backend makes; read from the platform admin dashboard and the monitor console.
Flow
provider call, wrapped by observeProviderCall { provider, operation }
|
duration + outcome observed - a failure raises a provider_error event
|
usage record { feature, operation, tenantId, pipeline, contentId, units or tokens }
|
priced at read time from a dated price table (operator-editable)
|
admin dashboard: activity + token analytics by feature/operation
monitor console: Integrations - AI & providers - Unit economics
What is attributed today
| Kind | Examples |
|---|---|
| LLM calls | feed enrichment and query generation, compliance review and learning, blog draft / repair / refine, scripts and hooks, campaign copy / plan / studio turns, video scene scripts, source profiling |
| Images and video | gpt-image generations and edits (priced per size and quality), Higgsfield frames and clips, Ideogram layerization (counted, unpriced until a rate is set) |
| Scraping and search | Apify (the provider's own run charge when it reports one), Tavily credits, GNews, NewsAPI |
| Detection and keywords | ZeroGPT calls, Semrush units, AnswerThePublic searches |
| Everything else outbound | moderation, Instagram Graph, the CMS adapter - timed and failure-ledgered, whether or not they cost money |
A record carries the pipeline and the piece it belongs to, so every retry, repair, humanization pass and later refinement bills to the same blog, script or creative. That is what lets unit economics answer what one finished piece cost, per tenant, per provider and per day.
Agents involved
All five built agents write usage records, and so does every non-agent integration - the adapter records its own spend, pinned by an architecture test that lists the exemptions exactly.
Gaps
Operator-facing only. The monitor console has a tenant picker and a per-tenant split, but a tenant cannot see their own consumption from the console they use.
Roadmap source
Deliverable ⑤ (page 5), partially — see roadmap_ref_extracted.md.