# Services

> Your VPS, Dedicated and proxy services.

Source: https://docs.clouduxe.com/api/reference/services/

Base URL: `https://api.clouduxe.com/v1`. Generated from the API contract, version 2026-12-01.

## The Service object

A VPS, a Dedicated server or a protected proxy on your account.

### Attributes

- `object` (string, required): The object's type. Always "service".
- `id` (string (uuid), required): The service's id.
- `type` (string, required): vps, dedicated or proxy. One of `vps`, `dedicated`, `proxy`.
- `status` (string, required): pending (paid and waiting for set-up to start), provisioning, active, suspended, failed (set-up failed; staff are on it), terminating (deletion scheduled at deletesAt) or terminated. One of `pending`, `provisioning`, `active`, `suspended`, `failed`, `terminating`, `terminated`.
- `suspensionReason` (string or null, required): Why the service is suspended: overdue (an unpaid invoice) or other (contact support). Null unless suspended. One of `overdue`, `other`.
- `deletesAt` (string (date-time) or null, required): When a terminating service's server will be deleted, or null.
- `planId` (string, required): The plan's id.
- `planName` (string or null, required): The plan's name.
- `region` (string or null, required): The region, or null for a proxy. One of `mumbai`, `singapore`, `limburg`.
- `label` (string or null, required): Your label for the service. max length 253.
- `reference` (string or null, required): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100.
- `metadata` (object, required): Your own key-value data on this object. max 20 keys.
- `firewallAvailable` (boolean, required): True when the service has a Shield firewall you can manage through the firewall operations.
- `billing` (object or null, required): Billing details, for the account owner's tokens. Null for a delegate's token.
  - `cycleMonths` (integer, required): The billing cycle in months.
  - `price` (object or null, required): The renewal price per cycle, excluding GST, locked when the service was bought. Null when it cannot be read.
    - `amount` (integer, required): The amount in the currency's smallest unit. For INR and USD that is one hundredth of the unit. min -9007199254740991, max 9007199254740991.
    - `currency` (string, required): The ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$.
  - `currentPeriodStart` (string (date), required): The first day of the current period, a UTC calendar day.
  - `paidThrough` (string (date), required): The last day paid for, a UTC calendar day. The renewal invoice for the next period is issued before it.
  - `cancelAtPeriodEnd` (boolean, required): True when the service will end on paidThrough instead of renewing.
  - `endsOn` (string (date) or null, required): The day the service ends, when cancelAtPeriodEnd is true; otherwise null.
- `server` (object or null, required): For vps and dedicated; null for proxy.
  - `powerState` (string, required): running, stopped, building (being built or reinstalled), suspended, missing (the server cannot be found; staff are notified) or unknown. One of `running`, `stopped`, `building`, `suspended`, `missing`, `unknown`.
  - `hostname` (string or null, required): The hostname you set at order or reinstall.
  - `ipv4` (array of string, required): The server's IPv4 addresses, primary first.
  - `ipv6` (array of string, required): The server's IPv6 addresses.
  - `image` (object or null, required): The installed image, or null when not known.
    - `object` (string, required): The object's type. Always "image".
    - `id` (string, required): The image's id. Pass it as imageId.
    - `name` (string, required): The image's name, for showing to people.
    - `family` (string, required): linux or windows. A root password reset sets the password of Administrator on windows and of root otherwise. One of `linux`, `windows`.
  - `resources` (object or null, required): The server's resources, or null when not known.
    - `cpuCores` (integer or null, required): Virtual CPU cores, or null when not known.
    - `memoryMb` (integer or null, required): Memory in MiB, or null.
    - `diskGb` (integer or null, required): Disk in GB, or null.
    - `trafficGb` (integer or null, required): Monthly traffic allowance in GB, or null for unmetered or unknown.
  - `statusUpdatedAt` (string (date-time) or null, required): When this state was read.
  - `stale` (boolean, required): True when the state is more than 5 minutes old.
- `proxy` (object or null, required): For proxy; null otherwise.
  - `profile` (string, required): The protection profile.
  - `ports` (array of ProxyPort, required): The protected ports.
    - `protocol` (string, required): tcp or udp. One of `tcp`, `udp`.
    - `portStart` (integer, required): The first port. min 1, max 65535.
    - `portEnd` (integer, required): The last port, equal to portStart for one port. min 1, max 65535.
- `createdAt` (string (date-time), required): When the service was created.
- `livemode` (boolean, required): True for objects of your live account.

