Account
API keys
Rent, read and stop machines from code.
Create a key under API keys. It is shown once; store it like a password, for example in an environment variable:
export GPUVOX_KEY=vox_...
curl -H "Authorization: Bearer $GPUVOX_KEY" https://gpuvox.com/api/v1/accountReading the catalogue and prices needs no key. Everything that touches your account does.
Rent, wait, stop
import os, time, requests
API = "https://gpuvox.com/api/v1"
H = {"Authorization": f"Bearer {os.environ['GPUVOX_KEY']}"}
offer = requests.get(f"{API}/offers", params={"gpu": "4090", "limit": 1}).json()["offers"][0]
rental = requests.post(f"{API}/rentals", headers=H, json={
"offerId": offer["id"],
"image": "pytorch",
"sshKey": open(os.path.expanduser("~/.ssh/id_ed25519.pub")).read().strip(),
}).json()
while rental["status"] == "provisioning":
time.sleep(10)
rental = requests.get(f"{API}/rentals/{rental['id']}", headers=H).json()
print(rental["ssh"]["command"])
# ... work ...
requests.delete(f"{API}/rentals/{rental['id']}", headers=H)Errors
| Status | Meaning | What to do |
|---|---|---|
401 | No valid key | Check the header; the key may have been revoked |
402 | Not enough credit for one hour | Add credit under Billing |
404 on rent | The machine was just taken | Pick another offer and try again |
Every endpoint is in the API reference. Revoking a key stops it working at once; machines it started keep running until you stop them.