Skip to content
reaatech

reaatech/llm-cost-telemetry

0Last commit: Jun 10, 2026GitHub →

These packages give you drop-in wrappers for OpenAI, Anthropic, and Google Generative AI SDKs that automatically capture token usage and cost from every API call, plus a cost calculation engine, multi-tenant aggregation and budget enforcement, OpenTelemetry observability, cloud exporters to CloudWatch/Cloud Monitoring/Loki, an MCP server, and a CLI. You'd adopt them to track, aggregate, and enforce budgets on LLM spend across providers and tenants without building your own cost telemetry pipeline. The packages are designed as independent modules that share common types and schemas, so you can use just the provider wrappers or combine them with the aggregation, budget checking, and export layers as needed.

Packages

8 packages

@reaatech/llm-cost-telemetry

v0.2.0
Core types, Zod schemas, shared utilities, and configuration loaders that serve as the foundation for the `@reaatech/llm-cost-telemetry-*` ecosystem. It exports 40+ domain types (CostSpan, BudgetConfig, TelemetryContext, etc.), 35 Zod schemas for runtime validation, 25 utility functions (ID generation, time window math, cost calculation), and typed configuration loaders, with only `zod` as a runtime dependency.
status
published
published
15 days ago

@reaatech/llm-cost-telemetry-aggregation

v0.1.1
A set of classes (`CostCollector`, `CostAggregator`, `BudgetManager`) for buffering, aggregating by tenant/feature/route/model, and enforcing per-tenant daily/monthly budgets with cascading alert thresholds on LLM cost telemetry spans.
status
published
published
15 days ago

@reaatech/llm-cost-telemetry-calculator

v0.1.1
A function that calculates LLM API costs across OpenAI, Anthropic, and Google models, with built-in pricing tables, cache-aware pricing, token counting, and pre-call cost estimation.
status
published
published
15 days ago

@reaatech/llm-cost-telemetry-cli

v0.2.0
A CLI tool that generates LLM cost reports, checks budget status, and triggers exports to observability platforms (CloudWatch, Cloud Monitoring, Phoenix/Loki) from JSON cost span files or stdin.
status
published
published
15 days ago

@reaatech/llm-cost-telemetry-exporters

v0.1.1
Exporters for pushing LLM cost telemetry to AWS CloudWatch (standard and EMF), GCP Cloud Monitoring, and Grafana Loki/Phoenix, provided as configurable class instances (`CloudWatchExporter`, `CloudMonitoringExporter`, `PhoenixExporter`) that extend a shared `BaseExporter` with batching and retry logic. Requires the respective cloud SDKs (`@aws-sdk/client-cloudwatch`, `@google-cloud/monitoring`) as peer dependencies.
status
published
published
15 days ago

@reaatech/llm-cost-telemetry-mcp

v0.1.1
An MCP server that exposes three layers of LLM cost telemetry tools — atomic span recording, multi-dimensional aggregation, and budget enforcement — consumable by MCP clients like Claude Desktop and Cursor.
status
published
published
15 days ago

@reaatech/llm-cost-telemetry-observability

v0.1.1
A set of OpenTelemetry tracing, metrics, and Pino-based logging managers specifically for tracking LLM API costs, providing classes like `TracingManager`, `MetricsManager`, and a `getLogger()` singleton that automatically record token usage, cost amounts, and PII-redacted logs with Gen AI semantic conventions.
status
published
published
15 days ago

@reaatech/llm-cost-telemetry-providers

v0.1.1
Provides `wrapOpenAI`, `wrapAnthropic`, and `wrapGoogleGenerativeAI` functions that wrap their respective official SDK clients to automatically emit `CostSpan` objects with token usage, timing, and telemetry context from every API call.
status
published
published
15 days ago

Comments

Sign in with GitHub to comment and vote.

Loading comments…