curl --request GET \
--url https://console.vast.ai/api/v0/host/sla_backtest \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.vast.ai/api/v0/host/sla_backtest"
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/host/sla_backtest', 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/host/sla_backtest",
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/host/sla_backtest"
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/host/sla_backtest")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.vast.ai/api/v0/host/sla_backtest")
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,
"machine_id": 123,
"has_data": true,
"start_day": 123,
"end_day": 123,
"covered_days": 123,
"skipped_days": 123,
"reliability": 123,
"fleet_reliability": 123,
"params": {
"r": 123,
"p": 123,
"sigma_x": 123,
"reliability": 123,
"beta": 123
},
"daily_results": [
{
"day": 123,
"gpu": 123,
"storage": 123,
"bandwidth": 123,
"uptime": 123,
"sla": 123,
"historical_sla": 123
}
],
"summary": {
"total_gpu": 123,
"total_storage": 123,
"total_bandwidth": 123,
"total_sla": 123,
"total_earnings": 123,
"total_historical_sla": 123,
"worst_day_loss": 123,
"reserve": 123
}
}{
"error": "invalid_range",
"msg": "<string>"
}{
"error": "not_owner"
}{
"error": "machine_not_found"
}sla backtest
Replays a machine’s historical compute earnings and uptime through SLA settlement math to preview SLA charges and credits before listing with SLA. The maximum date range is 366 days (inclusive); the default lookback is 90 days when custom dates are omitted.
Requires machine_read permission. See SLA Earnings Backtester for usage guide.
curl --request GET \
--url https://console.vast.ai/api/v0/host/sla_backtest \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.vast.ai/api/v0/host/sla_backtest"
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/host/sla_backtest', 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/host/sla_backtest",
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/host/sla_backtest"
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/host/sla_backtest")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.vast.ai/api/v0/host/sla_backtest")
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,
"machine_id": 123,
"has_data": true,
"start_day": 123,
"end_day": 123,
"covered_days": 123,
"skipped_days": 123,
"reliability": 123,
"fleet_reliability": 123,
"params": {
"r": 123,
"p": 123,
"sigma_x": 123,
"reliability": 123,
"beta": 123
},
"daily_results": [
{
"day": 123,
"gpu": 123,
"storage": 123,
"bandwidth": 123,
"uptime": 123,
"sla": 123,
"historical_sla": 123
}
],
"summary": {
"total_gpu": 123,
"total_storage": 123,
"total_bandwidth": 123,
"total_sla": 123,
"total_earnings": 123,
"total_historical_sla": 123,
"worst_day_loss": 123,
"reserve": 123
}
}{
"error": "invalid_range",
"msg": "<string>"
}{
"error": "not_owner"
}{
"error": "machine_not_found"
}Authorizations
API key must be provided in the Authorization header
Query Parameters
ID of your machine.
Reliability level to simulate (greater than 0 and at most 0.9999). Used as both claim and client target in the simulation. Exactly 1.0 is rejected.
0 < x <= 0.9999Host confidence (greater than 0 and less than 1). Maps to sla_sigma_x when listing. Default 0.6667 (normal).
0 < x < 1Range start as Unix epoch seconds. Default is 90 days before end_date.
Range end as Unix epoch seconds. Default is now.
Optional flat uptime override (greater than 0 and at most 1) for all replayed days. Exactly 0 is rejected.
0 < x <= 1Timescale mix used in settlement simulation. Not user-configurable for host API keys —
the API derives weighting from r (recent vs longer-term uptime). Omit this parameter.
Response
Successful response
false when no days in the range had earnings to replay.
UTC day index (days since 1970-01-01).
UTC day index (days since 1970-01-01).
Average reliability across your machines (including this one). Context only.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes