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

# Analytics definitions

> Metric definitions and time bases, dimensions, filters, limits, and the earliest charge on the account
(`available_from`). Use it to discover what the other analytics endpoints accept.




## OpenAPI

````yaml /openapi.yaml get /analytics/meta
openapi: 3.1.0
info:
  title: varg API
  version: 2.0.0
  description: |
    Unified REST API for AI media generation at `api.varg.ai/v2`.

    One API key, ~80 models across 8 providers, async jobs, stable output URLs
    on `s3.varg.ai`, files with lineage, and transparent credit billing
    (1 credit = 1 cent = $0.01).

    **The async job pattern:** every generation request returns `202 Accepted`
    with a job object (`status: queued`). Poll `GET /jobs/{id}` until the job
    reaches a terminal status (`completed`, `failed`, or `cancelled`), then read
    `output.outputs[0].url`. Alternatively, set `options.webhook_url` in the
    request to receive an HMAC-signed callback when the job finishes.
servers:
  - url: https://api.varg.ai/v2
security:
  - bearerAuth: []
tags:
  - name: Generation
    description: >-
      Create generation jobs (image, video, speech, music, transcription,
      ffmpeg, render, pipeline)
  - name: Tools
    description: Discover tools, their schemas, and call any tool generically
  - name: Jobs
    description: Poll and manage job lifecycle
  - name: Files
    description: Upload, import, probe, and manage files
  - name: Folders
    description: Group files into folders and file generated output automatically
  - name: Lineage
    description: Resolve which job produced a file
  - name: Presets
    description: Browse and apply reusable parameter values — voices, styles
  - name: Templates
    description: Browse, publish, use and render community templates
  - name: Pricing
    description: Estimate costs and browse the price catalog
  - name: Billing
    description: Balance, usage, and transaction history
  - name: Analytics
    description: >-
      Spend, runs and files over time — summaries, time series, breakdowns,
      activity
  - name: Account
    description: Identity and API key management
paths:
  /analytics/meta:
    get:
      tags:
        - Analytics
      summary: Analytics definitions
      description: >
        Metric definitions and time bases, dimensions, filters, limits, and the
        earliest charge on the account

        (`available_from`). Use it to discover what the other analytics
        endpoints accept.
      operationId: getAnalyticsMeta
      responses:
        '200':
          description: Result envelope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsMetaResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          description: Analytics is temporarily unavailable (`analytics_unavailable`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AnalyticsMetaResponse:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: '#/components/schemas/AnalyticsMetaData'
        meta:
          $ref: '#/components/schemas/AnalyticsMeta'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: model_not_found
            message:
              type: string
              example: 'Unknown model: flux-shnell'
            details: {}
    AnalyticsMetaData:
      type: object
      properties:
        available_from:
          type:
            - string
            - 'null'
          format: date-time
          description: Time of the account's earliest charge.
        metrics:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              unit:
                type: string
              time_basis:
                type: string
              description:
                type: string
        dimensions:
          type: array
          items:
            type: object
            properties:
              key:
                $ref: '#/components/schemas/AnalyticsDimension'
              label:
                type: string
              filter_param:
                type: string
              description:
                type: string
              values:
                type: object
                description: Allowed values and labels (source and status only).
                additionalProperties:
                  type: string
        special_keys:
          type: object
          additionalProperties:
            type: string
        bucket_widths:
          type: array
          items:
            type: string
        limits:
          type: object
          additionalProperties:
            type: integer
        range:
          type: string
    AnalyticsMeta:
      type: object
      description: Metadata describing how the numbers were computed.
      required:
        - definition_version
        - data_as_of
        - money_unit
        - time_basis
        - attribution_scope
      properties:
        definition_version:
          type: string
          description: Changes whenever a metric's meaning changes.
          example: '2026-09-28'
        from:
          type: string
          format: date-time
          description: Resolved range start (inclusive).
        to:
          type: string
          format: date-time
          description: Resolved range end (exclusive).
        timezone:
          type: string
          example: UTC
        compare:
          type:
            - object
            - 'null'
          description: The comparison period, or null when none.
          properties:
            from:
              type: string
              format: date-time
            to:
              type: string
              format: date-time
        filters:
          type: object
          description: Filters applied, keyed by query parameter name.
          additionalProperties:
            type: array
            items:
              type: string
        data_as_of:
          type: string
          format: date-time
        money_unit:
          type: string
          enum:
            - cent
          description: Amounts are whole credits, in fields ending in `_cents`.
        time_basis:
          type: string
          enum:
            - posted_at
            - lifetime
            - created_at
          description: >-
            `posted_at` = when the ledger charge was posted; `created_at` = when
            a file was made.
        attribution_scope:
          type: string
          enum:
            - full
            - self
          description: '`self` means identity dimensions show only the caller''s own values.'
    AnalyticsDimension:
      type: string
      enum:
        - tool
        - model
        - workspace
        - api_key
        - member
        - creator
        - source
        - status
      description: A dimension spend can be grouped or filtered by.
  responses:
    Unauthorized:
      description: Missing or invalid API key / JWT
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unauthorized:
              value:
                error:
                  code: unauthorized
                  message: Invalid or missing API key or JWT
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        varg API key (`varg_...`). Get one at [app.varg.ai](https://app.varg.ai)
        or run `bunx vargai login`. App sessions may alternatively send a
        Supabase JWT.

````

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