ReferenceAPI

Get usage and cost

Get what your resources have cost in a period and what they are costing right now.

GET https://api.nevia.cloud/v1/usage
curl -X GET "https://api.nevia.cloud/v1/usage" \
  -H "Authorization: Bearer $TOKEN"
{
  "usage": {
    "currency": "USD",
    "period": {
      "starts_at": "2026-10-01T00:00:00.000Z",
      "ends_at": "2026-10-30T09:00:00.000Z"
    },
    "measured_at": "2026-10-30T09:00:00.000Z",
    "total_usd": "0.025871973333",
    "settled": {
      "compute_usd": "0.0209",
      "memory_usd": "0.003483333333",
      "storage_usd": "0.00007364",
      "total_usd": "0.024456973333",
      "vcpu_hours": 0.348,
      "memory_gib_hours": 0.348,
      "storage_gib_hours": 0.2688,
      "running_hours": 0.348
    },
    "usage": {
      "vcpu_hours": 0.348,
      "memory_gib_hours": 0.348,
      "storage_gib_hours": 0.2688,
      "running_hours": 0.348
    },
    "accruing": {
      "compute_usd": "0.0012",
      "memory_usd": "0.0002",
      "storage_usd": "0.000015",
      "total_usd": "0.001415",
      "running_resources": 1,
      "per_hour": {
        "compute_usd": "0.12",
        "memory_usd": "0.02",
        "storage_usd": "0.00",
        "total_usd": "0.14"
      },
      "per_hour_usage": {
        "vcpu_hours": 1,
        "memory_gib_hours": 1,
        "storage_gib_hours": 0.5,
        "running_hours": 1
      }
    },
    "rates": [
      {
        "kind": "computer",
        "vcpu_hour_usd": "0.06",
        "memory_gib_hour_usd": "0.01",
        "storage_gib_hour_usd": "0.000273972602",
        "effective_at": "2026-10-29T00:00:00.000Z"
      }
    ],
    "workspaces": [
      {
        "id": "01d4cnjjq40hnnh0nwmkg35nv2h",
        "name": "acme",
        "total_usd": "0.025871973333",
        "settled": {
          "compute_usd": "0.0209",
          "memory_usd": "0.003483333333",
          "storage_usd": "0.00007364",
          "total_usd": "0.024456973333"
        },
        "accruing": {
          "compute_usd": "0.0012",
          "memory_usd": "0.0002",
          "storage_usd": "0.000015",
          "total_usd": "0.001415"
        },
        "usage": {
          "vcpu_hours": 0.348,
          "memory_gib_hours": 0.348,
          "storage_gib_hours": 0.2688,
          "running_hours": 0.348
        }
      }
    ],
    "by_kind": {
      "computer": {
        "settled": {
          "compute_usd": "0.0209",
          "memory_usd": "0.003483333333",
          "storage_usd": "0.00007364",
          "total_usd": "0.024456973333"
        },
        "accruing": {
          "compute_usd": "0.0012",
          "memory_usd": "0.0002",
          "storage_usd": "0.000015",
          "total_usd": "0.001415"
        },
        "per_hour": {
          "compute_usd": "0.12",
          "memory_usd": "0.02",
          "storage_usd": "0.00",
          "total_usd": "0.14"
        },
        "usage": {
          "vcpu_hours": 0.348,
          "memory_gib_hours": 0.348,
          "storage_gib_hours": 0.2688,
          "running_hours": 0.348
        },
        "per_hour_usage": {
          "vcpu_hours": 1,
          "memory_gib_hours": 1,
          "storage_gib_hours": 0.5,
          "running_hours": 1
        }
      },
      "database": {
        "settled": {
          "compute_usd": "0.00",
          "memory_usd": "0.00",
          "storage_usd": "0.00",
          "total_usd": "0.00"
        },
        "accruing": {
          "compute_usd": "0.00",
          "memory_usd": "0.00",
          "storage_usd": "0.00",
          "total_usd": "0.00"
        },
        "per_hour": {
          "compute_usd": "0.00",
          "memory_usd": "0.00",
          "storage_usd": "0.00",
          "total_usd": "0.00"
        },
        "usage": {
          "vcpu_hours": 0,
          "memory_gib_hours": 0,
          "storage_gib_hours": 0,
          "running_hours": 0
        },
        "per_hour_usage": {
          "vcpu_hours": 0,
          "memory_gib_hours": 0,
          "storage_gib_hours": 0,
          "running_hours": 0
        }
      }
    },
    "series": {
      "granularity": "day",
      "buckets": [
        {
          "starts_at": "2026-10-30T00:00:00.000Z",
          "compute_usd": "0.0209",
          "memory_usd": "0.003483333333",
          "storage_usd": "0.00007364",
          "total_usd": "0.024456973333",
          "usage": {
            "vcpu_hours": 0.348,
            "memory_gib_hours": 0.348,
            "storage_gib_hours": 0.2688,
            "running_hours": 0.348
          },
          "peak": {
            "vcpu_hours": 1,
            "memory_gib_hours": 1,
            "storage_gib_hours": 10,
            "running_hours": 1
          },
          "by_kind": {
            "computer": {
              "compute_usd": "0.0209",
              "memory_usd": "0.003483333333",
              "storage_usd": "0.00007364",
              "total_usd": "0.024456973333",
              "usage": {
                "vcpu_hours": 0.348,
                "memory_gib_hours": 0.348,
                "storage_gib_hours": 0.2688,
                "running_hours": 0.348
              },
              "peak": {
                "vcpu_hours": 1,
                "memory_gib_hours": 1,
                "storage_gib_hours": 10,
                "running_hours": 1
              }
            },
            "database": {
              "compute_usd": "0.00",
              "memory_usd": "0.00",
              "storage_usd": "0.00",
              "total_usd": "0.00",
              "usage": {
                "vcpu_hours": 0,
                "memory_gib_hours": 0,
                "storage_gib_hours": 0,
                "running_hours": 0
              },
              "peak": {
                "vcpu_hours": 0,
                "memory_gib_hours": 0,
                "storage_gib_hours": 0,
                "running_hours": 0
              }
            }
          }
        }
      ]
    }
  }
}

