curl --request GET \
--url https://api.varg.ai/v2/analytics/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.varg.ai/v2/analytics/files"
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/files', 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/files",
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/files"
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/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/analytics/files")
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": {
"bucket_width": "1h",
"buckets": [
{
"files": 123,
"video": 123,
"image": 123,
"audio": 123,
"other": 123,
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"is_partial": true
}
],
"total": {
"files": 123,
"video": 123,
"image": 123,
"audio": 123,
"other": 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>"
}
}Files generated over time
Media files generated per hour, day, week or month in timezone, split into video, image, audio and other. Every generated file counts once, when it was made (clips inside a render and since-deleted files included; uploads and cache replays not). Filters apply through the job that made the file. No comparison period.
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.
curl --request GET \
--url https://api.varg.ai/v2/analytics/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.varg.ai/v2/analytics/files"
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/files', 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/files",
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/files"
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/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/analytics/files")
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": {
"bucket_width": "1h",
"buckets": [
{
"files": 123,
"video": 123,
"image": 123,
"audio": 123,
"other": 123,
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"is_partial": true
}
],
"total": {
"files": 123,
"video": 123,
"image": 123,
"audio": 123,
"other": 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.
64Filter 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.
4000Calendar bucket size in timezone. 1h is limited to ranges of 31 days or less. Default 1d.
1h, 1d, 1w, 1mo json (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?