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 cost using its live ModelPricing table, 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
userYour app's user ID (or a full TrackedUser object with name/email/MRR)
OrganizationMulti-tenant workspace — one account can hold multiple orgs
ModelPricingServer-side table of per-token costs, updated when providers change prices

Prerequisites

  • A FluxGate account — sign up at fluxgate.app
  • An API key — generate one under Settings → API Keys
  • Node.js ≥ 18

Next steps