> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fluxrate.co/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Overview

> Integrate usage tracking into your backend with the Fluxrate SDK endpoint.

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:

```bash theme={null}
X-API-Key: org_live_<your_key>
```

Create your key in **Dashboard → API Keys**.

## Endpoints

| Method | Endpoint     | Description                |
| ------ | ------------ | -------------------------- |
| `POST` | `/sdk/track` | Track a single usage event |

## Quick Example

```bash theme={null}
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

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

## Error Codes

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

## Integration Patterns

<CardGroup cols={2}>
  <Card title="Tracking Usage" icon="chart-line" href="/developers/sdk/tracking-usage">
    Detailed guide with code examples in Python, Node.js, and Go.
  </Card>

  <Card title="Aggregation Types" icon="calculator" href="/guide/metering/aggregation-types">
    Choose the right aggregation for your meter type.
  </Card>
</CardGroup>
