Skip to main content
The Fluxrate SDK endpoint provides a simple, reliable way to track usage events from your backend. It’s designed to work from any language or framework.

Base URL

https://api.fluxrate.co/api/v1/sdk

Authentication

Use an API key with usage.write scope:
X-API-Key: org_live_<your_key>
Create your key in Dashboard → API Keys.

Endpoints

MethodEndpointDescription
POST/sdk/trackTrack a single usage event

Quick Example

curl -X POST https://api.fluxrate.co/api/v1/sdk/track \
  -H "Content-Type: application/json" \
  -H "X-API-Key: org_live_<your_key>" \
  -d '{
    "meter_token": "550e8400-e29b-41d4-a716-446655440000",
    "customer_external_id": "your-customer-id",
    "quantity": 1
  }'

What Happens

  1. Fluxrate looks up the meter by meter_token
  2. Resolves the customer by customer_external_id (creates if new)
  3. Stores the usage event in the database
  4. Returns the created event record

Response

{
  "id": "...",
  "customer_id": "...",
  "meter_id": "...",
  "quantity": "1",
  "timestamp": "2025-01-15T10:30:00Z",
  "created_at": "2025-01-15T10:30:01Z",
  "meta_data": {}
}

Error Codes

StatusMeaning
201Event tracked successfully
400Bad request — check your payload
401Invalid or missing API key
403API key missing usage.write scope
404Meter or customer not found

Integration Patterns

Tracking Usage

Detailed guide with code examples in Python, Node.js, and Go.

Aggregation Types

Choose the right aggregation for your meter type.