### Example

```json
{
  "object": "service",
  "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d",
  "type": "vps",
  "status": "active",
  "suspensionReason": null,
  "deletesAt": null,
  "planId": "vps-nvme-4-mumbai",
  "planName": "NVMe VPS 4 GB",
  "region": "mumbai",
  "label": "node1",
  "reference": "client-4471",
  "metadata": {
    "whmcsServiceId": "18342",
    "plan": "starter"
  },
  "firewallAvailable": true,
  "billing": {
    "cycleMonths": 1,
    "price": {
      "amount": 129900,
      "currency": "INR"
    },
    "currentPeriodStart": "2026-12-04",
    "paidThrough": "2027-01-03",
    "cancelAtPeriodEnd": false,
    "endsOn": null
  },
  "server": {
    "powerState": "running",
    "hostname": "node1.acme.example",
    "ipv4": [
      "203.0.113.24"
    ],
    "ipv6": [
      "2001:db8:4f2a::24"
    ],
    "image": {
      "object": "image",
      "id": "ubuntu-24.04",
      "name": "Ubuntu 24.04 LTS",
      "family": "linux"
    },
    "resources": {
      "cpuCores": 2,
      "memoryMb": 4096,
      "diskGb": 80,
      "trafficGb": 4000
    },
    "statusUpdatedAt": "2026-12-04T10:02:41Z",
    "stale": false
  },
  "proxy": null,
  "createdAt": "2026-12-04T09:15:24Z",
  "livemode": true
}
```

## List services

`GET /services`

Use this to find services, newest first: filter by type, status, region, reference or metadata. A delegate's token lists only the services shared with that person.

Token scope: `services:read`.

### Query parameters

- `limit` (integer): How many objects to return, 1 to 100. Default 20. Default `20`. min 1, max 100.
- `cursor` (string): The nextCursor of the previous page. Valid for 24 hours, with the same filters. max length 512.
- `type` (string): Only this product type. One of `vps`, `dedicated`, `proxy`.
- `status` (string): Only this status. One of `pending`, `provisioning`, `active`, `suspended`, `failed`, `terminating`, `terminated`.
- `region` (string): Only this region. One of `mumbai`, `singapore`, `limburg`.
- `reference` (string): Only objects with exactly this reference. max length 100.

### Headers

- `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$.

### Responses

- `200`: A page of services.
- `400`: The request is not valid. Codes: cursor_invalid, version_invalid, parameter_invalid.
- `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked.
- `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing.
- `429`: A rate limit was reached. Codes: rate_limited.
- `500`: Unexpected error. Codes: internal_error.
- `503`: Temporarily unavailable. Codes: unavailable.

### Request

curl:
```bash
curl https://api.clouduxe.com/v1/services \
  -H "Authorization: Bearer $CLOUDUXE_API_KEY"
```

Node SDK:
```javascript
import { Clouduxe } from "@clouduxe/sdk";

const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY });

for await (const service of cx.services.list()) {
  console.log(service.id);
}
```

Python:
```python
import os
import requests

res = requests.get(
    "https://api.clouduxe.com/v1/services",
    headers={
        "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}",
    },
)
page = res.json()
```

PHP SDK:
```php
<?php
require 'vendor/autoload.php';

$cx = new \Clouduxe\Clouduxe(['apiKey' => getenv('CLOUDUXE_API_KEY')]);

