API v1.2.0

CloudNexus API Reference

Programmatically manage your entire cloud infrastructure. Create servers, deploy Kubernetes clusters, configure CDNs, and monitor resources through our RESTful API.

# Base URL for all API requests
https://api.cloudnexus.com/v1/

Authentication

CloudNexus uses API keys for authentication. Include your key in the Authorization header of every request.

⚠️ Security Notice Never expose your API keys in client-side code or public repositories. Use environment variables and secure secret management systems.
Authorization: Bearer cn_live_sk_8f3k29d10x...

Key Types

PrefixScopeEnvironment
cn_live_sk_Full accessProduction
cn_test_sk_Sandbox accessDevelopment

Rate Limits

API requests are limited based on your plan. Headers return current quota status.

HeaderDescription
X-RateLimit-LimitMax requests per window
X-RateLimit-RemainingRequests remaining
X-RateLimit-ResetUTC timestamp when window resets
429 Too Many Requests
Exceeded rate limit. Wait until X-RateLimit-Reset.
Standard Plan
1,000 requests / hour
Enterprise Plan
5,000 requests / hour

List Servers

GET /v1/servers

Returns a paginated list of all VPS instances associated with your account.

# curl example
curl -X GET "https://api.cloudnexus.com/v1/servers?page=1&limit=20" \   -H "Authorization: Bearer cn_live_sk_..."

Response

{ "servers": [ { "id": "srv_8x92k3, "name": "prod-api-01", "status": "running", "region": "us-east-1", "spec": { "vcpus": 4, "ram_gb": 16, "disk_gb": 128 }, "created_at": "2025-01-15T08:30:00Z" } ], "pagination": { "total": 142, "page": 1, "limit": 20 } }

Create Server

POST /v1/servers

Provisions a new VPS instance with specified configuration.

Request Body

ParameterTypeRequiredDescription
namestringRequiredHuman-readable server name (3-63 chars)
regionstringRequiredDeployment region (e.g., us-east-1, eu-west-2)
imagestringRequiredOS image ID or slug
planstringRequiredCompute plan ID
ssh_keysstring[]OptionalArray of SSH key IDs for root access
# Response
{ "server": { "id": "srv_9f82a1", "status": "provisioning", "ip_address": "198.51.100.42", "provisioning_eta_seconds": 45 } }

List CDN Domains

GET /v1/cdn/domains

Returns all configured CDN endpoints and their SSL/edge configuration.

{ "domains": [ { "id": "cdn_x7k29m", "name": "assets.example.com", "origin": "198.51.100.10", "ssl": "full", "cache_rules": 12, "status": "active" } ] }

Kubernetes Clusters

GET /v1/kubernetes/clusters

List all managed Kubernetes clusters with node pool details.

{ "clusters": [ { "id": "k8s_prod_01", "version": "1.29.2", "nodes": 5, "network_policy": "calico", "status": "ready" } ] }

Error Codes

CloudNexus uses standard HTTP status codes and extends them with application-specific error details.

400 Bad Request
Invalid parameters or malformed JSON payload.
401 Unauthorized
Missing or invalid API key.
403 Forbidden
Insufficient permissions for requested action.
404 Not Found
Resource does not exist or has been deleted.
422 Unprocessable
Resource validation failed (e.g., duplicate name).
500 Server Error
Internal infrastructure failure. Retry after 30s.
Error Response Format All errors return a consistent JSON structure:
{"error": {"code": "ERR_422", "message": "...", "details": []}}

SDKs & Tools

Official client libraries and CLI tools for faster integration.

Python
pip install cloudnexus-sdk
Node.js
npm install @cloudnexus/sdk
Go
go get cloudnexus.com/sdk-go/v2
CLI
curl -sSL get.cn/cli | bash