Introduction to CloudNexus API

Learn how to interact with the CloudNexus platform programmatically. This guide covers authentication, core resources, and your first API request.

Overview

The CloudNexus API provides access to all infrastructure resources including Cloud Servers, Kubernetes Clusters, CDN, and Managed Databases. The API is RESTful and returns JSON responses.

â„šī¸
Note: All API requests must be made over HTTPS. Calls made over plain HTTP will fail with a 403 Forbidden error.

Authentication

CloudNexus uses API keys for authentication. You can generate API keys in the Console under Security Settings. Each key has a scope that determines what resources it can access.

Include your API key in the Authorization header of every request:

cURL
Python
Node.js
# List all active instances curl https://api.cloudnexus.io/v2/instances \\ -H "Authorization: Bearer cn_live_4f3a2b1c..." \\ -H "Content-Type: application/json"
import requests API_KEY = "cn_live_4f3a2b1c..." HEADERS = {"Authorization": f"Bearer {API_KEY}"} response = requests.get( "https://api.cloudnexus.io/v2/instances", headers=HEADERS ) print(response.json())
const fetch = require('node-fetch'); const API_KEY = 'cn_live_4f3a2b1c...'; async function listInstances() { const res = await fetch('https://api.cloudnexus.io/v2/instances', { headers: { 'Authorization': `Bearer ${API_KEY}` } }); return await res.json(); } listInstances().then(console.log);

Creating a Cloud Server

Provision a new Virtual Private Server with a single POST request. Specify the region, plan, and image.

Parameter Type Description
name string Human-readable name for the instance.
region string Datacenter code (e.g., us-east-1, eu-west-2).
plan string Plan identifier (e.g., cx-standard-2).
image string OS image slug or snapshot ID.
ssh_keys array List of SSH key fingerprints to inject.
💡
Tip: Use the tags parameter to organize your resources. Tags are free and searchable in the console.
cURL
CLI
curl -X POST https://api.cloudnexus.io/v2/instances \\ -H "Authorization: Bearer cn_live_4f3a2b1c..." \\ -H "Content-Type: application/json" \\ -d '{ "name": "production-web-01", "region": "us-east-1", "plan": "cx-standard-4", "image": "ubuntu-22.04", "ssh_keys": ["3a4b5c6d7e8f"], "tags": ["prod", "web"] }'
# Using the CloudNexus CLI tool cnx instance create \\ --name production-web-01 \\ --region us-east-1 \\ --plan cx-standard-4 \\ --image ubuntu-22.04 \\ --ssh-key 3a4b5c6d7e8f

Available Regions

CloudNexus operates 50+ data centers globally. When creating resources, specify the region slug. Lower latency regions are recommended for user-facing applications.

âš ī¸
Warning: Cross-region data transfer incurs additional bandwidth fees. Keep related resources (e.g., DB and App) in the same region when possible.

US East

  • us-east-1 (Virginia)
  • us-east-2 (Ohio)
  • us-east-3 (New York)

Europe

  • eu-west-1 (London)
  • eu-west-2 (Paris)
  • eu-central-1 (Frankfurt)

Asia Pacific

  • ap-south-1 (Mumbai)
  • ap-northeast-1 (Tokyo)
  • ap-southeast-1 (Singapore)

Rate Limits

To ensure platform stability, API requests are rate-limited:

  • Standard: 600 requests per minute per API key.
  • Burst: Up to 100 requests per second.
  • Bulk Operations: Separate limits apply to batch endpoints.

Check the response headers X-RateLimit-Limit and X-RateLimit-Remaining to monitor your usage.