foreach ($cx->services->list() as $service) {
    echo $service->id, PHP_EOL;
}
```

fetch:
```javascript
const res = await fetch("https://api.clouduxe.com/v1/services", {
  headers: {
    Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`,
  },
});
const page = await res.json();
```

### Response (`200`)

```json
{
  "object": "list",
  "data": [
    {
      "object": "service",
      "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d",
      "type": "vps",
      "status": "active",
      "suspensionReason": null,
      "deletesAt": null,
      "planId": "vps-nvme-4-mumbai",
      "planName": "NVMe VPS 4 GB",
      "region": "mumbai",
      "label": "node1",
      "reference": "client-4471",
      "metadata": {
        "whmcsServiceId": "18342",
        "plan": "starter"
      },
      "firewallAvailable": true,
      "billing": {
        "cycleMonths": 1,
        "price": {
          "amount": 129900,
          "currency": "INR"
        },
        "currentPeriodStart": "2026-12-04",
        "paidThrough": "2027-01-03",
        "cancelAtPeriodEnd": false,
        "endsOn": null
      },
      "server": {
        "powerState": "running",
        "hostname": "node1.acme.example",
        "ipv4": [
          "203.0.113.24"
        ],
        "ipv6": [
          "2001:db8:4f2a::24"
        ],
        "image": {
          "object": "image",
          "id": "ubuntu-24.04",
          "name": "Ubuntu 24.04 LTS",
          "family": "linux"
        },
        "resources": {
          "cpuCores": 2,
          "memoryMb": 4096,
          "diskGb": 80,
          "trafficGb": 4000
        },
        "statusUpdatedAt": "2026-12-04T10:02:41Z",
        "stale": false
      },
      "proxy": null,
      "createdAt": "2026-12-04T09:15:24Z",
      "livemode": true
    },
    {
      "object": "service",
      "id": "4e9b2d7a-1c6f-4b3e-a8d2-7f5c0e9a1b4d",
      "type": "dedicated",
      "status": "provisioning",
      "suspensionReason": null,
      "deletesAt": null,
      "planId": "dedicated-e5-64-limburg",
      "planName": "Dedicated E5 64 GB",
      "region": "limburg",
      "label": "db-primary",
      "reference": "client-4471",
      "metadata": {},
      "firewallAvailable": false,
      "billing": {
        "cycleMonths": 1,
        "price": {
          "amount": 1149900,
          "currency": "INR"
        },
        "currentPeriodStart": "2026-12-04",
        "paidThrough": "2027-01-03",
        "cancelAtPeriodEnd": false,
        "endsOn": null
      },
      "server": {
        "powerState": "unknown",
        "hostname": "db1.acme.example",
        "ipv4": [],
        "ipv6": [],
        "image": null,
        "resources": null,
        "statusUpdatedAt": null,
        "stale": false
      },
      "proxy": null,
      "createdAt": "2026-12-03T14:40:05Z",
      "livemode": true
    },
    {
      "object": "service",
      "id": "a7d4c1e9-3f2b-4d8a-9c6e-0b5a2f7d3e1c",
      "type": "proxy",
      "status": "active",
      "suspensionReason": null,
      "deletesAt": null,
      "planId": "proxy-game-standard",
      "planName": "Protected Proxy Standard",
      "region": null,
      "label": "game-proxy",
      "reference": "client-5102",
      "metadata": {},
      "firewallAvailable": false,
      "billing": {
        "cycleMonths": 1,
        "price": {
          "amount": 249900,
          "currency": "INR"
        },
        "currentPeriodStart": "2026-12-04",
        "paidThrough": "2027-01-03",
        "cancelAtPeriodEnd": false,
        "endsOn": null
      },
      "server": null,
      "proxy": {
        "profile": "fivem",
        "ports": [
          {
            "protocol": "tcp",
            "portStart": 30120,
            "portEnd": 30120
          },
          {
            "protocol": "udp",
            "portStart": 30120,
            "portEnd": 30120
          }
        ]
      },
      "createdAt": "2026-11-28T11:02:19Z",
      "livemode": true
    }
  ],
  "hasMore": true,
  "nextCursor": "eyJsIjoic2VydmljZXMiLCJjIjoiMjAyNi0xMi0wNFQwOToxNToyMloifQ.x7Hq2N"
}
```


## Get a service

`GET /services/{serviceId}`

Use this to read a service's status, billing, addresses, power state and resources. The server state comes from a cache refreshed about every minute; stale is true when it is older than 5 minutes.

Token scope: `services:read`.

### Path parameters

- `serviceId` (string (uuid), required): The service's id.

### Headers

- `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$.

### Responses

- `200`: The service.
- `400`: The request is not valid. Codes: version_invalid.
- `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked.
- `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing.
- `404`: Not found. Codes: not_found.
- `429`: A rate limit was reached. Codes: rate_limited.
- `500`: Unexpected error. Codes: internal_error.
- `503`: Temporarily unavailable. Codes: unavailable.

### Request

curl:
```bash
curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d \
  -H "Authorization: Bearer $CLOUDUXE_API_KEY"
```

Node SDK:
```javascript
import { Clouduxe } from "@clouduxe/sdk";

const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY });

const service = await cx.services.get("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d");
```

Python:
```python
import os
import requests

res = requests.get(
    "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d",
    headers={
        "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}",
    },
)
service = res.json()
```

PHP SDK:
```php
<?php
require 'vendor/autoload.php';

$cx = new \Clouduxe\Clouduxe(['apiKey' => getenv('CLOUDUXE_API_KEY')]);

$service = $cx->services->get('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d');
```

fetch:
```javascript
const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", {
  headers: {
    Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`,
  },
});
const service = await res.json();
```

### Response (`200`)

```json
{
  "object": "service",
  "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d",
  "type": "vps",
  "status": "active",
  "suspensionReason": null,
  "deletesAt": null,
  "planId": "vps-nvme-4-mumbai",
  "planName": "NVMe VPS 4 GB",
  "region": "mumbai",
  "label": "node1",
  "reference": "client-4471",
  "metadata": {
    "whmcsServiceId": "18342",
    "plan": "starter"
  },
  "firewallAvailable": true,
  "billing": {
    "cycleMonths": 1,
    "price": {
      "amount": 129900,
      "currency": "INR"
    },
    "currentPeriodStart": "2026-12-04",
    "paidThrough": "2027-01-03",
    "cancelAtPeriodEnd": false,
    "endsOn": null
  },
  "server": {
    "powerState": "running",
    "hostname": "node1.acme.example",
    "ipv4": [
      "203.0.113.24"
    ],
    "ipv6": [
      "2001:db8:4f2a::24"
    ],
    "image": {
      "object": "image",
      "id": "ubuntu-24.04",
      "name": "Ubuntu 24.04 LTS",
      "family": "linux"
    },
    "resources": {
      "cpuCores": 2,
      "memoryMb": 4096,
      "diskGb": 80,
      "trafficGb": 4000
    },
    "statusUpdatedAt": "2026-12-04T10:02:41Z",
    "stale": false
  },
  "proxy": null,
  "createdAt": "2026-12-04T09:15:24Z",
  "livemode": true
}
```


## Update a service

`PATCH /services/{serviceId}`

Use this for your own bookkeeping on a service. It does not change the server.

Token scope: `services:write`.

### Path parameters

- `serviceId` (string (uuid), required): The service's id.

### Headers

- `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$.
- `Idempotency-Key` (string, required): A unique key for this logical request, 1 to 128 characters of letters, digits, underscore, dot, colon or hyphen; a UUID is best. Retrying with the same key is safe: the change happens once and the retry gets the same answer. Keys are kept 48 hours. pattern ^[A-Za-z0-9_.:-]{1,128}$.

### Body (required)

- `label` (string or null): Your label for the service, 1 to 253 characters, or null to clear it. min length 1, max length 253.
- `reference` (string or null): Your own identifier for this object, such as your client's id in your billing system. 1 to 100 printable characters, or null. Not unique: several objects may share one. Filter lists by it with the reference query parameter. min length 1, max length 100.
- `metadata` (object): Metadata keys to set (a string) or remove (null). Keys you leave out are kept. max 20 keys.

### Responses

- `200`: The service.
- `400`: The request is not valid. Codes: metadata_invalid, version_invalid, idempotency_key_required, idempotency_key_invalid, invalid_json, parameter_missing, parameter_invalid, parameter_unknown.
- `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked.
- `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing.
- `404`: Not found. Codes: not_found.
- `409`: The request conflicts with the object's current state. Codes: idempotency_in_progress.
- `413`: The request body is too large. Codes: request_too_large.
- `415`: Unsupported media type. Codes: unsupported_media_type.
- `422`: The request is well formed but cannot be carried out. Codes: idempotency_mismatch.
- `423`: The service is locked. Codes: service_locked.
- `429`: A rate limit was reached. Codes: rate_limited.
- `500`: Unexpected error. Codes: internal_error.
- `503`: Temporarily unavailable. Codes: unavailable, outcome_unknown, limits_unavailable.

### Request

curl:
```bash
curl -X PATCH https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d \
  -H "Authorization: Bearer $CLOUDUXE_API_KEY" \
  -H "Idempotency-Key: 6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f" \
  -H "Content-Type: application/json" \
  -d '{"label":"node1-eu","metadata":{"plan":"pro"}}'
```

Node SDK:
```javascript
import { Clouduxe } from "@clouduxe/sdk";

const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY });

