---
title: "Measured quantities over time, per meter"
---

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

Path: Billing API › Billing

`GET /v1/organizations/{orgId}/usage`

## Authentication

Requires one of the following:

- `apiKey`, http, header `Authorization`
- `oauth`, http, header `Authorization`
- `sessionCookie`, apiKey, in cookie

## Path parameters

- `GetUsage.path.orgId` (string, required)
  - format `uuid`

## Query parameters

- `GetUsage.query.from` (string, required) — A date (2026-09-01) or an hour-aligned UTC time (2026-09-01T10:00:00Z).
- `GetUsage.query.to` (string, required) — Exclusive, like from. Hourly windows are at most 14 days, others 13 months.
- `GetUsage.query.granularity` (string, optional)
  - one of `"hour"`, `"day"`, `"month"`; default `"day"`
- `GetUsage.query.groupBy` (string, optional) — Up to two of project, meter, region, comma-separated.
- `GetUsage.query.filter` (string, optional) — key:value, comma-separated, keys as groupBy.
- `GetUsage.query.meter` (string, optional) — Only these meters, comma-separated.

## Code samples

### cURL

```curl
curl --request GET \
  --url 'https://billing.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage?from=string&to=string' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://billing.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage?from=string&to=string';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://billing.ezghcloud.com/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage?from=string&to=string"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "organizationId": "string",
  "from": "2019-08-24T14:15:22Z",
  "to": "2019-08-24T14:15:22Z",
  "granularity": "string",
  "ratedThrough": "2019-08-24T14:15:22Z",
  "periods": [
    {
      "start": "2019-08-24T14:15:22Z",
      "end": "2019-08-24T14:15:22Z",
      "estimated": true,
      "groups": [
        {
          "keys": {
            "property1": "string",
            "property2": "string"
          },
          "quantity": "string",
          "unit": "string",
          "eventCount": 0,
          "estimated": true
        }
      ]
    }
  ],
  "values": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  },
  "labels": {
    "services": {
      "property1": "string",
      "property2": "string"
    },
    "meters": {
      "property1": "string",
      "property2": "string"
    },
    "skus": {
      "property1": "string",
      "property2": "string"
    }
  },
  "nextCursor": null
}
```

- `GetUsage.response.200.organizationId` (string, required)
- `GetUsage.response.200.from` (string, required)
  - format `date-time`
- `GetUsage.response.200.to` (string, required)
  - format `date-time`
- `GetUsage.response.200.granularity` (string, required)
- `GetUsage.response.200.ratedThrough` (string, required)
  - format `date-time`
- `GetUsage.response.200.periods` (array<object>, required)
  - `GetUsage.response.200.periods.start` (string, required)
    - format `date-time`
  - `GetUsage.response.200.periods.end` (string, required) — Exclusive.
    - format `date-time`
  - `GetUsage.response.200.periods.estimated` (boolean, required) — Any of its groups is.
  - `GetUsage.response.200.periods.groups` (array<object>, required)
    - `GetUsage.response.200.periods.groups.keys` (map<string>, required) — Always includes meter.
    - `GetUsage.response.200.periods.groups.quantity` (string, required) — In unit.
      - pattern `^-?[0-9]+(\.[0-9]+)?$`
    - `GetUsage.response.200.periods.groups.unit` (string | null, required)
    - `GetUsage.response.200.periods.groups.eventCount` (integer, required)
    - `GetUsage.response.200.periods.groups.estimated` (boolean, required) — Some of it is a level carried forward.
- `GetUsage.response.200.values` (map<array<string>>, required) — Every value of each key in the window, whatever the filter.
- `GetUsage.response.200.labels` (object, required) — Display names for the IDs in the answer. IDs without one are left out.
  - `GetUsage.response.200.labels.services` (map<string>, required)
  - `GetUsage.response.200.labels.meters` (map<string>, required)
  - `GetUsage.response.200.labels.skus` (map<string>, required)
- `GetUsage.response.200.nextCursor` (null, required) — One page: always null.

### 400

invalid_request: the request is malformed (with issues), or invalid_cursor.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetUsage.response.400.error` (object, required)
  - `GetUsage.response.400.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUsage.response.400.error.message` (string, required) — What went wrong, for people.
  - `GetUsage.response.400.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUsage.response.400.error.issues.path` (string, required)
    - `GetUsage.response.400.error.issues.message` (string, required)

### 401

unauthenticated: no valid credential.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetUsage.response.401.error` (object, required)
  - `GetUsage.response.401.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUsage.response.401.error.message` (string, required) — What went wrong, for people.
  - `GetUsage.response.401.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUsage.response.401.error.issues.path` (string, required)
    - `GetUsage.response.401.error.issues.message` (string, required)

### 403

access_denied: the caller isn't allowed to (the message names the action); forbidden_origin: a cookie-authenticated write from another site.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetUsage.response.403.error` (object, required)
  - `GetUsage.response.403.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUsage.response.403.error.message` (string, required) — What went wrong, for people.
  - `GetUsage.response.403.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUsage.response.403.error.issues.path` (string, required)
    - `GetUsage.response.403.error.issues.message` (string, required)

### 404

not_found: the organization (or one the caller doesn't belong to), or the resource, doesn't exist.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetUsage.response.404.error` (object, required)
  - `GetUsage.response.404.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUsage.response.404.error.message` (string, required) — What went wrong, for people.
  - `GetUsage.response.404.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUsage.response.404.error.issues.path` (string, required)
    - `GetUsage.response.404.error.issues.message` (string, required)

### 429

too_many_requests: slow down.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetUsage.response.429.error` (object, required)
  - `GetUsage.response.429.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUsage.response.429.error.message` (string, required) — What went wrong, for people.
  - `GetUsage.response.429.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUsage.response.429.error.issues.path` (string, required)
    - `GetUsage.response.429.error.issues.message` (string, required)

### 500

internal_error: a bug; the details are in the logs, under the request ID.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetUsage.response.500.error` (object, required)
  - `GetUsage.response.500.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUsage.response.500.error.message` (string, required) — What went wrong, for people.
  - `GetUsage.response.500.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUsage.response.500.error.issues.path` (string, required)
    - `GetUsage.response.500.error.issues.message` (string, required)

### 503

unavailable, ledger_unavailable or payments_unavailable: retry later.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetUsage.response.503.error` (object, required)
  - `GetUsage.response.503.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetUsage.response.503.error.message` (string, required) — What went wrong, for people.
  - `GetUsage.response.503.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetUsage.response.503.error.issues.path` (string, required)
    - `GetUsage.response.503.error.issues.message` (string, required)


Source: https://docs.ezghcloud.com/billing-api/Billing/GetUsage/index.md
