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.1

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.1
File Size Uploaded Provenance Actions
cubepath_sdk-0.5.1.tar.gz 30.7 kB With provenance Details for cubepath_sdk-0.5.1.tar.gz

Built distribution (wheel)

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

Total release size: 75.0 kB

Release files / cubepath_sdk-0.5.1.tar.gz

Download URL cubepath_sdk-0.5.1.tar.gz
Size 30.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cc422753a450e89346bda55919b725a5fbe0e3c09095d8c6d9b8627d6d03c635
BLAKE2b-256 checksum
How to use checksums
4ef3be58e5eaaff0694f6db7e3822f29925fab5ecd05a89b90fe3088806ae1d0
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.1-py3-none-any.whl

Download URL cubepath_sdk-0.5.1-py3-none-any.whl
Size 44.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f10ca20f5cff67b08a5d7c6e992a14aea3f21c1d402a0a9efb9c7ad2c2572b9e
BLAKE2b-256 checksum
How to use checksums
75d0fa16eed3a50c44617aa1aaa1a6b97675c321bf1ef1eadabd5f1fdb2bda6b
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.1

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.1.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