Skip to main content
GET
/
v1
/
analytics
/
computer
/
usage
Computer Usage Analytics
curl --request GET \
  --url https://api.perplexity.ai/v1/analytics/computer/usage \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.perplexity.ai/v1/analytics/computer/usage"

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

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

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.perplexity.ai/v1/analytics/computer/usage', 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://api.perplexity.ai/v1/analytics/computer/usage",
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;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.perplexity.ai/v1/analytics/computer/usage"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.perplexity.ai/v1/analytics/computer/usage")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.perplexity.ai/v1/analytics/computer/usage")

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
{
  "categories": [
    "Model",
    "Credit Source"
  ],
  "data": [
    {
      "start_time": 1746057600,
      "end_time": 1746144000,
      "count": 350,
      "by_categories": {
        "Model": [
          {
            "category": "claude-opus-4-8",
            "count": 210
          },
          {
            "category": "claude-sonnet-4-6",
            "count": 120
          }
        ],
        "Credit Source": [
          {
            "category": "paid",
            "count": 250
          },
          {
            "category": "promo",
            "count": 80
          }
        ]
      }
    }
  ],
  "has_more": false,
  "next_page": null
}
{
"error": {
"message": "start_time must be before end_time.",
"type": "invalid_request",
"code": 400
}
}
{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123
}
}
{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123
}
}
{
"error": {
"message": "<string>",
"type": "<string>",
"code": 123
}
}
This endpoint requires an organization analytics API key, generated by an org admin from the Perplexity web app — not a regular Sonar API key. See Computer Analytics API for setup, time-window semantics, and pagination.

Authorizations

Authorization
string
header
required

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

Query Parameters

dataset
enum<string>
required

The dataset to query.

Available options:
credit_usage,
connectors,
artifacts,
skills,
spaces,
workflows,
task_durations
start_time
integer
required

Window start in unix seconds (UTC), inclusive. Snapped down to the bucket grid, so the first bucket can include usage from before this time.

Required range: x >= 0
end_time
integer

Window end in unix seconds (UTC), exclusive. Defaults to now; future values are capped at now. The window may span at most 90 days.

Required range: x >= 0
bucket_width
enum<string>
default:1d

Bucket size. Buckets align to the UTC grid.

Available options:
1d,
1h
limit
integer

Buckets per page. 1d: default 7, max 31. 1h: default 24, max 168.

page
string

Opaque pagination cursor from a previous response's next_page. Valid only with the same query parameters it was issued for.

user_email
string<email>

Restrict results to a single member of your organization. Emails that don't match a current member return a generic 400.

Response

Bucketed usage for the requested window. Buckets without data carry count 0; the analytics store syncs periodically, so a zero in a recent bucket can mean the data hasn't synced yet.

categories
string[]
required

Category breakdown labels the requested dataset surfaces, in canonical render order. Each label is a key in every bucket's by_categories.

data
object[]
required

Every bucket in the page's window, in chronological order. Buckets without data carry count 0 and an empty breakdown.

has_more
boolean
required

Whether more buckets exist beyond this page. False also when the window's remaining buckets are past the current data frontier.

next_page
string | null

Cursor for the next page; pass as the page parameter with otherwise identical query parameters.