> ## 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.

# Quickstart

> Track your first usage event and generate an invoice in under 10 minutes.

<Steps>
  <Step title="Create a Meter Feature">
    A **meter** defines what usage you want to track.  Create your first meter feature through Dashboard or use the API.

    <Tabs>
      <Tab title="Dashboard">
        1. Go to **Dashboard > Features**
        2. Select **Meter** feature
        3. Define the Meter, Type, Unit and Aggregation
        4. Add Filters (Optional)

        <Note>
          Note the `meter_name` from the feature info page, you'll need it to send usage events.
        </Note>
      </Tab>

      <Tab title="API">
        ```bash wrap theme={null}
        curl -X POST https://api.fluxrate.com/api/v1/usage \
          -H 'Content-Type: application/json' \
          -H 'x-api-key: <YOUR API KEY>' \
          -d '{
            "customer_external_id": "<CUSTOMER_UUID>",
            "meter_name": "mtr_name",
            "timestamp": "2026-01-03T12:00:00Z",
            "idempotency_key": "evt_unique_12345",
            "properties": {
              "property_name": 10,
              "filter_value": "String"
            }
          }'
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Create a Plan">
    Plans define what customers pay and entitlements. Create a **usage-based plan** that charges per API call:

    <Tabs>
      <Tab title="Dashboard">
        1. Go to **Dashboard > Plans**
        2. Create Plan and define the Charges and Features
        3. Charges have 2 options Recurring (Fixed charges) and Usage based charges
        4. Set the charge in different duration with various currency
        5. Features are where you define the plan\*\* entitlements\*\*
      </Tab>

      <Tab title="API">
        ```bash wrap theme={null}
        curl -X POST https://api.fluxrate.co/api/v1/plans \
          -H "Content-Type: application/json" \
          -H "Cookie: access_token=<your_token>" \
          -d '{
            "name": "Starter",
            "lookup_id": "starter",
            "type": "USAGE",
            "billing_interval": "month",
            "currency": "USD"
          }'
        ```

        Define the charges:

        ```bash wrap theme={null}
        curl -X POST https://api.fluxrate.co/api/v1/plans/<plan_id>/charges \
          -H "Content-Type: application/json" \
          -H "Cookie: access_token=<your_token>" \
          -d '{
            "type": "USAGE",
            "meter_id": "<your_meter_id>",
            "unit_price": 0.001,
            "display_name": "API Call Charge"
          }'
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Create a Customer">
    Here you manage you customer and see their usage and current subscription.

    <Tabs>
      <Tab title="Dashboard">
        1. Go to **Dashboard > Customers**
        2. Create customer with basic information
        3. Use our SDK for realtime customer sync
      </Tab>

      <Tab title="API">
        ```bash wrap theme={null}
        curl -X POST https://api.fluxrate.co/api/v1/customers \
          -H "Content-Type: application/json" \
          -H "Cookie: access_token=<your_token>" \
          -d '{
            "name": "Acme Corp",
            "email": "billing@acme.com",
            "external_id": "acme-corp-001"
          }'
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Subscribe the Customer">
    In the subscriptions you can assign the plan to selected customer.

    <Tabs>
      <Tab title="Dashboard">
        1. Go to **Dashboard > Subscriptions**
        2. Select the Customer and Plan
        3. Set the Subscription Duration and Trial period (Optional)
      </Tab>

      <Tab title="API">
        ```bash wrap theme={null}
        curl -X POST https://api.fluxrate.co/api/v1/subscriptions \
          -H "Content-Type: application/json" \
          -H "Cookie: access_token=<your_token>" \
          -d '{
            "customer_id": "<customer_id>",
            "plan_id": "<plan_id>",
            "billing_interval": "month",
            "start_date": "2025-01-01T00:00:00Z"
          }'
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Generate an API Key">
    1. Go to **Dashboard > API Keys**
    2. Create a key with  scope (write, read or both)
    3. **Copy the API keys** - it is shown only once and store it in secured place
  </Step>

  <Step title="Send Usage Events">
    Send usage events from your backend using the API or SDK.

    Verify Event on **Dashboard > Usage log**

    ```shellscript theme={null}
    curl -X POST https://api.fluxrate.com/api/v1/usage \
      -H 'Content-Type: application/json' \
      -H 'x-api-key: <YOUR API KEY>' \
      -d '{
        "customer_external_id": "<CUSTOMER_UUID>",
        "meter_name": "mtr_name",
        "timestamp": "2026-01-03T12:00:00Z",
        "idempotency_key": "evt_unique_12345",
        "properties": {
          "property_name": 10,
          "filter_value": "String"
        }
      }'
    ```

    <Tip>
      Always pass an `idempotency_key` to prevent duplicate events if your request retries.
    </Tip>
  </Step>

  <Step title="You're Billing Infra is Ready 🎉" />
</Steps>

<CardGroup cols={3} />
