How to Create Servers with the xCloud Public API and MCP
Updated November 23, 2026 · 11 min read
The xCloud Public API and the xCloud MCP can create servers for you, so a script, a CI job or an AI agent can add capacity without opening the dashboard. You list the plans first, send one create request, then poll the new server until it is provisioned. This guide covers the three ways in: buying an xCloud Managed server, creating an AI agent server on a cloud account you connected, and connecting your own VPS as an AI agent server.
Which endpoint to use
Pick the row that matches what you want to create. All paths start with https://app.xcloud.host/api/v1.
| You want | Discover with | Create with | Who bills you |
|---|---|---|---|
| A web server (Nginx or OpenLiteSpeed) hosted by xCloud | GET /servers/plans |
POST /servers |
xCloud charges your team’s card at once |
| An AI agent server (OpenClaw, Hermes Agent or Nod) on a cloud account you connected to xCloud | GET /cloud-providers, then /regions and /plans |
POST /cloud-providers/{uuid}/servers |
Your provider bills for the machine; xCloud bills the plan you pick in billing_type (free is available) |
| An AI agent server on a VPS you already have | GET /servers/connection-key |
POST /servers/connect |
Your provider bills for the machine; xCloud bills the plan you pick in billing_type (free is available) |
Web servers on your own cloud account are dashboard only for now. The two “your own” endpoints accept only the openclaw, hermes and nod stacks, and refuse nginx or openlitespeed with 422. To put a web server on DigitalOcean, Hetzner, AWS or another connected provider, follow Supported Server Providers in xCloud.
Prerequisites
- An xCloud API token with
read:serversandwrite:servers. See How to Access the xCloud API to create one. A read-only token is enough for the discovery calls. - For MCP, a connection that allows MCP. See How to Connect xCloud MCP to Your AI Agent.
- A team role that can create servers. A token cannot do more than your role allows.
- For an xCloud Managed server: an active payment method on the team. See How Billing Works in xCloud.
- For a server on your own cloud: the cloud account already connected to xCloud in the dashboard.
Store the token in an environment variable instead of pasting it into each command:
export XCLOUD_TOKEN='your-api-token'
To work in another team the token can access, add the X-Team-Id header to every request. See Multi-Team API Tokens and MCP Access.
Create an xCloud Managed server
An xCloud Managed server is a server xCloud hosts and bills for you. This is the API route for a WordPress, PHP, Laravel or Docker server.
Step 1: List the plans you can buy
curl 'https://app.xcloud.host/api/v1/servers/plans' \
--header "Authorization: Bearer $XCLOUD_TOKEN" \
--header 'Accept: application/json'
Expected result: a 200 response with data.plans, the plans your team can buy right now. Each plan has:
| Field | What it holds |
|---|---|
slug |
The plan ID. Send it as size when you create the server |
name |
The plan name shown in the dashboard |
specs |
vcpu, memory_mb, disk_gb and bandwidth_mb |
pricing |
One entry per renewal_period (monthly, yearly, two_yearly) with its price and currency |
regions |
Where the plan is offered: id, city, country and continent. Send an id as region |
Prices come from your account, so read them from this response, not from an old copy. To find a plan with at least 2 GB of RAM in Europe, filter with jq:
curl -s 'https://app.xcloud.host/api/v1/servers/plans' \
--header "Authorization: Bearer $XCLOUD_TOKEN" \
--header 'Accept: application/json' \
| jq '.data.plans[]
| select(.specs.memory_mb >= 2048)
| {slug, name, pricing, regions: [.regions[] | select(.continent == "Europe") | .id]}'
Step 2: Create the server
Send the plan slug as size and one of that plan’s region IDs as region. Generate a new Idempotency-Key for each server you create.
curl --request POST 'https://app.xcloud.host/api/v1/servers' \
--header "Authorization: Bearer $XCLOUD_TOKEN" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "Idempotency-Key: $(uuidgen)" \
--data '{
"name": "docs-demo",
"size": "<plan slug from Step 1>",
"region": "<region id from Step 1>",
"renewal_period": "monthly",
"stack": "nginx",
"database_type": "mysql",
"ubuntu_version": "24.04",
"backups": false,
"tags": ["production"]
}'
Only name, size and region are required. The other fields:
| Field | Values | Default |
|---|---|---|
renewal_period |
monthly, yearly, two_yearly |
monthly |
stack |
nginx, openlitespeed |
nginx |
database_type |
none, mysql (MySQL 8.0), mariadb (MariaDB 11), or an exact version: mysql8, mysql84, mariadb11. mariadb10 (MariaDB 10.6) is recognized but refused with 422 for new servers |
— |
install_docker |
true installs Docker while the server is set up. Nginx only |
false |
install_postgresql |
true adds managed PostgreSQL after setup. Nginx only |
false |
ubuntu_version |
The Ubuntu version to install, for example 24.04 |
The current default |
backups |
true turns on automated backups |
false |
tags |
A list of tag names | none |
Expected result: 202 Accepted with the message Server provisioning started., the new server in data (its uuid, name, status and dashboard_url) and a Location header pointing at the server. Your card is charged at this point.
If the size or region is wrong, the answer is 422 with the field that failed, for example “The selected region is not available for this plan.” For Docker on Nginx in more detail, see Enable Docker on an Nginx Server in xCloud. For PostgreSQL, see Install Managed PostgreSQL and pgAdmin in xCloud.
Step 3: Poll until the server is ready
Setup runs in the background. Poll the progress endpoint with the uuid from Step 2:
SERVER_UUID='9a1f0c2e-4b7d-4e8a-9c3f-1d2e3f4a5b6c'
curl "https://app.xcloud.host/api/v1/servers/$SERVER_UUID/provisioning-progress" \
--header "Authorization: Bearer $XCLOUD_TOKEN" \
--header 'Accept: application/json'
Expected result: percent_complete, current_stage, current_task and the list of stages, the same steps the dashboard progress page shows. Stop polling when is_provisioned is true (the server is ready) or is_failed is true (read error_message). GET /servers/{uuid} returns the server itself, with status moving from new to provisioning to provisioned.
Create an AI agent server on your own cloud account
Use this route to run OpenClaw, Hermes Agent or Nod on a cloud provider you connected to xCloud (see Supported Server Providers in xCloud). Your provider bills you for the machine; xCloud bills for the server plan you choose in billing_type.
Step 1: Find your cloud account, region and plan
List the connected accounts. Credentials are never returned.
curl 'https://app.xcloud.host/api/v1/cloud-providers' \
--header "Authorization: Bearer $XCLOUD_TOKEN" \
--header 'Accept: application/json'
Expected result: data.providers, each with a uuid, name and provider. For AWS, services lists ec2 and lightsail. Then read that account’s regions and the plans in one region:
PROVIDER_UUID='3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f'
curl "https://app.xcloud.host/api/v1/cloud-providers/$PROVIDER_UUID/regions" \
--header "Authorization: Bearer $XCLOUD_TOKEN" \
--header 'Accept: application/json'
curl "https://app.xcloud.host/api/v1/cloud-providers/$PROVIDER_UUID/plans?region=nyc1" \
--header "Authorization: Bearer $XCLOUD_TOKEN" \
--header 'Accept: application/json'
Expected result: each plan has a size, name, memory_mb, cpu, disk_gb, regions, and the provider’s price_monthly and currency when the provider reports a monthly price (otherwise both are null). For AWS add cloud_service_name=ec2 or lightsail. For Google Cloud, zone is required on the plans call.
Step 2: Create the agent server
curl --request POST "https://app.xcloud.host/api/v1/cloud-providers/$PROVIDER_UUID/servers" \
--header "Authorization: Bearer $XCLOUD_TOKEN" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "Idempotency-Key: $(uuidgen)" \
--data '{
"name": "docs-demo-agent",
"size": "s-4vcpu-16gb",
"region": "nyc1",
"stack": "nod",
"database_type": "none",
"consent": true,
"billing_type": "free"
}'
stackisopenclaw,hermesornod. OpenClaw and Hermes Agent also need their own fields (your AI provider, its API key, and the risk acceptance flag); the guides for OpenClaw and Hermes Agent explain what each one asks for. Nod takes none.consentmust betrue: it confirms the server is new and only for this agent. On Vultr,consent_documentationmust betrueas well.billing_typeisfree,starter,professional,agency, orpackagewith apackage_uuidfor a lifetime deal slot.- The plan needs at least 4 GB RAM, or 6 GB for Nod. A smaller plan is refused with
422before anything is created.
Expected result: 201 with Server provisioning started. and the new server in data. xCloud bills the plan you chose in billing_type; see How Billing Works in xCloud. Poll it as in Step 3 above.
Connect your own VPS as an AI agent server
Use this route when you already have a fresh Ubuntu 24.04 LTS x64 VPS from any provider, with at least 4 GB RAM (6 GB for Nod). AI agent servers are not yet available on Ubuntu 26.04.
Step 1: Let xCloud log in to the VPS
Read xCloud’s public connection key and add it to root’s authorized_keys on the VPS:
curl 'https://app.xcloud.host/api/v1/servers/connection-key' \
--header "Authorization: Bearer $XCLOUD_TOKEN" \
--header 'Accept: application/json'
Expected result: data.uuid and data.public_key. The private key is never returned.
Then log in to the VPS as root and add the key, replacing the placeholder with the full data.public_key value:
mkdir -p /root/.ssh && chmod 700 /root/.ssh
echo '<data.public_key from the response>' >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
tail -n 1 /root/.ssh/authorized_keys
Expected result: the last command prints the key you just added, so it is now the last line of /root/.ssh/authorized_keys. Keep data.uuid for Step 2.
Step 2: Connect the VPS
curl --request POST 'https://app.xcloud.host/api/v1/servers/connect' \
--header "Authorization: Bearer $XCLOUD_TOKEN" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "Idempotency-Key: $(uuidgen)" \
--data '{
"name": "docs-demo-vps",
"public_ip": "203.0.113.10",
"ssh_port": 22,
"ssh_username": "root",
"ssh_authentication_mode": "public_key",
"ssh_key_pair_uuid": "<data.uuid from Step 1>",
"stack": "nod",
"consent": true,
"billing_type": "free"
}'
You can also send "ssh_authentication_mode": "password" with ssh_password instead of a key. ssh_username must be root.
Expected result: 201 with Server provisioning started. xCloud checks the VPS memory before it saves the server, so a VPS that is too small is refused with 422 and nothing is created. For the dashboard version of this flow, see How to Install OpenClaw on a VPS with xCloud.
Ask an AI agent to create a server over MCP
In an MCP client connected to xCloud, ask in plain language:
Create a new xCloud server called docs-demo with Nginx and MySQL. Show me the
cheapest plan with at least 2 GB RAM in Europe and its monthly price, and wait
for my approval before you buy it.
The agent runs the same operations as the API:
- It reads
servers.plans(for your own cloud:cloudProviders.index,cloudProviders.regionsandcloudProviders.plans) and shows you the plan, region and price. These reads change nothing. - It waits for your approval.
servers.store,cloudProviders.servers.storeandservers.connectare destructive operations: on the compact MCP profile they run throughxcloud_execute_destructive, which refuses the call unless the agent sendsconfirm: true. xCloud tells the agent to set it only after you approve; your MCP client may also ask you before it runs the tool, so check its approval setting. - It sends an
Idempotency-Keyand reuses it on a retry, so a dropped connection cannot buy a second server. - It polls
servers.provisioning-progressand tells you when the server is ready.
Expected result: one new server with its dashboard link, created after the agent showed you the plan and price and you approved. If the agent tries to buy without showing you a price first, stop it and ask for the quote.
Rebuild a server through the API
To wipe an existing server and set it up again on a fresh stack, use POST /servers/{uuid}/rebuild with rebuild_confirmation set to the exact server name and the new stack. A rebuild deletes the server’s data, needs a token with write:servers and a role that can delete servers, and answers 202. If a rebuild fails, POST /servers/{uuid}/rebuild/retry resumes it without creating another server or invoice. Read How to Rebuild a Server Safely with xCloud for which servers can be rebuilt and what is lost.
Retries and limits
- Safe to retry with a key: send a fresh UUID as
Idempotency-Keyfor each new server; a repeated request with the same key never creates a second server. Without the header, each request creates a new server. Reuse a key only to retry the same request, and the repeat returns the first answer. The same key with a different body returns422; a repeat while the first request is still running returns409, so wait and retry. - Rate limit: each create endpoint accepts 10 requests a minute. More return
429; wait a minute and retry with the same key. - Failed charges are not saved: if a managed server’s charge fails, the server and invoice are rolled back and the key is freed, so you can fix the card and retry with the same key.
Troubleshooting
| Response | Cause | Fix |
|---|---|---|
401 |
No token, or the token was revoked | Send Authorization: Bearer <token> with an active token |
403 |
The token lacks write:servers, or your team role cannot create servers |
Create a token with the right permissions, or ask the team owner for a role that can create servers |
402 “Add an active payment method in the dashboard before creating a server.” |
The team has no usable card | Add a payment method in the dashboard, then retry |
402 with a card message |
The charge was declined | Fix the card, then retry. Nothing was created |
422 on size or region |
The plan or region is not on offer | Read GET /servers/plans again and use a slug and one of its region ids |
422 on stack for your own cloud or VPS |
Only openclaw, hermes and nod are accepted there |
Create web servers with POST /servers, or from the dashboard |
422 on memory |
The plan or VPS has less than 4 GB RAM (6 GB for Nod) | Choose a bigger plan or VPS |
is_failed: true while polling |
Setup failed on the server | Read error_message. For your own servers, see server installation failed |
Frequently asked questions
Can I create an Nginx or OpenLiteSpeed server on my own DigitalOcean or Hetzner account through the API?
Not yet. Through the API, web servers (Nginx or OpenLiteSpeed) are created as xCloud Managed servers with POST /api/v1/servers. The endpoints for your own cloud account and for your own VPS create AI agent servers (OpenClaw, Hermes Agent or Nod). To put a web server on your own cloud account, create it from the dashboard.
Does POST /api/v1/servers charge my card?
Yes. It buys an xCloud Managed server and charges your team’s default payment method straight away. If the team has no active payment method, the request is refused with 402 and nothing is created. If the charge fails, the server and its invoice are rolled back.
What happens if I send the same create request twice?
It is safe when you send an Idempotency-Key header: a repeated request with the same key never creates a second server. Without the header, each request creates a new server. Send a fresh UUID as the Idempotency-Key header for each new server and reuse it only when you retry that same request; the repeat returns the first answer. The same key with a different body is refused with 422.
Can an AI agent create a server without asking me?
Creating a server is a destructive operation in the xCloud MCP. xCloud refuses the call unless the agent sends confirm set to true, and tells the agent to set it only after you approve. Before it buys an xCloud Managed server, xCloud also tells the agent to quote the plan, region and price. The confirm value comes from the agent, not from you, so your MCP client may also ask you before it runs a destructive tool. Check your client’s approval setting.
If you run into any issues while creating servers with the API or MCP, feel free to reach out to our support team.