Skip to Content
gpuvoxDocumentation
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/account

Reading 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

StatusMeaningWhat to do
401No valid keyCheck the header; the key may have been revoked
402Not enough credit for one hourAdd credit under Billing
404 on rentThe machine was just takenPick 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.