curl --request GET \
--url https://console.vast.ai/api/v0/charges \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.vast.ai/api/v0/charges"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://console.vast.ai/api/v0/charges', 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://console.vast.ai/api/v0/charges",
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://console.vast.ai/api/v0/charges"
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://console.vast.ai/api/v0/charges")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.vast.ai/api/v0/charges")
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{
"success": true,
"count": 123,
"total": 123,
"results": [
{}
],
"next_token": "<string>"
}{
"error": "<string>",
"msg": "<string>"
}List Instance Charges
Returns paginated instance charge details for the authenticated user within a required day range, optionally formatted as a hierarchical tree.
curl --request GET \
--url https://console.vast.ai/api/v0/charges \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.vast.ai/api/v0/charges"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://console.vast.ai/api/v0/charges', 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://console.vast.ai/api/v0/charges",
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://console.vast.ai/api/v0/charges"
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://console.vast.ai/api/v0/charges")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.vast.ai/api/v0/charges")
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{
"success": true,
"count": 123,
"total": 123,
"results": [
{}
],
"next_token": "<string>"
}{
"error": "<string>",
"msg": "<string>"
}Authorizations
API key must be provided in the Authorization header
Query Parameters
day (required). Date range in unix seconds (UTC). Operators: gte, lte.
type (optional). Filter by contract type: instance, volume, serverless. Operator: in.
Examples:
// All charges in January 2026
{"day":{"gte":1767225600,"lte":1769903999}}
// Only instance charges
{"day":{"gte":1767225600,"lte":1769903999},"type":{"in":["instance"]}}
// Volumes and serverless only
{"day":{"gte":1767225600,"lte":1769903999},"type":{"in":["volume","serverless"]}}
table(default) flat list of per-contract rows withtype: "instance"or"volume".treeserverless contracts are collapsed under endpoint/workergroup wrappers withtype: "serverless"andsource: "endpoint-<id>"/"workergroup-<id>". Regular instances and volumes are unchanged.
table, tree "table"
Sort by most recent charges first.
true
Max results per page. Server maximum 500.
x >= 120
Pass the next_token value from the previous response to fetch the next page of results. When the response returns next_token: null, there are no more pages.
"eyJ2YWx1ZXMiOiB7ImlkIjogMTIzNDU2Nzh9fQ=="
Response
Host users: {"success": false, "msg": "Host users do not have instance charges", "count": 0, ...}
True on success
Number of unique instances/volumes in the result
Total matching instances/volumes across all pages
Charge entries with start, end, type, source, description, amount, metadata, and items fields
Cursor for the next page, or null