show earnings
curl --request GET \
--url https://console.vast.ai/api/v0/users/{user_id}/machine-earnings \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.vast.ai/api/v0/users/{user_id}/machine-earnings"
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/users/{user_id}/machine-earnings', 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/users/{user_id}/machine-earnings",
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/users/{user_id}/machine-earnings"
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/users/{user_id}/machine-earnings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.vast.ai/api/v0/users/{user_id}/machine-earnings")
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{
"summary": {
"total_gpu": 123,
"total_stor": 123,
"total_bwu": 123,
"total_bwd": 123,
"total_sla": 123
},
"username": "<string>",
"email": "<string>",
"fullname": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"zip": "<string>",
"country": "<string>",
"taxinfo": "<string>",
"current": {
"balance": 123,
"service_fee": 123,
"total": 123,
"credit": 123
},
"per_machine": [
{
"machine_id": 123,
"gpu_earn": 123,
"sto_earn": 123,
"bwu_earn": 123,
"bwd_earn": 123,
"sla_earn": 123
}
],
"per_day": [
{
"day": 123,
"gpu_earn": 123,
"sto_earn": 123,
"bwu_earn": 123,
"bwd_earn": 123,
"sla_earn": 123
}
]
}{
"success": false,
"error": "<string>",
"msg": "<string>"
}{
"detail": "API requests too frequent endpoint threshold=2.0"
}Billing
show earnings
Retrieves the earnings history for a specified time range and optionally per machine.
Note: per_day[] aggregates SLA earnings across your entire fleet for each UTC day, even when machid is set. For machine-scoped SLA totals, use per_machine[].sla_earn.
CLI Usage: vastai show earnings [options]
GET
/
api
/
v0
/
users
/
{user_id}
/
machine-earnings
show earnings
curl --request GET \
--url https://console.vast.ai/api/v0/users/{user_id}/machine-earnings \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.vast.ai/api/v0/users/{user_id}/machine-earnings"
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/users/{user_id}/machine-earnings', 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/users/{user_id}/machine-earnings",
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/users/{user_id}/machine-earnings"
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/users/{user_id}/machine-earnings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.vast.ai/api/v0/users/{user_id}/machine-earnings")
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{
"summary": {
"total_gpu": 123,
"total_stor": 123,
"total_bwu": 123,
"total_bwd": 123,
"total_sla": 123
},
"username": "<string>",
"email": "<string>",
"fullname": "<string>",
"address1": "<string>",
"address2": "<string>",
"city": "<string>",
"zip": "<string>",
"country": "<string>",
"taxinfo": "<string>",
"current": {
"balance": 123,
"service_fee": 123,
"total": 123,
"credit": 123
},
"per_machine": [
{
"machine_id": 123,
"gpu_earn": 123,
"sto_earn": 123,
"bwu_earn": 123,
"bwd_earn": 123,
"sla_earn": 123
}
],
"per_day": [
{
"day": 123,
"gpu_earn": 123,
"sto_earn": 123,
"bwu_earn": 123,
"bwd_earn": 123,
"sla_earn": 123
}
]
}{
"success": false,
"error": "<string>",
"msg": "<string>"
}{
"detail": "API requests too frequent endpoint threshold=2.0"
}Authorizations
API key must be provided in the Authorization header
Path Parameters
The ID of the user.
Query Parameters
Start day for the earnings report as a UTC day index:
floor(unix_epoch_seconds / 86400). Prefer last_days when you do not need an absolute window.
End day for the earnings report as a UTC day index:
floor(unix_epoch_seconds / 86400) (inclusive end of the window when used with sday).
Optional machine ID to filter earnings.
Number of days to look back from today.