Authorization

bearerAuth
Authorization Bearer <token>

Send the token in the Authorization: Bearer <token> header. See Authenticate.

In: header

Query Parameters

workspace?array< string>

Workspace ids or exact names. When one is absent the answer covers every workspace the caller can see.

resource?array< string>

Computer or database ids, or their exact names together with workspace. Sessions come only when exactly one is chosen.

kind? string computer · database

When present, every figure covers only resources of this kind, exactly as if the other kind did not exist. The other kind's by_kind figure reads zero.

from? string

Period start, RFC 3339, inclusive. Defaults to the start of the current month.

Format date-time
to? string

Period end, RFC 3339, exclusive. Defaults to now.

Format date-time
series_from? string

Where the chart's buckets start, RFC 3339, when they read farther back than the billed range. Must be at or before from, and defaults to it. The figures still count the range exactly, and only the series extends back.

Format date-time
granularity? string minute · hour · day

Bucket size of the series

Behavior

Without workspace, the answer covers every workspace you can see and lists each one's share. With one or more workspaces, it lists those workspaces' resources. With resource, it is about those resources. With kind, every figure covers only resources of that kind, exactly as if the other kind did not exist and its by_kind figure read zero. Amounts are decimal strings in USD, exact as metered and never rounded, so every total is the sum of its parts. Usage counts for the time it spent inside the period, wherever it began or ended. The period defaults to the current month so far and may span at most 92 days. The chart (the series) may read back from an earlier series_from, one request answering the bill and the chart in a single walk. Answers 503 not_supported where metering is not deployed.

Response

application/json

Your usage.