# Billing (/sdk/reference/billing)



{/* Generated by docs-site/scripts/generate-sdk-docs.ts — do not edit. */}

### `getBillingBalance` [#getbillingbalance]

`GET /api/v0/billing/balance/{org}`

Get an organization's balance

Returns the organization's current balance in cents — the sum of every ledger entry (credits positive, debits negative). May be negative.

```ts
import { getBillingBalance } from "@harmont/cloud";
```

```ts
getBillingBalance(options): RequestResult<GetBillingBalanceResponse>
```

| Parameter | In   | Type     | Description            |
| --------- | ---- | -------- | ---------------------- |
| `org`     | path | `string` | The organization slug. |

**Returns** `GetBillingBalanceResponse`

See [`GET /api/v0/billing/balance/{org}`](/api/reference/billing) for the full request and response schema.

### `getBillingUsage` [#getbillingusage]

`GET /api/v0/billing/usage/{org}`

Get an organization's VM usage

Aggregates the organization's VM-lease usage over the half-open window `[from, to)` (both ISO-8601 timestamps): resource-seconds per dimension and the total billed cost in cents. Both `from` and `to` are required.

```ts
import { getBillingUsage } from "@harmont/cloud";
```

```ts
getBillingUsage(options): RequestResult<GetBillingUsageResponse>
```

| Parameter | In    | Type     | Description                         |
| --------- | ----- | -------- | ----------------------------------- |
| `org`     | path  | `string` | The organization slug.              |
| `from`    | query | `string` | Window start (inclusive), ISO-8601. |
| `to`      | query | `string` | Window end (exclusive), ISO-8601.   |

**Returns** `GetBillingUsageResponse`

See [`GET /api/v0/billing/usage/{org}`](/api/reference/billing) for the full request and response schema.

### `getBillingUsageBreakdown` [#getbillingusagebreakdown]

`GET /api/v0/billing/usage/{org}/breakdown`

Per-build VM usage breakdown

Returns the organization's VM usage over the half-open `[from, to)` window (both ISO-8601), grouped by build (newest first) and broken down per job lease — pipeline, build number, job, VM handle, resource shape, duration and cost — so a charge can be traced to its source.

```ts
import { getBillingUsageBreakdown } from "@harmont/cloud";
```

```ts
getBillingUsageBreakdown(options): RequestResult<GetBillingUsageBreakdownResponse>
```

| Parameter | In    | Type     | Description                        |
| --------- | ----- | -------- | ---------------------------------- |
| `org`     | path  | `string` | Organization slug.                 |
| `from`    | query | `string` | ISO-8601 window start (inclusive). |
| `to`      | query | `string` | ISO-8601 window end (exclusive).   |

**Returns** `GetBillingUsageBreakdownResponse`

See [`GET /api/v0/billing/usage/{org}/breakdown`](/api/reference/billing) for the full request and response schema.

### `getBillingUsageSeries` [#getbillingusageseries]

`GET /api/v0/billing/usage/{org}/series`

Per-day usage time-series

```ts
import { getBillingUsageSeries } from "@harmont/cloud";
```

```ts
getBillingUsageSeries(options): RequestResult<GetBillingUsageSeriesResponse>
```

| Parameter | In    | Type     | Description                        |
| --------- | ----- | -------- | ---------------------------------- |
| `org`     | path  | `string` | Organization slug.                 |
| `from`    | query | `string` | ISO-8601 window start (inclusive). |
| `to`      | query | `string` | ISO-8601 window end (exclusive).   |

**Returns** `GetBillingUsageSeriesResponse`

See [`GET /api/v0/billing/usage/{org}/series`](/api/reference/billing) for the full request and response schema.

### `listBillingTransactions` [#listbillingtransactions]

`GET /api/v0/billing/transactions/{org}`

List an organization's ledger entries

Returns the organization's ledger entries, newest first, cursor-paginated.

```ts
import { listBillingTransactions } from "@harmont/cloud";
```

```ts
listBillingTransactions(options): RequestResult<ListBillingTransactionsResponse>
```

| Parameter | In    | Type     | Description                                         |
| --------- | ----- | -------- | --------------------------------------------------- |
| `org`     | path  | `string` | The organization slug.                              |
| `limit`   | query | `number` | Page size (1–100, default 50).                      |
| `cursor`  | query | `string` | Opaque cursor from a previous page's `next_cursor`. |

**Returns** `ListBillingTransactionsResponse`

See [`GET /api/v0/billing/transactions/{org}`](/api/reference/billing) for the full request and response schema.
