What is FluxGate?
FluxGate is an observability and cost-monitoring platform for AI/LLM usage. It lets your backend record every LLM call — tokens consumed, cost incurred, latency, and any custom metadata you attach — and surfaces that data in a real-time dashboard.
It answers questions like:
- "How much does our
code-reviewfeature cost per day?" - "Which of our users is responsible for 40% of our OpenAI bill?"
- "Why did latency spike on Tuesday at 3 AM?"
How it works
Your app → @fluxgate/sdk (or a wrapper) → FluxGate API → Dashboard
- You install a small SDK package — or a provider-specific wrapper (
@fluxgate/openai,@fluxgate/anthropic,@fluxgate/gemini). - The SDK sends a lightweight JSON payload to the FluxGate API after each LLM call. This happens asynchronously and never blocks your response.
- FluxGate stores the event, calculates the cost automatically, and makes the data available on your dashboard immediately.
Key concepts
| Concept | What it is |
|---|---|
| AiEvent | One telemetry record — one LLM call |
| feature | A string tag you attach to group events by product feature (e.g. "chat-assistant") |
| step | An optional sub-label within a feature for multi-step pipelines (e.g. "embed", "rerank") |
| status | The outcome of the call — SUCCESS, ERROR, CONTENT_FILTER, MAX_TOKENS, etc. |
| user | Your app's user ID string, or a full AiEventUser object with name, email, and monthlyRevenue |
| AiEventUser | Rich user identity attached to an event — enables per-user cost and revenue attribution |
Prerequisites
- A FluxGate account — sign up at fluxgate.app
- An API key — generate one under Settings → API Keys
- Node.js ≥ 18
Next steps
- Installation — install the SDK and send your first event
- OpenAI integration — zero-boilerplate tracking for OpenAI
- Anthropic integration — tracking for Claude
- Gemini integration — tracking for Google Gemini