curl --request GET \
--url https://console.vast.ai/api/v0/metrics/gpu/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.vast.ai/api/v0/metrics/gpu/history"
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/metrics/gpu/history', 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/metrics/gpu/history",
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/metrics/gpu/history"
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/metrics/gpu/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.vast.ai/api/v0/metrics/gpu/history")
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,
"needs_machine": true,
"gpus": {}
}{
"error": "<string>",
"msg": "<string>"
}{
"error": "<string>",
"msg": "<string>"
}Get GPU Supply and Pricing History
Returns time-series supply/demand, pricing percentiles, and performance stats for one or more GPU types over a specified time range.
curl --request GET \
--url https://console.vast.ai/api/v0/metrics/gpu/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.vast.ai/api/v0/metrics/gpu/history"
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/metrics/gpu/history', 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/metrics/gpu/history",
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/metrics/gpu/history"
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/metrics/gpu/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.vast.ai/api/v0/metrics/gpu/history")
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,
"needs_machine": true,
"gpus": {}
}{
"error": "<string>",
"msg": "<string>"
}{
"error": "<string>",
"msg": "<string>"
}Authorizations
API key must be provided in the Authorization header
Query Parameters
Comma-separated GPU names (e.g. "RTX 4090, H100_SXM") or "all". Defaults to RTX 5090, 4090, and 3090.
"RTX 4090"
Filter by verification status
yes, no, all Filter by hosting type
all, secure_cloud, community GPU count bucket or "all"
Unix timestamp for range start
Unix timestamp for range end
Seconds between data points (e.g. 3600 for hourly)
Response
Success. Returns {success: true, gpus: {<gpu_name>: {supply_demand: {timestamps, rented_verified, avail_verified, rented_unverified, avail_unverified, total}, pricing: {timestamps, rented_p10, rented_median, rented_p90, avail_p10, avail_median, avail_p90}, stats: {tflops, dlperf, tflops_per_dollar, dlperf_per_dollar}}}}. Returns needs_machine: true with empty gpus if host has no active machines.