curl --request GET \
--url https://api.varg.ai/v2/analytics/activity \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.varg.ai/v2/analytics/activity"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.varg.ai/v2/analytics/activity', 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.varg.ai/v2/analytics/activity",
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.varg.ai/v2/analytics/activity"
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.varg.ai/v2/analytics/activity")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/analytics/activity")
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{
"data": {
"group": "charge",
"items": [
{
"id": "<string>",
"posted_at": "2023-11-07T05:31:56Z",
"amount_cents": 123,
"billed_units": {},
"job_id": "<string>",
"run_id": "<string>",
"tool": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"model": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"status": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"source": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"workspace": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"api_key": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"member": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
}
}
],
"next_cursor": "<string>",
"total": {
"count": 123,
"spend_cents": 123
}
},
"meta": {
"definition_version": "2026-09-28",
"data_as_of": "2023-11-07T05:31:56Z",
"money_unit": "cent",
"time_basis": "posted_at",
"attribution_scope": "full",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"timezone": "UTC",
"compare": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"filters": {}
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key or JWT"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}List charges or runs
The ledger charges behind the numbers (group=charge), or those charges grouped by run (group=run) with each run’s lifetime total alongside. Cursor-paginated: pass next_cursor as cursor.
All analytics endpoints return { "data": ..., "meta": ... }. meta carries the resolved range
(from inclusive, to exclusive, ISO 8601 UTC), timezone, the comparison period, applied filters,
data_as_of, money_unit, time_basis and attribution_scope.
Amounts are whole credits; fields ending in _cents are credits (1 credit = 1 cent). Charges are counted
when they were posted to the ledger. On team accounts, non-members only see their own identity
dimensions (attribution_scope: self); others collapse into “Other …” groups.
With format=csv the response is text/csv; exports are capped at 10,000 rows and fail with 400 export_too_large instead of truncating.
curl --request GET \
--url https://api.varg.ai/v2/analytics/activity \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.varg.ai/v2/analytics/activity"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.varg.ai/v2/analytics/activity', 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.varg.ai/v2/analytics/activity",
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.varg.ai/v2/analytics/activity"
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.varg.ai/v2/analytics/activity")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/analytics/activity")
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{
"data": {
"group": "charge",
"items": [
{
"id": "<string>",
"posted_at": "2023-11-07T05:31:56Z",
"amount_cents": 123,
"billed_units": {},
"job_id": "<string>",
"run_id": "<string>",
"tool": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"model": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"status": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"source": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"workspace": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"api_key": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
},
"member": {
"key": "<string>",
"label": "<string>",
"kind": "member",
"avatar_url": "<string>",
"owner_label": "<string>",
"revoked": true,
"deleted": true
}
}
],
"next_cursor": "<string>",
"total": {
"count": 123,
"spend_cents": 123
}
},
"meta": {
"definition_version": "2026-09-28",
"data_as_of": "2023-11-07T05:31:56Z",
"money_unit": "cent",
"time_basis": "posted_at",
"attribution_scope": "full",
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"timezone": "UTC",
"compare": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"filters": {}
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key or JWT"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}Authorizations
varg API key (varg_...). Get one at app.varg.ai
or run bunx vargai login. App sessions may alternatively send a
Supabase JWT.
Query Parameters
Range start, inclusive. YYYY-MM-DD (local midnight in timezone), a local date-time
(2026-09-01T09:30), or an ISO 8601 instant with offset. Default: to minus 30 days.
Ranges are limited to 366 days.
40Range end, exclusive. Same formats as from. Default is now.
40IANA timezone used for date-only bounds and calendar buckets. Default UTC.
64previous_period compares against the equal-length period right before from;
none disables comparison. Default is previous_period on /analytics/summary
and none elsewhere. Ignored when compare_from/compare_to are given.
previous_period, none Explicit comparison start. Must be sent together with compare_to.
40Explicit comparison end, exclusive. Must be sent together with compare_from.
40Filter by capability. Comma-separated tool keys (video, image, speech, music, render, pipeline, ...) or none. Up to 50 values.
4000Filter by model. Comma-separated model ids or none. Up to 50 values.
4000Filter by folder. Comma-separated folder ids or none (no folder). Up to 50 values.
4000Filter by the API key that started the run. Comma-separated key ids or none. Up to 50 values.
4000Filter by the person who started the run. Comma-separated user ids or none. Up to 50 values.
4000Filter by creator: api_key:<id> (a personal API key) or member:<id> (a person),
comma-separated, or none. Up to 50 values.
4000Filter by how the run was started. Comma-separated values of app (a person in the web app),
api (API key, SDK, CLI), mcp (an agent via MCP), internal (varg system keys), unknown.
4000Filter by the charged job's status. Comma-separated values of completed, failed,
cancelled, awaiting_confirmation, running, submitting, queued, unknown.
4000charge (default) lists individual ledger charges; run groups them by run.
charge, run recent (default) newest first; amount largest first.
recent, amount Page size. 1-200, default 50. Out-of-range values are clamped. Ignored for CSV.
1 <= x <= 200The next_cursor of the previous page. Opaque; only valid with the same group and sort.
400json (default) returns the { data, meta } envelope. csv returns the same rows as
text/csv with a Content-Disposition attachment filename. Amounts are in credits.
json, csv Was this page helpful?