Skip to content
Docs

    List Usage Records

    GET/v1/usage

    List per-resource usage records for the current organization. Each item is one resource with its nested dimension history (active and closed segments).

    Query ParametersExpand Collapse
    active_at_max: optional string

    Only resources metered at or before this RFC 3339 instant

    formatdate-time
    active_at_min: optional string

    Only resources metered at or after this RFC 3339 instant; a window a usage row must overlap

    formatdate-time
    cursor: optional string

    Pagination cursor returned by a previous request. Only valid for the same filters and sort order.

    dimension: optional string

    Only resources with usage in this dimension

    limit: optional number

    Maximum number of items to return

    maximum100
    minimum10
    region: optional string

    Filter by region

    resource_id: optional string

    Filter by a single resource

    resource_type: optional "vm" or "volume" or "vpc" or 4 more

    Filter by the kind of resource metered

    One of the following:
    "vm"
    "volume"
    "vpc"
    "connect_connection"
    "nks_cluster"
    "nks_node_pool"
    "nks_load_balancer"
    sort: optional string

    Sort term as field:asc or field:desc. Field: created_at, the resource’s earliest usage row matching the filters

    ReturnsExpand Collapse
    UsageList object { items, pagination }
    items: array of Usage { dimensions, ended_at, project_id, 4 more }
    dimensions: array of UsageDimension { id, dimension, ended_at, 3 more }
    id: string
    dimension: string
    ended_at: string
    quantity: number
    started_at: string
    children: optional array of UsageDimensionLeaf { id, dimension, ended_at, 2 more }
    id: string
    dimension: string
    ended_at: string
    quantity: number
    started_at: string
    ended_at: string
    project_id: string
    region: RegionName

    Region the resource is in.

    resource_id: string
    resource_type: UsageResourceType

    Kind of metered resource a ledger row belongs to.

    One of the following:
    "vm"
    "volume"
    "vpc"
    "connect_connection"
    "nks_cluster"
    "nks_node_pool"
    "nks_load_balancer"
    started_at: string

    List Usage Records

    curl https://api.nirvanalabs.io/v1/usage \
        -H "Authorization: Bearer $NIRVANA_LABS_API_KEY"
    {
      "items": [
        {
          "dimensions": [
            {
              "id": "123e4567-e89b-12d3-a456-426614174000",
              "dimension": "compute_n1_standard_8",
              "ended_at": "2026-02-01T00:00:00Z",
              "quantity": 1,
              "started_at": "2026-01-01T00:00:00Z",
              "children": [
                {
                  "id": "123e4567-e89b-12d3-a456-426614174000",
                  "dimension": "compute_vcpu",
                  "ended_at": "2026-02-01T00:00:00Z",
                  "quantity": 2,
                  "started_at": "2026-01-01T00:00:00Z"
                }
              ]
            }
          ],
          "ended_at": "2026-02-01T00:00:00Z",
          "project_id": "123e4567-e89b-12d3-a456-426614174000",
          "region": "us-sva-2",
          "resource_id": "123e4567-e89b-12d3-a456-426614174000",
          "resource_type": "vm",
          "started_at": "2026-01-01T00:00:00Z"
        }
      ],
      "pagination": {
        "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
        "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
        "total_count": 125
      }
    }
    Returns Examples
    {
      "items": [
        {
          "dimensions": [
            {
              "id": "123e4567-e89b-12d3-a456-426614174000",
              "dimension": "compute_n1_standard_8",
              "ended_at": "2026-02-01T00:00:00Z",
              "quantity": 1,
              "started_at": "2026-01-01T00:00:00Z",
              "children": [
                {
                  "id": "123e4567-e89b-12d3-a456-426614174000",
                  "dimension": "compute_vcpu",
                  "ended_at": "2026-02-01T00:00:00Z",
                  "quantity": 2,
                  "started_at": "2026-01-01T00:00:00Z"
                }
              ]
            }
          ],
          "ended_at": "2026-02-01T00:00:00Z",
          "project_id": "123e4567-e89b-12d3-a456-426614174000",
          "region": "us-sva-2",
          "resource_id": "123e4567-e89b-12d3-a456-426614174000",
          "resource_type": "vm",
          "started_at": "2026-01-01T00:00:00Z"
        }
      ],
      "pagination": {
        "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
        "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
        "total_count": 125
      }
    }