Vast.ai API
Billing
show earnings
1min
code examples curl location globoff 'https //console vast ai/api/v0/users/{user id}/machine earnings/' \\ \ 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/users/{user id}/machine earnings/", 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/users/{user id}/machine earnings/") 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/users/{user id}/machine earnings/" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses // success response { "summary" { "total gpu" 0, "total stor" 0, "total bwu" 0, "total bwd" 0 }, "username" "", "email" "", "fullname" "", "address1" "", "address2" "", "city" "", "zip" "", "country" "", "taxinfo" "", "current" { "balance" 0, "service fee" 0, "total" 0, "credit" 0 }, "per machine" \[ { "machine id" 0, "gpu earn" 0, "sto earn" 0, "bwu earn" 0, "bwd earn" 0 } ], "per day" \[ { "day" 0, "gpu earn" 0, "sto earn" 0, "bwu earn" 0, "bwd earn" 0 } ] }// bad request invalid input syntax { "success" false, "error" "", "msg" "" }// too many requests { "detail" "api requests too frequent endpoint threshold=2 0" }