Hosting provider APIs: a VPS from a script or Terraform
You can order a server in a control panel, or with one command from a script or a CI pipeline. Here is what a host's API gives you, how to connect it safely and what share of hosts offer one.
The short answer. An API pays off when servers are created and deleted often: test environments, build runners, cluster nodes. One website on one VPS is fine with the panel. With an API, pick a host with hourly billing — otherwise a server you need for an hour costs you a month.
What a host's API can do
Usually the API does what the panel does: create, reboot and delete servers, resize them, take snapshots, manage the firewall, DNS records and floating IPs, read invoices. The scope differs between hosts, so before ordering check the API documentation: whether it is public and whether it covers the operations you need. On snapshots see Snapshots vs backups, on floating IPs Floating IP and load balancer.
Tokens: least privilege
An API key is as good as your account password. Large clouds offer read-only tokens or tokens with selected permissions, and their documentation recommends granting only what the task needs. Monitoring needs read access only; CI gets its own token. Keep tokens in environment variables or CI secrets rather than in code, set an expiry date, delete unused ones and rotate keys when someone leaves the team.
Terraform, OpenTofu and cloud-init
Terraform and its open-source fork OpenTofu describe servers in configuration files and call the host's API through a provider plugin. Providers are published in the OpenTofu and Terraform registries; if a host has no provider, scripts against its API remain. First-boot setup (users, SSH keys, packages) is handled by cloud-init: the user data file is passed when the server is created. APIs are rate-limited — typically thousands of requests per hour, beyond which the host answers with HTTP 429, so scripts need pauses and retries. Builds from CI are covered in CI/CD on a VPS.
How many hosts have an API, and prices
In the accsly.io catalog on 22 November 2026, 2,088 hosts list VPS plans (in stock, no setup fee, own IPv4), and 282 of them state an API — about 13%. Hourly billing is offered by 34% of hosts with an API and fewer than 4% of the rest. An API does not make servers dearer: the median of the cheapest 2 vCPU / 4 GB plan without prepayment is €11.50 and $17.71 at hosts with an API versus €14.99 and $18.79 at the others (in the host's currency). For EU users and GDPR-bound data, pick an EU location; for US users, one in the US. Selections: VPS with an API, VPS with hourly billing and VPS for Kubernetes.