get endpoint workers
curl --request POST \
--url https://run.vast.ai/get_endpoint_workers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": 12345
}'import requests
url = "https://run.vast.ai/get_endpoint_workers"
payload = { "id": 12345 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: 12345})
};
fetch('https://run.vast.ai/get_endpoint_workers', 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://run.vast.ai/get_endpoint_workers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 12345
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://run.vast.ai/get_endpoint_workers"
payload := strings.NewReader("{\n \"id\": 12345\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://run.vast.ai/get_endpoint_workers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 12345\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://run.vast.ai/get_endpoint_workers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 12345\n}"
response = http.request(request)
puts response.read_body[
{
"id": 67890,
"gpu_name": "RTX 4090",
"num_gpus": 1,
"perf": 812.4,
"measured_perf": 830.1,
"reliability": 0.98,
"dlperf": 105.6,
"cur_perf": 640.2,
"new_load": 0,
"cur_load": 1500,
"cur_load_rolling_avg": 580.7,
"reqs_working": 3,
"loaded_at": 1760000000,
"ready_ever": true,
"started_at": 1759999700,
"disk_usage": 16.2,
"status": "idle",
"available": true,
"outdated": false,
"hidden": false,
"contract_end_date": 0,
"replaces_worker_id": 0
}
]Serverless
get endpoint workers
Retrieves the current list and status of workers for a specific endpoint. Useful for monitoring, debugging connectivity issues, and understanding resource usage.
The response is a JSON array with one object per worker. To receive the same data as a push stream instead of polling, see Streaming Worker Status.
CLI Usage: vastai get endpt-workers <id>
POST
/
get_endpoint_workers
get endpoint workers
curl --request POST \
--url https://run.vast.ai/get_endpoint_workers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": 12345
}'import requests
url = "https://run.vast.ai/get_endpoint_workers"
payload = { "id": 12345 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: 12345})
};
fetch('https://run.vast.ai/get_endpoint_workers', 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://run.vast.ai/get_endpoint_workers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 12345
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://run.vast.ai/get_endpoint_workers"
payload := strings.NewReader("{\n \"id\": 12345\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://run.vast.ai/get_endpoint_workers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": 12345\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://run.vast.ai/get_endpoint_workers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 12345\n}"
response = http.request(request)
puts response.read_body[
{
"id": 67890,
"gpu_name": "RTX 4090",
"num_gpus": 1,
"perf": 812.4,
"measured_perf": 830.1,
"reliability": 0.98,
"dlperf": 105.6,
"cur_perf": 640.2,
"new_load": 0,
"cur_load": 1500,
"cur_load_rolling_avg": 580.7,
"reqs_working": 3,
"loaded_at": 1760000000,
"ready_ever": true,
"started_at": 1759999700,
"disk_usage": 16.2,
"status": "idle",
"available": true,
"outdated": false,
"hidden": false,
"contract_end_date": 0,
"replaces_worker_id": 0
}
]Body
application/json
Response
200 - application/json
Successfully retrieved endpoint workers.
- Success - Workers Retrieved · object[]
- Error Response · object
Current worker state. See Worker States.
Available options:
pending, creating, created, loading, model_loading, idle, starting, stopping, stopped, rebooting, unavail, offline, error, destroying, update_ready, update_rebooting, update_starting, unknown Example:
"idle"