# Get bandwidth for a stream
`GET https://usages.livepush.io/usage/cdn/streams/{stream_id}`
Returns the bandwidth recorded for one stream, resolved through the
hostname it delivers on. Ranges work exactly as they do on
`GET /usage/cdn/hostnames`.

**Check `assignment` before you trust `bytes`.** Only `dedicated` means the
figure belongs to this stream alone. `shared` means the hostname carries
the streams named in `sharedWith` as well, so the figure covers all of
them. `pooled` means the stream delivers on the account's primary
hostname, where traffic cannot be attributed per stream: `bytes` is `null`
and `reason` explains why.

A stream with no per-stream tracking is **not** an error. It returns `200`
with `assignment: pooled` and a `reason`, because whether a stream has its
own hostname is account configuration rather than a bad request. The only
`404` is a stream that does not exist or is not yours.

Add `daily=true` for the per-day series. Days with no traffic are omitted,
so do not assume one entry per day in the range.
- **Tag:** Usage
- **Operation ID:** `getUsageCdnStreamsStreamId`
- **Authentication:** Bearer token required
- **Docs:** https://developers.livepush.io/usage/get-bandwidth-for-a-stream/

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `stream_id` | string | yes | Unique identifier of the stream. |


### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | string<date> | no | First UTC day to include, as YYYY-MM-DD. Defaults to the start of the current billing term. |
| `till` | string<date> | no | Last UTC day to include, as YYYY-MM-DD. Defaults to today. |
| `daily` | boolean | no | Include a per-day series. Days with no traffic are omitted. |


### Example request

```bash
curl -X GET 'https://usages.livepush.io/usage/cdn/streams/st_xxxxxxxxxxxxx' \
  -H 'Authorization: Bearer YOUR_API_TOKEN'
```


### Responses


#### 200 — Bandwidth for the stream. Also returned when the stream has no per-stream figure, with bytes: null and a reason.

- `enabled` (boolean) — false when the account has no CDN delivery configured.
- `streamId` (string)
- `assignment` (string) — How this stream's traffic is recorded. | Value | Meaning | | --- | --- | | dedicated | It has a hostname to itself, so bytes is its own traffic | | shared | It shares a hostname with other streams; bytes covers all of them, and sharedWith names them | | pooled | It delivers on the account's primary hostname, so its traffic cannot be separated. bytes is null | | none | The account has no CDN delivery configured |
- `hostname` (string) — The hostname the figure was read from. For a pooled stream this is the account's primary hostname, reported so you know where the traffic went.
- `label` (string)
- `sharedWith` (string[]) — The other streams delivering on the same hostname. Non-empty only when assignment is shared, and it is why bytes is not this stream alone.
- `range` (object) — The UTC days the figures actually cover, after defaults are applied. Both bounds are inclusive.
  - `from` (string<date>) — First UTC day included.
  - `till` (string<date>) — Last UTC day included. Today's figure is always partial.
  - `isCurrentTerm` (boolean) — true when no dates were sent and the range was filled in from the current billing term. When true the totals come from the stored term rows rather than from summing days, which is what the dashboard shows.
- `term` (object) — The current CDN billing term. null when the account has no active cdn subscription and no stored term row to fall back on.
  - `start` (string<date-time>) — Start of the current term.
  - `end` (string<date-time>) — End of the current term, or null when the term is open-ended or was recovered from a stored usage row rather than from a subscription.
- `bytes` (integer<int64>) — Billable bytes on this stream's hostname across the range. null when the stream is pooled or delivery is not enabled.
- `daily` (object[]) — Per-day series, present only when daily=true was sent, and empty for a pooled stream. Days with no traffic are omitted rather than zero-filled.
  - `date` (string<date>)
  - `bytes` (integer<int64>) — Billable bytes recorded for this day.
- `lastUpdated` (string<date-time>)
- `reason` (string) — Why there is no per-stream figure, or null when there is one. Either stream is on the account's primary hostname or per-stream bandwidth not enabled.


```json
{
  "enabled": true,
  "streamId": "st_xxxxxxxxxxxxx",
  "assignment": "dedicated",
  "hostname": "hls-acme-livepush.akamaized.net",
  "label": "Acme Channel",
  "sharedWith": [],
  "range": {
    "from": "2026-10-02",
    "till": "2026-10-15",
    "isCurrentTerm": true
  },
  "term": {
    "start": "2026-10-02T04:03:40.000Z",
    "end": "2026-11-02T04:03:40.000Z"
  },
  "bytes": 1234567890,
  "daily": [
    {
      "date": "2026-10-06",
      "bytes": 123456789
    }
  ],
  "lastUpdated": "2026-10-15T04:03:20.000Z",
  "reason": null
}
```


#### 400 — invalidrange — see GET /usage/cdn/hostnames.

- `error` (string) — Stable machine-readable code.
- `message` (string) — Human-readable detail. Present on invalidrange, which says exactly which parameter was wrong.


```json
{
  "error": "invalid_range",
  "message": "range is 500 days; the maximum is 400"
}
```


#### 401 — Unauthorized


#### 404 — streamnotfound — no such stream on this account.

- `error` (string) — Stable machine-readable code.
- `message` (string) — Human-readable detail. Present on invalidrange, which says exactly which parameter was wrong.


```json
{
  "error": "invalid_range",
  "message": "range is 500 days; the maximum is 400"
}
```

