🔌 Compute API Reference

Base URL: https://dcdncloud.com/api/v1/compute

All endpoints require Authorization: Bearer YOUR_TOKEN unless noted.

Quick Reference

MethodEndpointDescription
GET/plansList available plans
GET/imagesList OS images
GET/regionsList regions with node counts
GET/templatesList deploy templates
GET/instancesList your instances
POST/instancesCreate instance
GET/instances/{id}Get instance details
POST/instances/{id}/startStart stopped instance
POST/instances/{id}/stopStop running instance
POST/instances/{id}/restartRestart instance
POST/instances/{id}/reset-passwordReset root password
POST/instances/{id}/ssh-keyAdd SSH key to instance
DELETE/instances/{id}Destroy instance

Endpoints

GET /plans

Returns all available VPS plans (shared and dedicated).

curl https://dcdncloud.com/api/v1/compute/plans \
  -H "Authorization: Bearer TOKEN"

Response:

{
  "plans": [
    {
      "id": "nano",
      "vcpus": 1,
      "ram_mb": 512,
      "disk_gb": 10,
      "bandwidth_tb": 0.5,
      "price_usd": 2.0,
      "cpu_type": "shared",
      "dedicated_ip": false
    }
  ]
}
GET /images

Returns available OS images (15 images).

curl https://dcdncloud.com/api/v1/compute/images \
  -H "Authorization: Bearer TOKEN"

Response:

{
  "images": [
    {"id": "ubuntu-22.04", "name": "Ubuntu 22.04 LTS"},
    {"id": "debian-12", "name": "Debian 12 (Bookworm)"},
    ...
  ]
}
GET /regions

Returns available regions and node count per region.

curl https://dcdncloud.com/api/v1/compute/regions \
  -H "Authorization: Bearer TOKEN"

Response:

{
  "regions": [
    {"id": "eu-central", "nodes": 2},
    {"id": "eu-west", "nodes": 1},
    {"id": "us-east", "nodes": 1},
    {"id": "us-west", "nodes": 1},
    {"id": "sa-east", "nodes": 3}
  ]
}
POST /instances

Create a new VPS instance.

Request body:

{
  "name": "my-server",        // required, unique per user
  "plan": "s-small",          // required (see /plans)
  "image": "ubuntu-22.04",    // required (see /images)
  "region": "eu-central",     // required (see /regions)
  "cpu_type": "shared",       // optional: "shared" (default) or "dedicated"
  "ssh_keys": ["ssh-ed25519 AAAA..."],  // optional
  "redundant": false          // optional: deploy on 2 nodes
}

Response:

{
  "id": "274e036b-7f26-49db-947e-1f81e67d2630",
  "name": "my-server",
  "status": "creating",
  "plan": "s-small",
  "image": "ubuntu-22.04",
  "region": "eu-central",
  "node": "node-eu-west-2",
  "ip_address": "31.97.109.213",
  "ssh_port": 22001,
  "ssh_command": "ssh root@31.97.109.213 -p 22001",
  "root_password": "E7b4NVJ69sORhs-vfPRZ4A",
  "hostname": "my-server.compute.dcdncloud.com",
  "monthly_cost_usd": 5.0,
  "message": "Instance is being created. SSH will be available in ~30 seconds."
}

⚠️ The root_password is shown only once. Save it immediately.

GET /instances

List all your instances.

curl https://dcdncloud.com/api/v1/compute/instances \
  -H "Authorization: Bearer TOKEN"
GET /instances/{id}

Get details of a specific instance including status, SSH info, and resource usage.

POST /instances/{id}/start

Start a stopped instance.

curl -X POST https://dcdncloud.com/api/v1/compute/instances/{id}/start \
  -H "Authorization: Bearer TOKEN"
POST /instances/{id}/stop

Stop a running instance. Storage is retained, no compute charges while stopped.

POST /instances/{id}/restart

Restart (stop + start) a running instance.

POST /instances/{id}/reset-password

Generate a new root password. The old password is invalidated.

Response:

{"root_password": "newRandomPassword123"}
POST /instances/{id}/ssh-key

Add an SSH public key to an existing instance.

{
  "public_key": "ssh-ed25519 AAAAC3Nza..."
}
DELETE /instances/{id}

Permanently destroy an instance and all its data. This action cannot be undone.

curl -X DELETE https://dcdncloud.com/api/v1/compute/instances/{id} \
  -H "Authorization: Bearer TOKEN"

Response:

{"status": "destroyed", "message": "Instance has been permanently destroyed"}

Node Operator Endpoints

MethodEndpointDescription
GET/earnings/node/{node_id}View earnings for a node
GET/earnings/summaryEarnings summary across all nodes
POST/earnings/payoutRequest earnings payout
GET/earnings/token-infoDCDN token distribution info

Error Codes

CodeMeaning
401Unauthorized — invalid or missing token
400Bad request — invalid plan, image, or region
402Insufficient credits
404Instance not found
409Name already in use

Rate Limits

API calls are rate-limited to 60 requests/minute per user. Exceeding the limit returns 429 Too Many Requests.

Related Docs