Lago Open-source SDK: Bill on top of your LLM token cost with no middleware Lago released an open-source SDK that wraps existing LLM clients to automatically extract token usage data and send it to Lago's billing platform without requiring middleware or API changes. The SDK supports AWS Bedrock and Mistral providers with p99 overhead under 5 milliseconds, buffering usage events in memory and flushing them in batches while surviving provider or Lago outages through exponential backoff. The tool enables developers to bill customers based on LLM token consumption by attaching subscription IDs per call, per context, or as a default fallback. Instrument LLM clients and emit usage events to Lago https://www.getlago.com for billing. ┌──────────────┐ your code ──────► │ wrapped client│ ──► provider Bedrock / Mistral / … └──────┬───────┘ │ extract usage ▼ ┌──────────────┐ │ Lago events │ ──► api.getlago.com └──────────────┘ - Wraps your existing LLM client in place — no API surface change for your application code. - Extracts usage from each response into a normalized shape CanonicalUsage . - Buffers events in memory, flushes them in batches to Lago's /events/batch endpoint. - Survives provider/Lago outages with exponential backoff and a bounded buffer. - p99 wrap-overhead under 5 ms — your call is never blocked on Lago. pip install lago-agent-sdk For Bedrock support: pip install 'lago-agent-sdk bedrock ' adds boto3 . For Mistral support: pip install 'lago-agent-sdk mistral ' adds mistralai . python import boto3 from lago agent sdk import LagoSDK sdk = LagoSDK api key="