Skip to main content
import requests

BASE_URL = "https://api.session-generator.com/api/v1"
API_KEY = "API_KEY" #Specify the key from the dashboard

headers = {
    "SESSION-GEN-API-Key": API_KEY
}

def buy_sessions(count: int):
    print(f"--- Buying sessions ({count}) ---")
    params = {"count": count}
    response = requests.get(f"{BASE_URL}/get-sessions", headers=headers, params=params)
    print(f"Status: {response.status_code}")
    print(f"Response: {response.json()}\n")

if __name__ == "__main__":
    buy_sessions(1) #Specify the required number of sessions