Skip to main content

CubePath Python SDK

Official Python SDK for the CubePath Cloud API.

Installation

pip install cubepath

Quick Start

import cubepath

client = cubepath.CubePathClient(api_token="your-api-token")

# List projects
projects = client.projects.list()
for p in projects:
    print(p.project.name)

# Create a VPS
from cubepath.models import CreateVPSRequest

req = CreateVPSRequest(
    name="my-vps",
    plan_name="gp.nano",
    template_name="debian-12",
    location_name="us-mia-1",
    ssh_key_ids=[12],
)
task = client.vps.create(project_id="proj-123", req=req)
print(f"Task: {task.task_id}")

Services

Service Access Description
Projects client.projects Manage projects
SSH Keys client.ssh_keys Manage SSH keys
VPS client.vps Virtual private servers
VPS Backups client.vps.backups() VPS backup management
VPS ISOs client.vps.isos() ISO mount/unmount
Baremetal client.baremetal Bare metal servers
Networks client.networks Private networks
Floating IPs client.floating_ips Floating IP addresses
Firewall client.firewall Firewall groups & rules
DNS client.dns DNS zones & records
Load Balancer client.load_balancer Load balancers, listeners, targets
CDN client.cdn CDN zones, origins, rules, WAF
Object Storage client.object_storage S3 compatible buckets, access keys, usage
Kubernetes client.kubernetes K8s clusters, node pools, addons
Pricing client.pricing Pricing information
DDoS client.ddos DDoS attack reports

Configuration

client = cubepath.CubePathClient(
    api_token="your-api-token",
    base_url="https://api.cubepath.com",   # default
    timeout=30.0,                           # seconds
    max_retries=3,                          # retry on 429/5xx
    retry_wait_min=1.0,                     # min backoff seconds
    retry_wait_max=30.0,                    # max backoff seconds
    rate_limit_interval=0.1,                # 10 req/s
)

Context Manager

with cubepath.CubePathClient(api_token="tok") as client:
    zones = client.dns.list_zones()

Error Handling

from cubepath import APIError, is_not_found

try:
    project = client.projects.get("nonexistent")
except APIError as e:
    if e.is_not_found():
        print("Project not found")
    elif e.is_rate_limited():
        print("Rate limited, try again later")
    else:
        print(f"API error: {e}")

Requirements

  • Python >= 3.10
  • httpx >= 0.27

Examples

Deploy a Baremetal Server

from cubepath.models import CreateBaremetalRequest

req = CreateBaremetalRequest(
    model_name="c1.metal.plus",
    location_name="us-mia-1",
    hostname="db-server",
    password="SecurePass123!",
    os_name="debian-12",
    ssh_key_ids=[12],
)
task = client.baremetal.deploy(project_id="proj-123", req=req)

Create a Load Balancer

from cubepath.models import CreateLoadBalancerRequest, CreateListenerRequest

lb = client.load_balancer.create(CreateLoadBalancerRequest(
    name="web-lb",
    plan_name="lb.small",
    location_name="us-mia-1",
))

client.load_balancer.create_listener(lb.uuid, CreateListenerRequest(
    name="http",
    protocol="http",
    source_port=80,
    target_port=8080,
    algorithm="round_robin",
))

Create a CDN Zone

from cubepath.models import CreateCDNZoneRequest, CreateCDNOriginRequest

zone = client.cdn.create_zone(CreateCDNZoneRequest(
    name="my-site",
    plan_name="cdn.starter",
    custom_domain="cdn.example.com",
))

client.cdn.create_origin(zone.uuid, CreateCDNOriginRequest(
    name="primary-origin",
    address="origin.example.com",
    port=443,
    protocol="https",
    weight=100,
    priority=1,
    health_check_path="/health",
))

Object Storage

Buckets and keys are created asynchronously: poll until status is active. Use any S3 client (boto3, rclone, aws cli) with the key against the tier endpoint.

from cubepath.models import (
    CreateCDNOriginRequest,
    CreateObjectStorageAccessKeyRequest,
    CreateObjectStorageBucketRequest,
    UpdateObjectStorageBucketRequest,
)

tiers = client.object_storage.list_tiers()

bucket = client.object_storage.create_bucket(CreateObjectStorageBucketRequest(
    name="my-backups",
    tier="infrequent_access",
    project_id=12,
))
detail = client.object_storage.get_bucket(bucket.uuid)  # connection info, month usage, CDN origin
client.object_storage.update_bucket(bucket.uuid, UpdateObjectStorageBucketRequest(versioning="enabled"))

# The secret is only returned here
key = client.object_storage.create_key(CreateObjectStorageAccessKeyRequest(
    name="backups",
    tier="infrequent_access",
    permission="read_write",
    bucket_uuids=[bucket.uuid],  # omit for every bucket of the project
))
print(key.access_key_id, key.secret_access_key, key.endpoint, key.region)

usage = client.object_storage.get_usage(period="2026-09")

# Buckets are private: serve one publicly through a CDN zone
client.cdn.create_origin(zone.uuid, CreateCDNOriginRequest(
    name="my-bucket", weight=100, priority=1, object_storage_bucket_uuid=bucket.uuid,
))

client.object_storage.delete_key(key.uuid)
client.object_storage.delete_bucket(bucket.uuid, force=True)  # force purges the content first

DNS Management

from cubepath.models import CreateDNSZoneRequest, CreateDNSRecordRequest

zone = client.dns.create_zone(CreateDNSZoneRequest(domain="example.com"))

client.dns.create_record(zone.uuid, CreateDNSRecordRequest(
    name="@",
    record_type="A",
    content="203.0.113.10",
    ttl=3600,
))

Metadata

Release files for cubepath-sdk 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cubepath-sdk 0.5.0
File Size Uploaded Provenance Actions
cubepath_sdk-0.5.0.tar.gz 27.7 kB With provenance Details for cubepath_sdk-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cubepath-sdk 0.5.0
File Interpreter ABI Platform Actions
cubepath_sdk-0.5.0-py3-none-any.whl Python 3 none any Details for cubepath_sdk-0.5.0-py3-none-any.whl

Total release size: 70.0 kB

Release files / cubepath_sdk-0.5.0.tar.gz

Download URL cubepath_sdk-0.5.0.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7db0485063289aad2d3136a0b64c2c55043e5c7d9bcbbdf69c27722d65661af1
BLAKE2b-256 checksum
How to use checksums
036a253b9be0c1ec8572e7c310e2d63168d826565082fd7363d416e495fdf888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / cubepath_sdk-0.5.0-py3-none-any.whl

Download URL cubepath_sdk-0.5.0-py3-none-any.whl
Size 42.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c80ee0c2740c3b622997ab96015feec9a83d0a520828e371323e3b23c3ca6062
BLAKE2b-256 checksum
How to use checksums
73de31f18544ab13c44a7f2b736e99a9ef4d6ed21099c06779a93397b59587d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Security for cubepath-sdk 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cubepath_sdk-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page