Docs / Overview

Build AI billing without token chaos

Install the SDK, meter AI events, sync Stripe top-ups, and ship a credit-first billing flow fast.

terminal
$ npm install @chargly/sdk

Start here

Shortest path for new developers.

  1. 1

    Install the SDK

    npm install @chargly/sdk

  2. 2

    Initialize Chargly

    new Chargly({ apiKey })

  3. 3

    Meter your first event

    chargly.meterEvent({ customerId, event, credits })

Full quickstart guide

Documentation index

Core concepts

Credits

Units users buy and spend on AI actions.

Wallets

Per-user balances updated in real time.

Usage Events

Billable AI actions like chat.reply or image.generate.

Pricing Rules

Credit costs per event. Versioned when Pricing Advisor recommendations are applied.

Top-ups

Stripe-powered purchases that add credits to wallets.

Quickstart preview

Minimal code sample. See full quickstart for details.

Install

terminal
$ npm install @chargly/sdk

Meter event

app.js
await chargly.meterEvent({
  customerId: "user_123",
  event: "image.generate",
  credits: 40
})
View full Quickstart