Get what a job and its run were charged
curl --request GET \
--url https://api.varg.ai/v2/jobs/{id}/cost \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.varg.ai/v2/jobs/{id}/cost"
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/jobs/{id}/cost', 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/jobs/{id}/cost",
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/jobs/{id}/cost"
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/jobs/{id}/cost")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/jobs/{id}/cost")
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": {
"job_id": "job_a1b2c3d4e5f6",
"run_id": "job_a1b2c3d4e5f6",
"is_root": true,
"charged_cents": 12,
"run_charged_cents": 12,
"run_held_cents": 0,
"settled": true,
"attribution": {
"source": {
"key": "api",
"label": "API"
},
"member": {
"key": "user_1",
"label": "Alex"
},
"api_key": {
"key": "key_1",
"label": "Alex (varg_a1b2...c3d4)"
}
},
"jobs": [
{
"job_id": "job_a1b2c3d4e5f6",
"parent_job_id": null,
"is_root": true,
"tool": {
"key": "video",
"label": "Video"
},
"model": {
"key": "kling_v3",
"label": "Kling v3"
},
"status": {
"key": "completed",
"label": "Completed"
},
"created_at": "2026-07-01T10:00:00Z",
"completed_at": "2026-07-01T10:02:10Z",
"estimated_cents": 12,
"charged_cents": 12,
"held_cents": 0,
"charges": [
{
"id": "txn_abc123",
"posted_at": "2026-07-01T10:02:10Z",
"amount_cents": 12,
"billed_units": {
"seconds": 5
}
}
]
}
]
},
"meta": {
"definition_version": "1",
"data_as_of": "2026-07-01T10:05:00Z",
"money_unit": "cent",
"time_basis": "lifetime",
"attribution_scope": "full"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key or JWT"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}Jobs
Get what a job and its run were charged
Ledger view of what the job, and the whole run it belongs to (the root
job plus every job it spawned), were actually charged. Unlike
GET /jobs/{id}/price, nothing here falls back to an estimate:
charged_cents is money that moved, estimated_cents is a quote, and
held_cents is credits set aside for work still running. All amounts
are integer credits (1 credit = 1 cent), in fields named *_cents.
Pass a root or child job id.
GET
/
jobs
/
{id}
/
cost
Get what a job and its run were charged
curl --request GET \
--url https://api.varg.ai/v2/jobs/{id}/cost \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.varg.ai/v2/jobs/{id}/cost"
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/jobs/{id}/cost', 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/jobs/{id}/cost",
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/jobs/{id}/cost"
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/jobs/{id}/cost")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.varg.ai/v2/jobs/{id}/cost")
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": {
"job_id": "job_a1b2c3d4e5f6",
"run_id": "job_a1b2c3d4e5f6",
"is_root": true,
"charged_cents": 12,
"run_charged_cents": 12,
"run_held_cents": 0,
"settled": true,
"attribution": {
"source": {
"key": "api",
"label": "API"
},
"member": {
"key": "user_1",
"label": "Alex"
},
"api_key": {
"key": "key_1",
"label": "Alex (varg_a1b2...c3d4)"
}
},
"jobs": [
{
"job_id": "job_a1b2c3d4e5f6",
"parent_job_id": null,
"is_root": true,
"tool": {
"key": "video",
"label": "Video"
},
"model": {
"key": "kling_v3",
"label": "Kling v3"
},
"status": {
"key": "completed",
"label": "Completed"
},
"created_at": "2026-07-01T10:00:00Z",
"completed_at": "2026-07-01T10:02:10Z",
"estimated_cents": 12,
"charged_cents": 12,
"held_cents": 0,
"charges": [
{
"id": "txn_abc123",
"posted_at": "2026-07-01T10:02:10Z",
"amount_cents": 12,
"billed_units": {
"seconds": 5
}
}
]
}
]
},
"meta": {
"definition_version": "1",
"data_as_of": "2026-07-01T10:05:00Z",
"money_unit": "cent",
"time_basis": "lifetime",
"attribution_scope": "full"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key or JWT"
}
}{
"error": {
"code": "model_not_found",
"message": "Unknown model: flux-shnell",
"details": "<unknown>"
}
}{
"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.
Path Parameters
Pattern:
^job_Was this page helpful?