{
    "openapi": "3.0.3",
    "info": {
        "title": "SKYHOSTVPS API",
        "version": "1.2",
        "description": "Sell and run SKYHOSTVPS servers from your own website. Every call acts as the account that owns the API key."
    },
    "servers": [
        {
            "url": "https://www.sonovpswala.skyhostvps.com/api/v1"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        },
        {
            "apiKeyHeader": []
        }
    ],
    "tags": [
        {
            "name": "Account",
            "description": "Check that a key works and how much is in your wallet."
        },
        {
            "name": "Catalogue",
            "description": "What is on sale at your prices, and what each plan can be ordered with. All work with a read-only key."
        },
        {
            "name": "Orders",
            "description": "Quote first, order with an Idempotency-Key, then follow the order until it is active. Orders are paid from your wallet."
        },
        {
            "name": "Servers",
            "description": "Read, power, reinstall, rename and renew the servers you own. A server on another account always answers 404."
        }
    ],
    "paths": {
        "/": {
            "get": {
                "operationId": "apiRoot",
                "summary": "API information",
                "description": "The API name, version and the address of these docs. Needs no key; use it as a health check.",
                "tags": [
                    "Account"
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "name": "SKYHOSTVPS API",
                                        "version": 1,
                                        "docs": "https://skyhostvps.com/api-access"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "security": []
            }
        },
        "/account": {
            "get": {
                "operationId": "getAccount",
                "summary": "Retrieve your account",
                "description": "Your name, email, wallet balance and the key making the call. Check `balance` before ordering to avoid a 402.",
                "tags": [
                    "Account"
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": 378,
                                        "name": "Rahul Sharma",
                                        "email": "rahul@example.com",
                                        "balance": 10000,
                                        "currency": "INR",
                                        "key": {
                                            "name": "My website",
                                            "access": "full"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/networks": {
            "get": {
                "operationId": "listNetworks",
                "summary": "List networks",
                "description": "The networks you can order from. Pass an `id` as `network` to List plans.",
                "tags": [
                    "Catalogue"
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "networks": [
                                            {
                                                "id": "primary",
                                                "label": "Server 1"
                                            },
                                            {
                                                "id": "server2",
                                                "label": "Server 2"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/plans": {
            "get": {
                "operationId": "listPlans",
                "summary": "List plans",
                "description": "Plans on sale with your monthly price. Prices and stock are refreshed from each network every few minutes: cache the list for up to 5 minutes and quote before ordering.",
                "tags": [
                    "Catalogue"
                ],
                "parameters": [
                    {
                        "name": "os",
                        "in": "query",
                        "required": false,
                        "description": "`LINUX` (default) or `WINDOWS`.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "network",
                        "in": "query",
                        "required": false,
                        "description": "`all` (default) or a network `id`.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "os": "LINUX",
                                        "plans": [
                                            {
                                                "id": "djF8cHJpbWFyeXwxfFNIQVJFRHwxfDF8MXwxfExJTlVYfA",
                                                "network": "primary",
                                                "networkLabel": "Server 1",
                                                "name": "Linux · 2 GB",
                                                "os": "LINUX",
                                                "type": "shared",
                                                "ipSeries": "103.45.12",
                                                "location": "",
                                                "cores": 2,
                                                "ramMb": 2048,
                                                "ram": "2 GB",
                                                "disk": "40GB-Nvme-SSD",
                                                "bandwidth": "5TB",
                                                "monthlyPrice": 424.80000000000001136868377216160297393798828125,
                                                "listPrice": null,
                                                "sellerDiscount": null,
                                                "currency": "INR",
                                                "stock": null,
                                                "ipChoosable": false,
                                                "terms": null,
                                                "maxQuantity": null,
                                                "note": null
                                            }
                                        ],
                                        "unavailableNetworks": []
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/plans/{plan}/images": {
            "get": {
                "operationId": "planImages",
                "summary": "List plan images",
                "description": "The operating systems a plan can be ordered with. Pass an `id` as `image` when ordering.",
                "tags": [
                    "Catalogue"
                ],
                "parameters": [
                    {
                        "name": "plan",
                        "in": "path",
                        "required": true,
                        "description": "A plan `id`.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "images": [
                                            {
                                                "id": 1,
                                                "name": "DEBIAN-11.11"
                                            },
                                            {
                                                "id": 2,
                                                "name": "UBUNTU-22"
                                            },
                                            {
                                                "id": 5,
                                                "name": "ALMALINUX-10.1"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/plans/{plan}/ips": {
            "get": {
                "operationId": "planIps",
                "summary": "List free IPs",
                "description": "Free IPv4 addresses the buyer may choose from, for plans with `ipChoosable: true`. Other plans answer with an empty list and `choosable: false`. An address is checked again when you order.",
                "tags": [
                    "Catalogue"
                ],
                "parameters": [
                    {
                        "name": "plan",
                        "in": "path",
                        "required": true,
                        "description": "A plan `id`.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "ips": [
                                            "213.210.11.98",
                                            "213.210.11.99",
                                            "213.210.11.100"
                                        ],
                                        "choosable": true,
                                        "stillLoading": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/quote": {
            "post": {
                "operationId": "quoteOrder",
                "summary": "Quote an order",
                "description": "Prices an order without placing it, coupon included, and returns your wallet balance. Charges nothing and works with a read-only key.",
                "tags": [
                    "Orders"
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "subtotal": 2548.8000000000001818989403545856475830078125,
                                        "discount": 0,
                                        "total": 2548.8000000000001818989403545856475830078125,
                                        "currency": "INR",
                                        "summary": "2× 2 vCPU · 2 GB RAM · 40GB-Nvme-SSD · 5TB bandwidth · 3 months",
                                        "balance": 10000
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "plan": {
                                        "type": "string",
                                        "description": "A plan `id` from List plans."
                                    },
                                    "image": {
                                        "type": "integer",
                                        "description": "An image `id` from List plan images."
                                    },
                                    "months": {
                                        "type": "integer",
                                        "description": "Billing term, 1 to 36. Default 1. Some plans sell only certain terms."
                                    },
                                    "quantity": {
                                        "type": "integer",
                                        "description": "Number of servers, 1 to 50. Default 1. Some plans allow fewer at once."
                                    },
                                    "ip": {
                                        "type": "string",
                                        "description": "An exact free IPv4 address from List free IPs. Only for plans with `ipChoosable: true`."
                                    },
                                    "coupon": {
                                        "type": "string",
                                        "description": "A coupon code. An invalid code is refused with its reason."
                                    }
                                },
                                "required": [
                                    "plan",
                                    "image"
                                ]
                            },
                            "example": {
                                "plan": "djF8cHJpbWFyeXwxfFNIQVJFRHwxfDF8MXwxfExJTlVYfA",
                                "image": 1,
                                "months": 3,
                                "quantity": 2
                            }
                        }
                    }
                }
            }
        },
        "/orders": {
            "post": {
                "operationId": "createOrder",
                "summary": "Create an order",
                "description": "Charges your wallet and creates the servers during the call, so allow up to 180 seconds. Send an `Idempotency-Key` header: a repeat with the same key returns the first order with `\"repeated\": true` instead of buying again.",
                "tags": [
                    "Orders"
                ],
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Your own unique order number, 8 to 80 letters, digits, dots, colons, dashes or underscores. Strongly recommended.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Your server is ready.",
                                    "data": {
                                        "order": {
                                            "reference": "AJORD-261003-70B8FC32",
                                            "status": "active",
                                            "plan": "2 vCPU · 2 GB RAM · 40GB-Nvme-SSD · 5TB bandwidth",
                                            "os": "DEBIAN-11.11",
                                            "months": 1,
                                            "quantity": 1,
                                            "total": 424.80000000000001136868377216160297393798828125,
                                            "currency": "INR",
                                            "createdAt": "2026-10-03T10:00:14+05:30",
                                            "message": null,
                                            "servers": [
                                                {
                                                    "id": 450,
                                                    "name": "vps-70b8fc32",
                                                    "ip": "103.45.12.11",
                                                    "status": "active",
                                                    "expiresAt": "2026-11-03T10:00:14+05:30"
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "plan": {
                                        "type": "string",
                                        "description": "A plan `id` from List plans."
                                    },
                                    "image": {
                                        "type": "integer",
                                        "description": "An image `id` from List plan images."
                                    },
                                    "months": {
                                        "type": "integer",
                                        "description": "Billing term, 1 to 36. Default 1. Some plans sell only certain terms."
                                    },
                                    "quantity": {
                                        "type": "integer",
                                        "description": "Number of servers, 1 to 50. Default 1. Some plans allow fewer at once."
                                    },
                                    "ip": {
                                        "type": "string",
                                        "description": "An exact free IPv4 address from List free IPs. Only for plans with `ipChoosable: true`."
                                    },
                                    "coupon": {
                                        "type": "string",
                                        "description": "A coupon code. An invalid code is refused with its reason."
                                    }
                                },
                                "required": [
                                    "plan",
                                    "image"
                                ]
                            },
                            "example": {
                                "plan": "djF8cHJpbWFyeXwxfFNIQVJFRHwxfDF8MXwxfExJTlVYfA",
                                "image": 1,
                                "months": 1,
                                "quantity": 1
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "listOrders",
                "summary": "List orders",
                "description": "Your orders, newest first.",
                "tags": [
                    "Orders"
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number from 1. Default 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "perPage",
                        "in": "query",
                        "required": false,
                        "description": "1 to 100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "orders": [
                                            {
                                                "reference": "AJORD-261003-70B8FC32",
                                                "status": "active",
                                                "plan": "2 vCPU · 2 GB RAM · 40GB-Nvme-SSD · 5TB bandwidth",
                                                "os": "DEBIAN-11.11",
                                                "months": 1,
                                                "quantity": 1,
                                                "total": 424.80000000000001136868377216160297393798828125,
                                                "currency": "INR",
                                                "createdAt": "2026-10-03T10:00:14+05:30",
                                                "message": null,
                                                "servers": [
                                                    {
                                                        "id": 450,
                                                        "name": "vps-70b8fc32",
                                                        "ip": "103.45.12.11",
                                                        "status": "active",
                                                        "expiresAt": "2026-11-03T10:00:14+05:30"
                                                    }
                                                ]
                                            }
                                        ],
                                        "page": 1,
                                        "perPage": 25,
                                        "total": 1
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/orders/{reference}": {
            "get": {
                "operationId": "getOrder",
                "summary": "Retrieve an order",
                "description": "One order with its servers. Poll this every 30 to 60 seconds until `status` is `active` or `refunded`.",
                "tags": [
                    "Orders"
                ],
                "parameters": [
                    {
                        "name": "reference",
                        "in": "path",
                        "required": true,
                        "description": "The order `reference`.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "order": {
                                            "reference": "AJORD-261003-70B8FC32",
                                            "status": "active",
                                            "plan": "2 vCPU · 2 GB RAM · 40GB-Nvme-SSD · 5TB bandwidth",
                                            "os": "DEBIAN-11.11",
                                            "months": 1,
                                            "quantity": 1,
                                            "total": 424.80000000000001136868377216160297393798828125,
                                            "currency": "INR",
                                            "createdAt": "2026-10-03T10:00:14+05:30",
                                            "message": null,
                                            "servers": [
                                                {
                                                    "id": 450,
                                                    "name": "vps-70b8fc32",
                                                    "ip": "103.45.12.11",
                                                    "status": "active",
                                                    "expiresAt": "2026-11-03T10:00:14+05:30"
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/servers": {
            "get": {
                "operationId": "listServers",
                "summary": "List servers",
                "description": "Your servers with their live power state. Terminated servers are not listed.",
                "tags": [
                    "Servers"
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number from 1. Default 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "perPage",
                        "in": "query",
                        "required": false,
                        "description": "1 to 100. Default 25.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Matches a name or IP.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "servers": [
                                            {
                                                "id": 450,
                                                "name": "vps-70b8fc32",
                                                "ip": "103.45.12.11",
                                                "os": "DEBIAN-11.11",
                                                "osFamily": "LINUX",
                                                "plan": "2 vCPU · 2 GB RAM · 40GB-Nvme-SSD · 5TB bandwidth",
                                                "order": "AJORD-261003-70B8FC32",
                                                "status": "active",
                                                "power": "running",
                                                "expiresAt": "2026-11-03T10:00:14+05:30",
                                                "daysLeft": 31,
                                                "monthlyPrice": 424.80000000000001136868377216160297393798828125
                                            }
                                        ],
                                        "page": 1,
                                        "perPage": 25,
                                        "total": 1
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/servers/{id}": {
            "get": {
                "operationId": "getServer",
                "summary": "Retrieve a server",
                "description": "Everything in the list plus specs, the login and the actions this server supports.",
                "tags": [
                    "Servers"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The server `id`, from List servers or an order.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "server": {
                                            "id": 450,
                                            "name": "vps-70b8fc32",
                                            "ip": "103.45.12.11",
                                            "os": "DEBIAN-11.11",
                                            "osFamily": "LINUX",
                                            "plan": "2 vCPU · 2 GB RAM · 40GB-Nvme-SSD · 5TB bandwidth",
                                            "order": "AJORD-261003-70B8FC32",
                                            "status": "active",
                                            "power": "running",
                                            "expiresAt": "2026-11-03T10:00:14+05:30",
                                            "daysLeft": 31,
                                            "monthlyPrice": 424.80000000000001136868377216160297393798828125,
                                            "cores": 2,
                                            "ramMb": 2048,
                                            "ram": "2 GB",
                                            "disk": "40 GB NVMe",
                                            "location": "Germany",
                                            "locked": false,
                                            "username": null,
                                            "password": "sLw5EqO03u0n",
                                            "features": [
                                                "console",
                                                "password",
                                                "rename",
                                                "rebuild",
                                                "network",
                                                "mac"
                                            ],
                                            "renewal": {
                                                "terms": [
                                                    1,
                                                    2,
                                                    3,
                                                    6,
                                                    12
                                                ],
                                                "open": true,
                                                "opensAt": null,
                                                "closesAt": null,
                                                "note": null
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/servers/{id}/images": {
            "get": {
                "operationId": "serverImages",
                "summary": "List reinstall images",
                "description": "Images this server may be reinstalled with. A Linux plan may use Linux only; a Windows plan may use Windows or Linux.",
                "tags": [
                    "Servers"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The server `id`, from List servers or an order.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "images": [
                                            {
                                                "id": 1,
                                                "name": "DEBIAN-11.11",
                                                "family": "LINUX"
                                            },
                                            {
                                                "id": 2,
                                                "name": "UBUNTU-22",
                                                "family": "LINUX"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/servers/{id}/metrics": {
            "get": {
                "operationId": "serverMetrics",
                "summary": "Retrieve usage metrics",
                "description": "Usage now and a series of samples. `time` is a Unix timestamp in seconds. Disk usage reads 0 when the guest agent is not running; `totalBytes` is still correct.",
                "tags": [
                    "Servers"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The server `id`, from List servers or an order.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "period",
                        "in": "query",
                        "required": false,
                        "description": "`hour` (default), `day` or `week`.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "period": "hour",
                                        "uptimeSeconds": 93600,
                                        "cpuPercent": 87.7000000000000028421709430404007434844970703125,
                                        "memory": {
                                            "usedBytes": 2891116202,
                                            "totalBytes": 4294967296,
                                            "percent": 67.31000000000000227373675443232059478759765625
                                        },
                                        "disk": {
                                            "usedBytes": 0,
                                            "totalBytes": 42949672960,
                                            "percent": 0
                                        },
                                        "network": {
                                            "inBytes": 20746,
                                            "outBytes": 1647
                                        },
                                        "series": [
                                            {
                                                "time": 1791001353,
                                                "cpuPercent": 39,
                                                "memoryPercent": 23.3299999999999982946974341757595539093017578125
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/servers/{id}/power": {
            "post": {
                "operationId": "serverPower",
                "summary": "Start, stop or reboot",
                "description": "Sends a power action. The server must be active.",
                "tags": [
                    "Servers"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The server `id`, from List servers or an order.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "VM REBOOT sequence initiated successfully.",
                                    "data": null
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "action": {
                                        "type": "string",
                                        "description": "`start`, `stop` or `reboot`. Some networks also accept `pause`, `hibernate` and `resume`."
                                    }
                                },
                                "required": [
                                    "action"
                                ]
                            },
                            "example": {
                                "action": "reboot"
                            }
                        }
                    }
                }
            }
        },
        "/servers/{id}/reinstall": {
            "post": {
                "operationId": "serverReinstall",
                "summary": "Reinstall the operating system",
                "description": "Erases all data on the server and installs the image. On networks that set a new root password, the reply carries it in `data.password`; otherwise `data` is null and the current password stays valid.",
                "tags": [
                    "Servers"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The server `id`, from List servers or an order.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Rebuild initiated.",
                                    "data": null
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "image": {
                                        "type": "integer",
                                        "description": "An image `id` from List reinstall images."
                                    }
                                },
                                "required": [
                                    "image"
                                ]
                            },
                            "example": {
                                "image": 2
                            }
                        }
                    }
                }
            }
        },
        "/servers/{id}/password": {
            "post": {
                "operationId": "serverPassword",
                "summary": "Set or generate the password",
                "description": "Where `features` lists `password`, send the new password. Where it lists `newpassword`, send an empty body and the network generates one, returned once in `data.password`. The old password stops working at once.",
                "tags": [
                    "Servers"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The server `id`, from List servers or an order.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Password updated successfully.",
                                    "data": null
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "password": {
                                        "type": "string",
                                        "description": "8 to 64 characters. Leave out to have one generated where supported."
                                    }
                                }
                            },
                            "example": {
                                "password": "New-Root-Pass-42"
                            }
                        }
                    }
                }
            }
        },
        "/servers/{id}/rename": {
            "post": {
                "operationId": "serverRename",
                "summary": "Rename a server",
                "description": "Changes the server's hostname. `data.name` is the name now in use.",
                "tags": [
                    "Servers"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The server `id`, from List servers or an order.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "VM renamed successfully",
                                    "data": {
                                        "name": "shop-web-1"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "2 to 64 characters."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            },
                            "example": {
                                "name": "shop-web-1"
                            }
                        }
                    }
                }
            }
        },
        "/servers/{id}/console": {
            "post": {
                "operationId": "serverConsole",
                "summary": "Open a console",
                "description": "A single-use console link that expires once used. Depending on the network you get a browser `url`, or a VNC-over-WebSocket `wsUrl` with its `password` for a noVNC client.",
                "tags": [
                    "Servers"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The server `id`, from List servers or an order.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "url": null,
                                        "wsUrl": "wss://console.example.com/api/ws/vnc?vncToken=…",
                                        "password": "…",
                                        "note": "This console link is single-use and expires as soon as it connects."
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/servers/{id}/renew/quote": {
            "get": {
                "operationId": "renewQuote",
                "summary": "Quote a renewal",
                "description": "Prices a renewal without renewing. `coupon` is null without a code, or carries `APPLIED` or `INVALID` with a message.",
                "tags": [
                    "Servers"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The server `id`, from List servers or an order.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "months",
                        "in": "query",
                        "required": false,
                        "description": "Default 1. 1, 2, 3, 6 or 12 on most networks.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "coupon",
                        "in": "query",
                        "required": false,
                        "description": "A coupon code.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "months": 3,
                                        "monthlyPrice": 424.80000000000001136868377216160297393798828125,
                                        "subtotal": 1274.40000000000009094947017729282379150390625,
                                        "discount": 0,
                                        "total": 1274.40000000000009094947017729282379150390625,
                                        "currency": "INR",
                                        "coupon": null,
                                        "daysRemaining": 31
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/servers/{id}/renew": {
            "post": {
                "operationId": "renew",
                "summary": "Renew a server",
                "description": "Adds months to the server, paid from your wallet. Some networks renew only from 5 days before expiry until 1 day after.",
                "tags": [
                    "Servers"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "The server `id`, from List servers or an order.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Renewed for 3 months.",
                                    "data": {
                                        "expiresAt": "2027-01-03T10:00:14+05:30",
                                        "charged": 1274.40000000000009094947017729282379150390625,
                                        "currency": "INR"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "months": {
                                        "type": "integer",
                                        "description": "1, 2, 3, 6 or 12 on most networks."
                                    },
                                    "coupon": {
                                        "type": "string",
                                        "description": "A coupon code."
                                    }
                                },
                                "required": [
                                    "months"
                                ]
                            },
                            "example": {
                                "months": 3
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "Authorization: Bearer ajv_…"
            },
            "apiKeyHeader": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key"
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "success",
                    "message",
                    "code"
                ],
                "properties": {
                    "success": {
                        "type": "boolean",
                        "example": false
                    },
                    "message": {
                        "type": "string",
                        "example": "Your wallet has ₹9,150.40 and this order costs ₹21,240.00. Add ₹12,089.60 to continue."
                    },
                    "code": {
                        "type": "string",
                        "enum": [
                            "unauthenticated",
                            "insufficient_balance",
                            "read_only",
                            "ip_not_allowed",
                            "forbidden",
                            "not_found",
                            "conflict",
                            "in_progress",
                            "invalid",
                            "rate_limited",
                            "disabled",
                            "unavailable",
                            "server_error"
                        ],
                        "example": "insufficient_balance"
                    }
                }
            }
        }
    }
}