Skip to content
Docs

    Get Usage Record

    $ nirvana usage get
    GET/v1/usage/{resource_id}

    Get the usage record for a single resource (metadata plus dimension history) for the current organization.

    ParametersExpand Collapse
    --resource-id: string

    Resource ID

    ReturnsExpand Collapse
    usage: object { dimensions, ended_at, project_id, 4 more }

    Usage record for a single metered resource.

    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: "us-sva-2"

    Region the resource is in.

    "us-sva-2"
    resource_id: string
    resource_type: "vm" or "volume" or "vpc" or 4 more

    Kind of metered resource a ledger row belongs to.

    "vm"
    "volume"
    "vpc"
    "connect_connection"
    "nks_cluster"
    "nks_node_pool"
    "nks_load_balancer"
    started_at: string

    Get Usage Record

    nirvana usage get \
      --api-key 'My API Key' \
      --resource-id 123e4567-e89b-12d3-a456-426614174000
    {
      "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"
    }
    Returns Examples
    {
      "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"
    }