Virtual Servers
Authenticate to the API
class Authentication:
@staticmethod
def log_in(username, password):
# Log in to get a JWT token (expires in 12 hours)
response = requests.post(
"https://api.computex.ai/api/v1/users/login",
headers={"accept": "application/json",
"Content-Type": "application/json"
},
json={"email": username, "password": password},
)
if response.status_code != 200:
raise Exception("Log in failed.")
token = response.json()["token"]
return token
@staticmethod
def generate_headers(token):
headers = {
"accept": "application/json",
"Authorization": f"Bearer {token}"
}
return headersSet the build configuration
Available GPUs:
Get the external IP address
Last updated