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{
"sday": 19900,
"eday": 19900,
"summary": {
"total_gpu": 12.34,
"total_stor": 0.5,
"total_bwu": 0.02,
"total_bwd": 0.01,
"total_sla": 0.1,
"avg_reliability": 0.9987
},
"username": "myhostuser",
"email": "host@example.com",
"fullname": "Host User",
"address1": "123 Main St",
"address2": null,
"city": "San Francisco",
"zip": "94105",
"country": "US",
"taxinfo": null,
"current": {
"balance": 45,
"service_fee": 0,
"total": 45,
"credit": 0
},
"per_machine": [
{
"machine_id": 1234,
"gpu_earn": 12.34,
"sto_earn": 0.5,
"bwu_earn": 0.02,
"bwd_earn": 0.01,
"sla_earn": 0.1,
"reliability": 0.9987
}
],
"per_day": [
{
"day": 19900,
"gpu_earn": 12.34,
"sto_earn": 0.5,
"bwu_earn": 0.02,
"bwd_earn": 0.01,
"sla_earn": 0.1,
"reliability": 0.9987
}
]
}{
"error": "<string>",
"msg": "<string>"
}Get Machine Earnings
Returns aggregated host earnings data broken down by day and machine for a specified date range.
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{
"sday": 19900,
"eday": 19900,
"summary": {
"total_gpu": 12.34,
"total_stor": 0.5,
"total_bwu": 0.02,
"total_bwd": 0.01,
"total_sla": 0.1,
"avg_reliability": 0.9987
},
"username": "myhostuser",
"email": "host@example.com",
"fullname": "Host User",
"address1": "123 Main St",
"address2": null,
"city": "San Francisco",
"zip": "94105",
"country": "US",
"taxinfo": null,
"current": {
"balance": 45,
"service_fee": 0,
"total": 45,
"credit": 0
},
"per_machine": [
{
"machine_id": 1234,
"gpu_earn": 12.34,
"sto_earn": 0.5,
"bwu_earn": 0.02,
"bwd_earn": 0.01,
"sla_earn": 0.1,
"reliability": 0.9987
}
],
"per_day": [
{
"day": 19900,
"gpu_earn": 12.34,
"sto_earn": 0.5,
"bwu_earn": 0.02,
"bwd_earn": 0.01,
"sla_earn": 0.1,
"reliability": 0.9987
}
]
}{
"error": "<string>",
"msg": "<string>"
}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.
End day for the earnings report.
Optional machine ID to filter earnings.
Number of days to look back from today.
Response
Success; returns {sday, eday, summary, per_day, per_machine, username, email, fullname, address fields, current balance}
Start day index (days since Unix epoch).
End day index (days since Unix epoch).
Aggregate totals across all machines and days in the window.
Show child attributes
Show child attributes
Account username.
Account email address.
Account full name.
Billing address line 1.
Billing address line 2.
Billing city.
Billing ZIP/postal code.
Billing country.
Tax identification information.
Current account balance and fee snapshot.
Show child attributes
Show child attributes
Earnings delta per machine over the window.
Show child attributes
Show child attributes
Earnings broken down by day.
Show child attributes
Show child attributes