We're in development! Things may crash or break

Introduction

Getting Started

What FluxGate is, how it works, and what you need before writing your first line of code.

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-review feature 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
  1. You install a small SDK package — or a provider-specific wrapper (@fluxgate/openai, @fluxgate/anthropic, @fluxgate/gemini).
  2. The SDK sends a lightweight JSON payload to the FluxGate API after each LLM call. This happens asynchronously and never blocks your response.
  3. FluxGate stores the event, calculates the cost automatically, and makes the data available on your dashboard immediately.

Key concepts

ConceptWhat it is
AiEventOne telemetry record — one LLM call
featureA string tag you attach to group events by product feature (e.g. "chat-assistant")
stepAn optional sub-label within a feature for multi-step pipelines (e.g. "embed", "rerank")
statusThe outcome of the call — SUCCESS, ERROR, CONTENT_FILTER, MAX_TOKENS, etc.
userYour app's user ID string, or a full AiEventUser object with name, email, and monthlyRevenue
AiEventUserRich 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