const service = await cx.services.update("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", { label: "node1-eu", metadata: { plan: "pro" } });
```

Python:
```python
import os
import requests

res = requests.patch(
    "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d",
    headers={
        "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}",
        "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f",
    },
    json={
        "label": "node1-eu",
        "metadata": {
            "plan": "pro",
        },
    },
)
service = res.json()
```

PHP SDK:
```php
<?php
require 'vendor/autoload.php';

$cx = new \Clouduxe\Clouduxe(['apiKey' => getenv('CLOUDUXE_API_KEY')]);

$service = $cx->services->update('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d', ['label' => 'node1-eu', 'metadata' => ['plan' => 'pro']]);
```

fetch:
```javascript
const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`,
    "Idempotency-Key": "6f1c2e9a-4b7d-4e3a-9c8f-1a2b3c4d5e6f",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    label: "node1-eu",
    metadata: {
      plan: "pro"
    }
  }),
});
const service = await res.json();
```

### Response (`200`)

```json
{
  "object": "service",
  "id": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d",
  "type": "vps",
  "status": "active",
  "suspensionReason": null,
  "deletesAt": null,
  "planId": "vps-nvme-4-mumbai",
  "planName": "NVMe VPS 4 GB",
  "region": "mumbai",
  "label": "node1-eu",
  "reference": "client-4471",
  "metadata": {
    "whmcsServiceId": "18342",
    "plan": "starter"
  },
  "firewallAvailable": true,
  "billing": {
    "cycleMonths": 1,
    "price": {
      "amount": 129900,
      "currency": "INR"
    },
    "currentPeriodStart": "2026-12-04",
    "paidThrough": "2027-01-03",
    "cancelAtPeriodEnd": false,
    "endsOn": null
  },
  "server": {
    "powerState": "running",
    "hostname": "node1.acme.example",
    "ipv4": [
      "203.0.113.24"
    ],
    "ipv6": [
      "2001:db8:4f2a::24"
    ],
    "image": {
      "object": "image",
      "id": "ubuntu-24.04",
      "name": "Ubuntu 24.04 LTS",
      "family": "linux"
    },
    "resources": {
      "cpuCores": 2,
      "memoryMb": 4096,
      "diskGb": 80,
      "trafficGb": 4000
    },
    "statusUpdatedAt": "2026-12-04T10:02:41Z",
    "stale": false
  },
  "proxy": null,
  "createdAt": "2026-12-04T09:15:24Z",
  "livemode": true
}
```


