API automation for Cloud VPS
Create VMs, manage volumes, configure networks, and schedule backups through scoped API tokens or Terraform. Every change lands in the same audit trail.
Generate, revoke, and rotate tokens per pipeline. Each script gets its own credential — no shared passwords.
Define VMs, volumes, and networks in HCL. Version infrastructure in Git and deploy on merge.
Per-VM graphs for CPU, memory, disk I/O, and bandwidth. Filter from hours to months to spot trends early.
Account-level and VM-level logs capture every operational action for compliance and incident review.
Choose the API workflow
Each path is a Cloud VPS operator job. Pick the one that fits the change, then follow the mechanism link.
| Path | Use this when | Setup effort | Operational control | Next step |
|---|---|---|---|---|
| Recommended Direct REST API | You need to provision, resize, or schedule backups from a script or CI job right now. | Low. Mint a scoped token, add one header. | Full. Every call lands in the audit log with the token that ran it. | See token issuance workflow |
| Terraform (OpenNebula provider) | Your team needs reviewable diffs, repeatable rollout, and Git-backed drift detection. | Medium. Write HCL, set up state backend, wire the provider token. | High. Plan/apply cycle gives full review before any change lands. | See which tool fits each task |
| MCP (AI agent) | You want an AI assistant to handle routine ops with human approval on account-impacting actions. | Low. One config entry and a Personal Access Token. | High. Same scoped tokens and audit log as direct API. Revoke token to revoke agent. | See MCP setup |
| Audit only | You need to trace who changed what during an incident or compliance review. | None. Logs are always on. | Read-only. Filter by token or time range. | See activity log |
The API workflow, end to end
Every Cloud VPS API call runs the same loop: a scoped token opens it, an audit entry closes it, and the call and response carry the actual work in between.
-
Issue a scoped token
Create a Personal Access Token from the Management Portal, scoped to one pipeline (CI deploy, monitoring, provisioning). Set an expiry that matches the workflow’s lifetime.
Risk: leaked tokens. Scope tightly, set an expiry, rotate on schedule.
-
Make the call
Authenticate with
Authorization: Bearer $TBX_TOKEN. Send anIdempotency-Keyon any mutating operation so retries are safe.Risk: rate limit breach. Check budget headers; retry with exponential backoff on 429.
-
Read the response
Synchronous operations return the resulting state immediately. Long-running work returns a job ID and a polling URL; the audit log records the eventual outcome either way.
-
Audit the change
Every create, resize, delete, and reconfigure lands in the same audit stream as the dashboard, tagged to the token that ran it. Filter by token or time range during incident review.
# 1. Scope a token to one pipeline (Personal Access Token)
export TBX_API="https://manage.togglebox.com/api"
export TBX_TOKEN="tbpat_…" # scoped to: ci-deploy
# 2. Make the call (idempotency key on retries)
curl -X POST "$TBX_API/vms" \
-H "Authorization: Bearer $TBX_TOKEN" \
-H "Idempotency-Key: deploy-2026-05-05-001" \
-d '{"template":"ubuntu-22.04","cpu":2,"memory_mb":4096}'
# 3. Read the response: synchronous result, or a job URL to poll
# 4. Audit: every call shows in the dashboard log scoped to this token
# Rotate the token without a restart
curl -X POST "$TBX_API/tokens/rotate" \
-H "Authorization: Bearer $TBX_TOKEN" \
-d '{"name":"ci-deploy","retire_in":"1h"}'
The API is served from manage.togglebox.com/api and covers the full account surface: VMs, power, disks, volumes, backups, networking, security groups, S3-compatible storage, SSH keys, templates, billing, and support. The full endpoint reference lives in the Management Portal alongside token management; the open-source MCP server’s tool list mirrors the same surface if you want to inspect coverage before signing in.
When something goes wrong
Production automation needs a recovery model, not just a happy path. Three failure modes show up most often.
Rate limits: 429 Too Many Requests
Each token has a per-minute and per-hour budget. The response includes Retry-After; retry with exponential backoff, never tight-loop. Burst-heavy provisioning should chunk the work and watch the budget headers.
Auth failures: 401 / 403
401 means the token is missing, malformed, or revoked. 403 means the token does not include the scope for the requested action. Inspect the response body’s error field; the missing scope is named explicitly.
Idempotency & retries
Provisioning calls accept an Idempotency-Key header. A retry with the same key returns the same result; a retry without one risks creating a second VM. Always send the key on operations that mutate state.
Token lifecycle: revoke an outdated token, issue a replacement, update the pipeline secret. The running workload keeps working; the next call uses the new token.
Which tool for which task
Use direct API calls for immediate operations. Use Terraform when the change needs review, repeatability, and a clean path back through Git. Both paths share the same tokens, audit log, and control plane.
| Task | Best path |
|---|---|
| Immediate operations — direct API | |
| Spin a VM up right now for a one-off test | Direct API call from your terminal or CI job. |
| Tear down temporary infrastructure on a schedule | Scheduled API call from cron or CI, with no lingering test capacity. |
| Resize a VM or attach a volume mid-incident | Direct API call with the change logged for incident review. |
| Schedule backups and retention fleet-wide | API call from your scheduler, or express as Terraform policy. |
| Reviewed infrastructure — Terraform | |
| Stand up a full environment your team will review | Terraform plan in Git, reviewable diff, replayable apply. |
| Keep staging and production operationally identical | Terraform modules applied per environment, same shape, different inputs. |
# main.tf, using the OpenNebula Terraform provider
resource "opennebula_virtual_machine" "web_01" {
name = "web-01"
template_id = var.ubuntu_22_template
cpu = 2
memory = 4096
disk { size = 81920 }
}
Start with the OpenNebula Terraform provider docs and pair plans with dedicated API tokens per environment.
Build repeatable infrastructure instead of one-off server work
Both paths use scoped tokens and a shared audit log. Pick the tool that fits the workflow: API for ad-hoc operations, Terraform for team-reviewed infra changes.
Programmatic integrations
Drive Cloud VPS from your AI agent
The Togglebox Model Context Protocol (MCP) server turns your Cloud VPS account into tools an AI assistant can call directly. Ask Claude, Cursor, or Codex to provision VMs, attach private networks, schedule backups, manage S3-compatible buckets, or reset SSH keys, with every action landing in the same audit log as the dashboard and API.
Demo summary: an AI agent receives a natural-language prompt, calls Togglebox MCP tools to create a Cloud VPS, attach a private network, and schedule daily backups, and ends with the provisioned resources visible in the dashboard and API audit log.
Spin up 3 web nodes from our Ubuntu template, attach a private network, and schedule nightly backups.
On it, using your Togglebox MCP server.
create_vmweb-01create_vmweb-02create_vmweb-03create_private_networkapp-netenable_backup_scheduledaily 02:00
3 VMs provisioned on app-net. Nightly backups scheduled at 02:00. Full audit trail in the dashboard.
Works with the agents you already use
Claude Code, Claude Desktop, Cursor, Windsurf, Codex CLI, and Gemini CLI. One config entry, one Personal Access Token.
Full account surface, not a sample
VMs, disks, backups, S3-compatible buckets, private networks, security groups, SSH keys, templates, billing, and support tickets. Every Management Portal action is a callable tool. Destructive actions (delete, rebuild, resize) follow the same confirmation model as the dashboard; your agent calls the same endpoint, not a bypass path.
Same tokens, same audit log
MCP calls authenticate with scoped Personal Access Tokens and appear in the same audit trail as dashboard and direct API actions. Scope tokens to read-only or limit to specific resource types where agent trust is partial. Revoke a token to revoke the agent immediately.
{
"mcpServers": {
"togglebox": {
"command": "npx",
"args": ["-y", "@togglebox/togglebox-mcp"],
"env": { "TOGGLEBOX_API_TOKEN": "tbpat_…" }
}
}
}
Open source. MIT licensed. Ship today.
Mint a token in the dashboard, drop the config into your AI client, and your next chat thread can manage real infrastructure.
Monitor resources, trace every action
Cloud VPS pairs per-VM resource graphs with a complete audit log, so you can confirm outcomes, debug incidents, and watch how automation consumes capacity.
One audit stream for humans and scripts
Every create, resize, delete, and reconfigure is logged with who did it, when, and from which source IP, whether the change came from the dashboard or an API token.
- 14:02vm.createci-deploy token
- 14:04network.attachprivate subnet
- 14:07backup.policydaily retention
- Per-VM action history. Follow long-running tasks, including backups, resizes, and deployments, until they complete or fail.
- Resource graphs per VM. Confirm CPU, memory, storage, and bandwidth match the capacity your automation requested.
- Dashboard and API share one log. Script-driven and manual changes land in the same audit stream.
- Scoped by token. Filter audit entries to a single pipeline or operator when debugging an incident.
For fleet-wide access control and persistent storage, pair this with Security & Networking and Volume Storage.
Reviews from the Businesses We Keep Online
Cloud VPS API Questions
Can I automate Cloud VPS operations via API?
Yes. The REST API at manage.togglebox.com/api covers the full account surface: VMs, power, disks, volumes, backups, networking, security groups, S3-compatible storage, SSH keys, templates, billing, and support. Mint a scoped Personal Access Token, send it as a Bearer header, and every call lands in the same audit log as the dashboard.
Is Terraform supported for Cloud VPS?
Yes. Cloud VPS runs on OpenNebula, so the official OpenNebula Terraform provider manages VMs, disks, and networks as code. Pair each environment's plans with a dedicated API token; plan/apply changes land in the same audit log as dashboard and API actions.
What monitoring is available for Cloud VPS?
Dedicated usage graphs show resource behavior over configurable time ranges, supporting trend inspection for capacity planning and operational review. Billing Alerts can notify you when monthly usage goes over the amount you set.
How is usage monitoring different from activity logs?
Usage monitoring shows resource behavior over time (CPU, bandwidth, storage trends). Activity logs record operational actions and events at both account and VM scope.
Can I track long-running operations in real time?
Operation-log polling provides live progress updates for asynchronous workflows, so you can monitor status without refreshing or guessing.
How do I rotate API credentials?
Use the API token management surface to revoke the current token and generate a new one. API token rotation and account password changes are both available from the same credentials area.
Can I manage Cloud VPS from Claude, Cursor, or another AI assistant?
Yes. The open-source Togglebox MCP server exposes the full Cloud VPS account control plane (VMs, disks, backups, S3-compatible buckets, networks, security groups, SSH keys, templates, billing, and support) as Model Context Protocol tools. It works with Claude Code, Claude Desktop, Cursor, Windsurf, Codex CLI, and Gemini CLI. Calls authenticate with a scoped Personal Access Token and land in the same audit log as the dashboard and direct API. See the live demo and config snippet.
No matching questions found.
How Your VPS Stays Up
- 3×-replicated NVMe: keeps your data on three independent storage servers
- Host failure recovery: restarts affected VPSs on healthy hosts after hardware failure
- Performance Guard: detects congestion and rebalances the cluster automatically
- 24/7 engineer support: reach real people around the clock
Ready to deploy?
Deploy in under 60 seconds. No long-term contracts.
