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
Was this page helpful?