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

# Billing Events

> 
Returns paginated individual billing event records with filters
for endpoint and date range. Each record includes the request ID, timestamp,
endpoint, and output units billed.

**Key Features:**
- Individual billing event records for each API request
- Flexible date range filtering
- Optional endpoint filtering
- Cursor-based pagination for efficient large dataset queries
- Limited to 10000 records per page for performance
- Date range capped at 90 days per request

**Common Use Cases:**
- Audit individual billing events
- Track request patterns and volumes
- Debug specific requests by ID
- Monitor billing unit consumption per request

See [fal.ai docs](https://docs.fal.ai/model-apis/faq) for more details.
    



## OpenAPI

````yaml /api-reference/platform-apis/openapi/v1.json get /models/billing-events
openapi: 3.1.0
info:
  title: Platform APIs
  version: v1
  description: fal REST API for programmatic access to platform resources.
servers:
  - url: https://api.fal.ai/v1
    description: Production server
security: []
paths:
  /models/billing-events:
    get:
      tags:
        - Models
        - Usage
      summary: Billing Events
      description: >-

        Returns paginated individual billing event records with filters

        for endpoint and date range. Each record includes the request ID,
        timestamp,

        endpoint, and output units billed.


        **Key Features:**

        - Individual billing event records for each API request

        - Flexible date range filtering

        - Optional endpoint filtering

        - Cursor-based pagination for efficient large dataset queries

        - Limited to 10000 records per page for performance

        - Date range capped at 90 days per request


        **Common Use Cases:**

        - Audit individual billing events

        - Track request patterns and volumes

        - Debug specific requests by ID

        - Monitor billing unit consumption per request


        See [fal.ai docs](https://docs.fal.ai/model-apis/faq) for more details.
            
      operationId: getBillingEvents
      parameters:
        - schema:
            type: integer
            minimum: 1
            description: >-
              Maximum number of items to return. Actual maximum depends on query
              type and expansion parameters.
            example: 50
          required: false
          description: >-
            Maximum number of items to return. Actual maximum depends on query
            type and expansion parameters.
          name: limit
          in: query
        - schema:
            type: string
            description: Pagination cursor from previous response. Encodes the page number.
            example: Mg==
          required: false
          description: Pagination cursor from previous response. Encodes the page number.
          name: cursor
          in: query
        - schema:
            anyOf:
              - type: string
                format: date-time
              - type: string
                pattern: ^\d{4}-\d{2}-\d{2}$
            description: >-
              Start date in ISO8601 format (e.g., '2025-01-01T00:00:00Z' or
              '2025-01-01'). Defaults to 24 hours ago.
            example: '2025-01-01T00:00:00Z'
          required: false
          description: >-
            Start date in ISO8601 format (e.g., '2025-01-01T00:00:00Z' or
            '2025-01-01'). Defaults to 24 hours ago.
          name: start
          in: query
        - schema:
            anyOf:
              - type: string
                format: date-time
              - type: string
                pattern: ^\d{4}-\d{2}-\d{2}$
            description: >-
              End date in ISO8601 format, exclusive (e.g.,
              '2025-02-01T00:00:00Z' or '2025-02-01'). Data up to but not
              including this timestamp is returned. Defaults to current time.
            example: '2025-02-01T00:00:00Z'
          required: false
          description: >-
            End date in ISO8601 format, exclusive (e.g., '2025-02-01T00:00:00Z'
            or '2025-02-01'). Data up to but not including this timestamp is
            returned. Defaults to current time.
          name: end
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: >-
              Filter by specific endpoint ID(s). Accepts 1-50 endpoint IDs.
              Supports comma-separated values: ?endpoint_id=model1,model2 or
              array syntax: ?endpoint_id=model1&endpoint_id=model2
            example:
              - fal-ai/flux/dev
          required: false
          description: >-
            Filter by specific endpoint ID(s). Accepts 1-50 endpoint IDs.
            Supports comma-separated values: ?endpoint_id=model1,model2 or array
            syntax: ?endpoint_id=model1&endpoint_id=model2
          name: endpoint_id
          style: form
          explode: true
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: >-
              Filter by specific request ID(s). Accepts 1-50 request IDs.
              Supports comma-separated values: ?request_id=req1,req2 or array
              syntax: ?request_id=req1&request_id=req2
            example:
              - req-abc123
          required: false
          description: >-
            Filter by specific request ID(s). Accepts 1-50 request IDs. Supports
            comma-separated values: ?request_id=req1,req2 or array syntax:
            ?request_id=req1&request_id=req2
          name: request_id
          style: form
          explode: true
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: >-
              Data to include in the response. Use 'auth_method' to include
              authentication method information (formatted with user key
              aliases).
            example: auth_method
          required: false
          description: >-
            Data to include in the response. Use 'auth_method' to include
            authentication method information (formatted with user key aliases).
          name: expand
          style: form
          explode: true
          in: query
      responses:
        '200':
          description: Billing event data retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Cursor for the next page of results, null if no more pages
                  has_more:
                    type: boolean
                    description: >-
                      Boolean indicating if more results are available
                      (convenience field derived from next_cursor)
                  billing_events:
                    type: array
                    items:
                      type: object
                      properties:
                        request_id:
                          type: string
                          description: Unique identifier for the request
                        endpoint_id:
                          type: string
                          description: >-
                            Endpoint identifier that was used (e.g.,
                            'fal-ai/flux/dev')
                        timestamp:
                          type: string
                          description: Request timestamp in ISO8601 format
                        output_units:
                          type:
                            - number
                            - 'null'
                          minimum: 0
                          description: Custom billing units for this request
                        unit_price:
                          type:
                            - number
                            - 'null'
                          minimum: 0
                          description: Unit price for this request
                        percent_discount:
                          type:
                            - number
                            - 'null'
                          description: >-
                            Discount percentage applied to this request (e.g.,
                            10 = 10% discount)
                        cost_estimate_nano_usd:
                          type: number
                          minimum: 0
                          description: >-
                            Estimated cost in nano USD (1 USD = 1,000,000,000
                            nano USD)
                        auth_method:
                          type: string
                          description: >-
                            Authentication method label (e.g., 'Key 1', 'API
                            Key', 'User token'). Only populated when
                            'auth_method' is included in expand parameter.
                      required:
                        - request_id
                        - endpoint_id
                        - timestamp
                        - output_units
                        - unit_price
                        - percent_discount
                        - cost_estimate_nano_usd
                      description: Individual billing event record with details
                    description: List of billing event records
                required:
                  - next_cursor
                  - has_more
                  - billing_events
                description: Response containing billing event data with pagination support
              example:
                billing_events:
                  - request_id: abc123
                    endpoint_id: fal-ai/flux/dev
                    timestamp: '2025-01-15T10:30:45Z'
                    output_units: 1.5
                    unit_price: 0.001
                    percent_discount: null
                    cost_estimate_nano_usd: 1500000
                  - request_id: def456
                    endpoint_id: fal-ai/flux/dev
                    timestamp: '2025-01-15T10:25:30Z'
                    output_units: 2
                    unit_price: 0.001
                    percent_discount: 10
                    cost_estimate_nano_usd: 1800000
                next_cursor: MjAyNS0wMS0xNVQxMDoyNTozMFo=
                has_more: true
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - authorization_error
                          - validation_error
                          - not_found
                          - rate_limited
                          - server_error
                          - not_implemented
                        description: The category of error that occurred
                      message:
                        type: string
                        description: Human-readable error message
                      docs_url:
                        type: string
                        format: uri
                        description: Link to relevant documentation
                      request_id:
                        type: string
                        description: Unique request identifier for debugging
                    required:
                      - type
                      - message
                    description: Error details
                required:
                  - error
                description: Standard error response format
              example:
                error:
                  type: validation_error
                  message: Invalid request parameters
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - authorization_error
                          - validation_error
                          - not_found
                          - rate_limited
                          - server_error
                          - not_implemented
                        description: The category of error that occurred
                      message:
                        type: string
                        description: Human-readable error message
                      docs_url:
                        type: string
                        format: uri
                        description: Link to relevant documentation
                      request_id:
                        type: string
                        description: Unique request identifier for debugging
                    required:
                      - type
                      - message
                    description: Error details
                required:
                  - error
                description: Standard error response format
              example:
                error:
                  type: authorization_error
                  message: Authentication required
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - authorization_error
                          - validation_error
                          - not_found
                          - rate_limited
                          - server_error
                          - not_implemented
                        description: The category of error that occurred
                      message:
                        type: string
                        description: Human-readable error message
                      docs_url:
                        type: string
                        format: uri
                        description: Link to relevant documentation
                      request_id:
                        type: string
                        description: Unique request identifier for debugging
                    required:
                      - type
                      - message
                    description: Error details
                required:
                  - error
                description: Standard error response format
              example:
                error:
                  type: authorization_error
                  message: Access denied
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - authorization_error
                          - validation_error
                          - not_found
                          - rate_limited
                          - server_error
                          - not_implemented
                        description: The category of error that occurred
                      message:
                        type: string
                        description: Human-readable error message
                      docs_url:
                        type: string
                        format: uri
                        description: Link to relevant documentation
                      request_id:
                        type: string
                        description: Unique request identifier for debugging
                    required:
                      - type
                      - message
                    description: Error details
                required:
                  - error
                description: Standard error response format
              example:
                error:
                  type: not_found
                  message: Resource not found
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - authorization_error
                          - validation_error
                          - not_found
                          - rate_limited
                          - server_error
                          - not_implemented
                        description: The category of error that occurred
                      message:
                        type: string
                        description: Human-readable error message
                      docs_url:
                        type: string
                        format: uri
                        description: Link to relevant documentation
                      request_id:
                        type: string
                        description: Unique request identifier for debugging
                    required:
                      - type
                      - message
                    description: Error details
                required:
                  - error
                description: Standard error response format
              example:
                error:
                  type: rate_limited
                  message: Rate limit exceeded
      security:
        - adminApiKey: []
components:
  securitySchemes:
    adminApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Admin API key must be prefixed with "Key ", e.g. Authorization: Key
        YOUR_ADMIN_API_KEY

````