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

# Create Balance

> Create a balance for a customer feature.

### Body Parameters

The ID of the customer.

The ID of the feature.

The ID of the entity for entity-scoped balances (e.g., per-seat limits).

The initial balance amount to grant. For metered features, this is the number of units the customer can use.

If true, the balance has unlimited usage. Cannot be combined with 'included\_grant'.

Reset configuration for the balance. If not provided, the balance is a one-time grant that never resets.

**properties**

The interval at which the balance resets (e.g., 'month', 'day', 'year').

Number of intervals between resets. Defaults to 1 (e.g., interval\_count: 2 with interval: 'month' resets every 2 months).

Rollover configuration for the balance.

**properties**

Unix timestamp (milliseconds) when the balance expires. Mutually exclusive with reset.

Unix timestamp (milliseconds) for the first reset boundary, allowing a custom (e.g. shorter) first period. Requires 'reset', and must occur before 'expires\_at' if both are provided. Subsequent resets advance by one reset interval from this boundary.

A unique identifier for this balance. Use this to target the balance in future update / delete calls.

### Response


## OpenAPI

````yaml openapi POST /v1/balances.create
openapi: 3.1.0
info:
  title: Autumn API
  version: 2.6.0
servers:
  - url: https://api.useautumn.com
    description: Production server
security:
  - secretKey: []
paths:
  /v1/balances.create:
    post:
      tags:
        - balances
      description: Create a balance for a customer feature.
      operationId: createBalance
      parameters:
        - name: x-api-version
          in: header
          required: true
          schema:
            type: string
            default: 2.6.0
          x-speakeasy-globals-hidden: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                customer_id:
                  type: string
                  description: The ID of the customer.
                feature_id:
                  type: string
                  description: The ID of the feature.
                entity_id:
                  type: string
                  description: >-
                    The ID of the entity for entity-scoped balances (e.g.,
                    per-seat limits).
                included_grant:
                  type: number
                  description: >-
                    The initial balance amount to grant. For metered features,
                    this is the number of units the customer can use.
                unlimited:
                  type: boolean
                  description: >-
                    If true, the balance has unlimited usage. Cannot be combined
                    with 'included_grant'.
                reset:
                  type: object
                  properties:
                    interval:
                      enum:
                        - one_off
                        - minute
                        - hour
                        - day
                        - week
                        - month
                        - quarter
                        - semi_annual
                        - year
                      type: string
                      description: >-
                        The interval at which the balance resets (e.g., 'month',
                        'day', 'year').
                    interval_count:
                      type: number
                      description: >-
                        Number of intervals between resets. Defaults to 1 (e.g.,
                        interval_count: 2 with interval: 'month' resets every 2
                        months).
                  required:
                    - interval
                  description: >-
                    Reset configuration for the balance. If not provided, the
                    balance is a one-time grant that never resets.
                rollover:
                  type: object
                  properties:
                    max:
                      anyOf:
                        - type: number
                        - type: 'null'
                    max_percentage:
                      anyOf:
                        - type: number
                        - type: 'null'
                    duration:
                      enum:
                        - month
                        - forever
                      type: string
                      default: month
                    length:
                      type: number
                  required:
                    - length
                  description: Rollover configuration for the balance.
                expires_at:
                  type: number
                  description: >-
                    Unix timestamp (milliseconds) when the balance expires.
                    Mutually exclusive with reset.
                next_reset_at:
                  type: number
                  description: >-
                    Unix timestamp (milliseconds) for the first reset boundary,
                    allowing a custom (e.g. shorter) first period. Requires
                    'reset', and must occur before 'expires_at' if both are
                    provided. Subsequent resets advance by one reset interval
                    from this boundary.
                balance_id:
                  type: string
                  description: >-
                    A unique identifier for this balance. Use this to target the
                    balance in future update / delete calls.
              required:
                - customer_id
                - feature_id
              title: CreateBalanceParams
              examples:
                - customer_id: cus_123
                  feature_id: api_calls
                  included: 1000
                  reset:
                    interval: month
            example:
              customer_id: cus_123
              feature_id: api_calls
              included: 1000
              reset:
                interval: month
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                required:
                  - success
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Autumn } from 'autumn-js'

            const autumn = new Autumn()

            const result = await autumn.balances.create({
              customerId: "cus_123",
              featureId: "api_calls",
              reset: {
                interval: "month",
              },
            });
        - lang: python
          label: Python (SDK)
          source: |-
            from autumn_sdk import Autumn

            autumn = Autumn(secret_key="am_sk_test...")

            res = autumn.balances.create(
                customer_id="cus_123",
                feature_id="api_calls",
                reset={
                    "interval": "month",
                },
            )
components:
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.