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

# Get usage

> Returns usage records for the specified date range.



## OpenAPI

````yaml /openapi.yaml get /usage
openapi: 3.1.0
info:
  title: Varg Gateway API
  version: 0.1.0
  description: >-
    Unified REST API for AI generation (video, image, speech, music) at
    api.varg.ai
servers:
  - url: https://api.varg.ai/v1
security:
  - bearerAuth: []
tags:
  - name: Generation
    description: Create AI-generated content
  - name: Jobs
    description: Manage and monitor generation jobs
  - name: Files
    description: Upload files for use in generation
  - name: Reference
    description: Available models and voices
  - name: Media Processing
    description: FFmpeg-powered video utilities (trim, resize, probe, custom commands)
  - name: Account
    description: Account info, balance, and usage
paths:
  /usage:
    get:
      tags:
        - Account
      summary: Get usage
      description: Returns usage records for the specified date range.
      operationId: getUsage
      parameters:
        - name: from
          in: query
          required: false
          schema:
            type: string
            format: date
          description: Start date (inclusive), e.g. 2026-01-01
          example: '2026-01-01'
        - name: to
          in: query
          required: false
          schema:
            type: string
            format: date
          description: End date (inclusive), e.g. 2026-01-31
          example: '2026-01-31'
      responses:
        '200':
          description: Usage records
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponse'
        '401':
          $ref: '#/components/responses/AuthError'
components:
  schemas:
    UsageResponse:
      type: object
      properties:
        usage:
          type: array
          items:
            $ref: '#/components/schemas/UsageRecord'
        total_cents:
          type: number
          description: Total cost in cents for the period
          example: 1250
    UsageRecord:
      type: object
      properties:
        job_id:
          type: string
          example: job_a1b2c3d4
        model:
          type: string
          example: fal:kling-v2.5
        capability:
          type: string
          enum:
            - video
            - image
            - speech
            - music
            - transcription
          example: video
        cost_cents:
          type: number
          description: Cost in cents
          example: 25
        cache_hit:
          type: boolean
          example: false
        created_at:
          type: string
          format: date-time
          example: '2026-02-13T10:00:00Z'
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Error code
          example: ValidationError
        message:
          type: string
          description: Human-readable error description
          example: prompt is required
        field:
          type: string
          description: The field that caused the error, if applicable
          example: prompt
        provider:
          type: string
          description: The upstream provider that returned the error, if applicable
          example: fal
        statusCode:
          type: number
          description: HTTP status code
          example: 400
  responses:
    AuthError:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: AuthError
            message: Invalid API key
            statusCode: 401
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: varg_xxx
      description: |
        API key from [varg.ai/dashboard](https://varg.ai/dashboard).

        Pass as `Authorization: Bearer varg_xxx`.

````