## List a server's OS images

`GET /services/{serviceId}/images`

Use this before reinstallService to pick an imageId.

Token scope: `services:read`.

### Path parameters

- `serviceId` (string (uuid), required): The service's id.

### Headers

- `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$.

### Responses

- `200`: The images.
- `400`: The request is not valid. Codes: version_invalid.
- `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked.
- `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing.
- `404`: Not found. Codes: not_found.
- `409`: The request conflicts with the object's current state. Codes: service_not_ready.
- `429`: A rate limit was reached. Codes: rate_limited.
- `500`: Unexpected error. Codes: internal_error.
- `503`: Temporarily unavailable. Codes: unavailable.

### Request

curl:
```bash
curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/images \
  -H "Authorization: Bearer $CLOUDUXE_API_KEY"
```

Node SDK:
```javascript
import { Clouduxe } from "@clouduxe/sdk";

const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY });

for await (const image of cx.services.listImages("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d")) {
  console.log(image.id);
}
```

Python:
```python
import os
import requests

res = requests.get(
    "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/images",
    headers={
        "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}",
    },
)
page = res.json()
```

PHP SDK:
```php
<?php
require 'vendor/autoload.php';

$cx = new \Clouduxe\Clouduxe(['apiKey' => getenv('CLOUDUXE_API_KEY')]);

