// api reference

Build your own VPS app

Base URL: · All requests and responses are JSON.

🔑 Authentication

API access is granted per account by the owner @khalid_dev. Once enabled you receive a key starting with kx_. Send it on every request:

Authorization: Bearer kx_your_api_key
# or
X-API-Key: kx_your_api_key

Your account must have your Fly.io token linked in the dashboard (Fly Account) — VPS machines are created on your own Fly account. Rate limit: 120 requests / minute per key. Errors return {"detail": "message"} with an HTTP status (401 bad key, 403 no API access, 429 rate limited).

GET/api/v1/me

Your account, Fly link status and VPS quota.

curl /api/v1/me -H "Authorization: Bearer kx_..."

GET/api/v1/options

Allowed regions, CPU counts, RAM (MB) and disk (GB) values.

POST/api/v1/vps

Create a VPS. Returns 202 immediately with status: "DEPLOYING" — poll GET /api/v1/vps/{id} until status is RUNNING (usually 3–5 min). A random suffix is added to name.

curl -X POST /api/v1/vps \
  -H "Authorization: Bearer kx_..." -H "Content-Type: application/json" \
  -d '{
    "name": "my-panel",
    "region": "iad",
    "cpus": 2,
    "memory_mb": 4096,
    "storage_gb": 20
  }'

Allowed: cpus 1, 2, 4, 8, 16 · memory_mb 1024–65536 (powers of two) · storage_gb 1, 3, 5, 10, 20, 40, 50, 100, 200.

# response
{
  "id": 12, "name": "my-panel-a1f3", "status": "DEPLOYING", "region": "iad",
  "cpus": 2, "memory_mb": 4096, "storage_gb": 20,
  "ipv4": null, "ssh": {"host": null, "port": 22, "user": "root", "password": "…"},
  "progress": ["… Queued"], "error": null
}

GET/api/v1/vps

List your VPS machines (without passwords).

GET/api/v1/vps/{id}

Full details including SSH host/port/user/password, deployment progress lines and error if it failed.

POST/api/v1/vps/{id}/refresh

Sync status and IPs from Fly.io.

POST/api/v1/vps/{id}/start · /stop · /restart

Power actions. Call /refresh a few seconds later to see the new state.

DELETE/api/v1/vps/{id}

Destroy the machine, volume and Fly app. Irreversible.

📦 Status values

DEPLOYING · RUNNING · STOPPED · STARTING · STOPPING · RESTARTING · FAILED

🐍 Python example

import requests, time
API = "https://khalidxhost.zone.id/api/v1"
H = {"Authorization": "Bearer kx_your_api_key"}

vps = requests.post(f"{API}/vps", headers=H, json={
    "name": "bot-host", "region": "fra", "cpus": 2, "memory_mb": 4096, "storage_gb": 20
}).json()

while vps["status"] == "DEPLOYING":
    time.sleep(10)
    vps = requests.get(f"{API}/vps/{vps['id']}", headers=H).json()

print(vps["ssh_command"], vps["ssh"]["password"])

Need API access or have a question?

💜 Message @khalid_dev