Nearglass

Viewer-hours and bytes per day and per stream, and this month's spend

From the relay's session records (UTC days, a session counted on the day it ended; viewer sessions under 10 s are bytes but not viewer-hours). At most 92 days a call.

GET
/v1/usage

From the relay's session records (UTC days, a session counted on the day it ended; viewer sessions under 10 s are bytes but not viewer-hours). At most 92 days a call.

Authorization

secretKey
headerAuthorizationBearer <token>

sk_...

Query Parameters

from?string

first day (UTC); default: the 1st of this month

Formatdate
to?string

last day (UTC); default: today

Formatdate
stream?string

one stream only

Response Body

usage

application/json
  1. response
tenant?string
from?string
to?string
days?array<>
total?
month?
Example Request
curl -X GET 'https://api.nearglass.com/v1/usage?from=2026-10-01&to=2026-10-31&stream=st_8f2c41d09a7be3105c6e2d77'
Example Response
{  "tenant": "string",  "from": "string",  "to": "string",  "days": [    {      "viewer_hours": 0,      "gib": 0,      "bytes": 0,      "sessions": 0,      "viewer_sessions": 0,      "moq": {        "viewer_hours": 0,        "viewer_sessions": 0,        "bytes": 0      },      "hls": {        "viewer_hours": 0,        "viewer_sessions": 0,        "bytes": 0      },      "date": "string",      "streams": [        {          "viewer_hours": 0,          "gib": 0,          "bytes": 0,          "sessions": 0,          "viewer_sessions": 0,          "moq": {            "viewer_hours": 0,            "viewer_sessions": 0,            "bytes": 0          },          "hls": {            "viewer_hours": 0,            "viewer_sessions": 0,            "bytes": 0          },          "stream": "string",          "namespace": "string"        }      ]    }  ],  "total": {    "viewer_hours": 0,    "gib": 0,    "bytes": 0,    "sessions": 0,    "viewer_sessions": 0,    "moq": {      "viewer_hours": 0,      "viewer_sessions": 0,      "bytes": 0    },    "hls": {      "viewer_hours": 0,      "viewer_sessions": 0,      "bytes": 0    }  },  "month": {    "month": "string",    "viewer_hours": 0,    "gib": 0,    "bytes": 0,    "free_viewer_hours": 0,    "free_gib": 0,    "prices": {      "per_gib_usd": 0,      "per_viewer_hour_usd": 0    },    "spend_usd": 0,    "spend_cap_usd": 0,    "percent_of_cap": 0,    "cap_reached": true,    "alerts": [      {        "percent": 50,        "at": "2019-08-24T14:15:22Z"      }    ]  }}