Vast.ai API
Volumes
list volumes
1 min
code examples curl location 'https //console vast ai/api/v0/volumes/' \\ \ header 'accept application/json' \\ \ header 'content type application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var requestoptions = { method 'get', headers myheaders, redirect 'follow' }; fetch("https //console vast ai/api/v0/volumes/", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //console vast ai/api/v0/volumes/") https = net http new(url host, url port) https use ssl = true request = net http get new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" response = https request(request) puts response read body import requests import json url = "https //console vast ai/api/v0/volumes/" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses // success response { "volumes" \[ { "instances" \[ {} ], "driver version" "", "cuda max good" 0, "machine id" 0, "public ipaddr" "", "reliability2" 0, "host id" 0, "cpu name" "", "mobo name" "", "disk space" 0, "disk name" "", "inet up" 0, "inet down" 0, "storage total cost" 0, "os version" "", "verification" "", "static ip" false, "cpu arch" "", "start date" 0, "id" 0, "status" "" } ] }// unauthorized { "detail" "authentication credentials were not provided " }// too many requests { "detail" "api requests too frequent endpoint threshold=5 5" }