Open in AI

Ordering with an agent

Give a key the read, credentials, order and topup scopes and ask: “Get me a Windows server in Frankfurt for MetaTrader.” The agent calls list_plans, checks get_account, tops up with create_topup_invoice if needed and asks you to pay, then order_server, and polls get_server until it can hand you the IP and login.

The same in Python

import os, time, requests

API = "https://rdp.vision/api/v1"
H = {"Authorization": f"Bearer {os.environ['RDPVISION_KEY']}"}

server = requests.post(f"{API}/orders", headers=H, json={
    "plan_id": 1, "region_id": 10, "distro_id": 2, "duration": 1,   # Windows, Frankfurt, Server 2022
}).json()

while True:
    s = requests.get(f"{API}/servers/{server['id']}", headers=H).json()
    if s["status"] == "running" and not s.get("setup"):
        break
    time.sleep(30)

print(s["ip_address"], s["username"], s["password"])