Skip to main content
GET
/
data
/
usage
/
query
TypeScript
import { Livepeer } from "livepeer";

const livepeer = new Livepeer({
  apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await livepeer.metrics.getUsage({});

  // Handle the result
  console.log(result);
}

run();
package main

import(
	livepeergo "github.com/livepeer/livepeer-go"
	"context"
	"github.com/livepeer/livepeer-go/models/operations"
	"log"
)

func main() {
    s := livepeergo.New(
        livepeergo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
    )

    ctx := context.Background()
    res, err := s.Metrics.GetUsage(ctx, operations.GetUsageMetricsRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.UsageMetric != nil {
        // handle response
    }
}
from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.metrics.get_usage(request={})

if res.usage_metric is not None:
    # handle response
    pass
curl --request GET \
  --url https://livepeer.studio/api/data/usage/query \
  --header 'Authorization: Bearer <token>'
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://livepeer.studio/api/data/usage/query', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://livepeer.studio/api/data/usage/query",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
HttpResponse<String> response = Unirest.get("https://livepeer.studio/api/data/usage/query")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://livepeer.studio/api/data/usage/query")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "UserID": "1bde4o2i6xycudoy",
  "CreatorID": "john@doe.com",
  "DeliveryUsageMins": 100,
  "TotalUsageMins": 100,
  "StorageUsageMins": 100
}
{
  "errors": [
    [
      "id not provided",
      "Account not found"
    ]
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

from
integer

Start millis timestamp for the query range (inclusive)

to
integer

End millis timestamp for the query range (exclusive)

timeStep
enum<string>

The time step to aggregate viewership metrics by

Available options:
hour,
day
creatorId
string

The creator ID to filter the query results

breakdownBy[]
enum<string>[]

The list of fields to break down the query results. Currently the only supported breakdown is by creatorId.

Available options:
creatorId

Response

A Usage Metric object

An individual metric about usage of a user.

UserID
string

The user ID associated with the metric

Example:

"1bde4o2i6xycudoy"

CreatorID
string

The creator ID associated with the metric

Example:

"john@doe.com"

DeliveryUsageMins
number

Total minutes of delivery usage.

Example:

100

TotalUsageMins
number

Total transcoded minutes.

Example:

100

StorageUsageMins
number

Total minutes of storage usage.

Example:

100

Last modified on March 18, 2026