curl --request GET \
--url https://api.varg.ai/v2/resources/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.varg.ai/v2/resources/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/resources/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/resources/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/resources/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/resources/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/resources/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": [
{
"id": "<string>",
"source": "attachment",
"url": "<string>",
"filename": "<string>",
"title": "<string>",
"subtitle": "<string>",
"media_type": "<string>",
"size": 123,
"created_at": "2023-11-07T05:31:56Z",
"hash": "<string>",
"thumbnail_url": "<string>",
"origin": "upload",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by_profile": {
"display_name": "<string>",
"avatar_url": "<string>"
},
"creator_type": "user",
"created_by_api_key": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key_preview": "varg_a1b2...c3d4",
"name": "<string>"
},
"metadata": {},
"lineage": {
"job_id": "<string>",
"tool": "image",
"model": "<string>",
"prompt": "<string>",
"provider": "<string>",
"cost_cents": 123,
"parent_job_id": "<string>",
"root_job_id": "<string>",
"children_count": 123,
"total_cost_cents": 123,
"children_by_tool": [
{
"tool": "<string>",
"count": 123,
"cost_cents": 123
}
],
"breakdown": [
{
"job_id": "<string>",
"tool": "<string>",
"model": "<string>",
"status": "<string>",
"cost_cents": 123,
"is_root": true
}
],
"output_count": 123,
"output_index": 123,
"primary_file_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"input": {},
"file": {}
},
"is_favorite": true
}
],
"nextCursor": 123
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key or JWT"
}
}{
"error": {
"code": "workspace_not_found",
"message": "Unknown workspace"
}
}List files with lineage
Lists uploads and generated files in one list, newest first, each with
its lineage (tool, model, prompt, cost) and favorite flag. Compared to
GET /files it can filter by folder, creator and favorites. Uploads
have lineage: null.
Multi-value filters (kind, tool) accept repeated parameters or a
comma-separated value and are OR-combined. A malformed created_by or
creator_api_key_id is ignored rather than rejected.
curl --request GET \
--url https://api.varg.ai/v2/resources/files \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.varg.ai/v2/resources/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/resources/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/resources/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/resources/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/resources/files")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/resources/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": [
{
"id": "<string>",
"source": "attachment",
"url": "<string>",
"filename": "<string>",
"title": "<string>",
"subtitle": "<string>",
"media_type": "<string>",
"size": 123,
"created_at": "2023-11-07T05:31:56Z",
"hash": "<string>",
"thumbnail_url": "<string>",
"origin": "upload",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by_profile": {
"display_name": "<string>",
"avatar_url": "<string>"
},
"creator_type": "user",
"created_by_api_key": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key_preview": "varg_a1b2...c3d4",
"name": "<string>"
},
"metadata": {},
"lineage": {
"job_id": "<string>",
"tool": "image",
"model": "<string>",
"prompt": "<string>",
"provider": "<string>",
"cost_cents": 123,
"parent_job_id": "<string>",
"root_job_id": "<string>",
"children_count": 123,
"total_cost_cents": 123,
"children_by_tool": [
{
"tool": "<string>",
"count": 123,
"cost_cents": 123
}
],
"breakdown": [
{
"job_id": "<string>",
"tool": "<string>",
"model": "<string>",
"status": "<string>",
"cost_cents": 123,
"is_root": true
}
],
"output_count": 123,
"output_index": 123,
"primary_file_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"input": {},
"file": {}
},
"is_favorite": true
}
],
"nextCursor": 123
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key or JWT"
}
}{
"error": {
"code": "workspace_not_found",
"message": "Unknown workspace"
}
}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
Media kind (image, video, audio) and/or origin (upload, generated). Unknown values are ignored.
image, video, audio, upload, generated Restrict to files produced by these tools. Unknown values are ignored.
image, video, speech, music, render, transcription, ffmpeg Matches the prompt, text or code of the job that produced the file.
Folder id or slug, or unfiled for files in no folder.
When true, only files the caller has favorited.
Only files created by this user id.
Only files created through this API key id.
Earliest creation time (ISO 8601).
Latest creation time (ISO 8601).
1 <= x <= 100Offset returned as nextCursor by the previous page.
x >= 0Was this page helpful?