foreach ($cx->services->listImages('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d') as $image) {
    echo $image->id, PHP_EOL;
}
```

fetch:
```javascript
const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/images", {
  headers: {
    Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`,
  },
});
const page = await res.json();
```

### Response (`200`)

```json
{
  "object": "list",
  "data": [
    {
      "object": "image",
      "id": "ubuntu-24.04",
      "name": "Ubuntu 24.04 LTS",
      "family": "linux"
    },
    {
      "object": "image",
      "id": "debian-12",
      "name": "Debian 12",
      "family": "linux"
    },
    {
      "object": "image",
      "id": "windows-server-2022",
      "name": "Windows Server 2022",
      "family": "windows"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}
```


## Get a service's traffic

`GET /services/{serviceId}/usage`

Use this to read traffic used in the current traffic period against the allowance. The traffic period is the server's own monthly traffic cycle, which can differ from its billing period.

Token scope: `services:read`.

### Path parameters

- `serviceId` (string (uuid), required): The service's id.

### Headers

- `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$.

### Responses

- `200`: The usage.
- `400`: The request is not valid. Codes: version_invalid.
- `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked.
- `403`: The token is not allowed to do this. Codes: ip_not_allowed, api_access_disabled, scope_missing.
- `404`: Not found. Codes: not_found.
- `409`: The request conflicts with the object's current state. Codes: service_not_ready.
- `429`: A rate limit was reached. Codes: rate_limited.
- `500`: Unexpected error. Codes: internal_error.
- `503`: Temporarily unavailable. Codes: unavailable.

### Request

curl:
```bash
curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/usage \
  -H "Authorization: Bearer $CLOUDUXE_API_KEY"
```

Node SDK:
```javascript
import { Clouduxe } from "@clouduxe/sdk";

const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY });

const usage = await cx.services.getUsage("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d");
```

Python:
```python
import os
import requests

res = requests.get(
    "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/usage",
    headers={
        "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}",
    },
)
usage = res.json()
```

PHP SDK:
```php
<?php
require 'vendor/autoload.php';

$cx = new \Clouduxe\Clouduxe(['apiKey' => getenv('CLOUDUXE_API_KEY')]);

$usage = $cx->services->getUsage('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d');
```

fetch:
```javascript
const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/usage", {
  headers: {
    Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`,
  },
});
const usage = await res.json();
```

### Response (`200`)

```json
{
  "object": "usage",
  "serviceId": "c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d",
  "periodStart": "2026-12-04",
  "periodEnd": "2027-01-03",
  "inboundBytes": 48213904512,
  "outboundBytes": 311420019712,
  "allowanceBytes": 4000000000000,
  "updatedAt": "2026-12-04T10:02:41Z"
}
```


## List plan change options

`GET /services/{serviceId}/plan-options`

Use this before changeServicePlan: each option has its price per cycle and what changing now costs.

Token scope: `services:read`.

### Path parameters

- `serviceId` (string (uuid), required): The service's id.

### Headers

- `Clouduxe-Version` (string): The API version to use, such as 2026-12-01. Omit it to use your token's version. pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2}$.

### Responses

- `200`: The options.
- `400`: The request is not valid. Codes: version_invalid.
- `401`: Authentication failed. Codes: token_missing, token_invalid, token_expired, token_revoked.
- `403`: The token is not allowed to do this. Codes: forbidden, ip_not_allowed, api_access_disabled, scope_missing.
- `404`: Not found. Codes: not_found.
- `423`: The service is locked. Codes: service_locked.
- `429`: A rate limit was reached. Codes: rate_limited.
- `500`: Unexpected error. Codes: internal_error.
- `503`: Temporarily unavailable. Codes: unavailable.

### Request

curl:
```bash
curl https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/plan-options \
  -H "Authorization: Bearer $CLOUDUXE_API_KEY"
```

Node SDK:
```javascript
import { Clouduxe } from "@clouduxe/sdk";

const cx = new Clouduxe({ apiKey: process.env.CLOUDUXE_API_KEY });

for await (const planOption of cx.services.listPlanOptions("c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d")) {
  console.log(planOption.id);
}
```

Python:
```python
import os
import requests

res = requests.get(
    "https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/plan-options",
    headers={
        "Authorization": f"Bearer {os.environ['CLOUDUXE_API_KEY']}",
    },
)
page = res.json()
```

PHP SDK:
```php
<?php
require 'vendor/autoload.php';

$cx = new \Clouduxe\Clouduxe(['apiKey' => getenv('CLOUDUXE_API_KEY')]);

foreach ($cx->services->listPlanOptions('c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d') as $planOption) {
    echo $planOption->id, PHP_EOL;
}
```

fetch:
```javascript
const res = await fetch("https://api.clouduxe.com/v1/services/c3a1f6d2-8b4e-4a9c-b7d5-2e1f0a3c6b8d/plan-options", {
  headers: {
    Authorization: `Bearer ${process.env.CLOUDUXE_API_KEY}`,
  },
});
const page = await res.json();
```

### Response (`200`)

```json
{
  "object": "list",
  "data": [
    {
      "object": "plan_option",
      "planId": "vps-nvme-8-mumbai",
      "name": "NVMe VPS 8 GB",
      "kind": "upgrade",
      "price": {
        "amount": 239900,
        "currency": "INR"
      },
      "charge": {
        "amount": 106400,
        "currency": "INR"
      }
    }
  ],
  "hasMore": false,
  "nextCursor": null
}
```
