Overview
The API is a JSON over HTTPS interface to the same account you use in the panel. Everything it can do, the panel can do too: it never has more power than you have when signed in.
- Base URL:
https://v4vm.com/api/v1 - Requests and responses are JSON (UTF-8). Send
Content-Type: application/jsonwith a body. - Money is returned in exact units:
amount_centsoramount_micros(1 cent = 10,000 micros), plus aformattedstring. - Timestamps are ISO 8601 in UTC.
Authentication
Create a token under Account · API tokens and send it on every request:
Authorization: Bearer v4vm_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThe token is shown once. We store only a hash of it, so a lost token can't be recovered: revoke it and create a new one. Tokens stop working when they expire, when you revoke them, or if the account is suspended. Cookies are never used by the API.
Scopes
| Scope | Allows |
|---|---|
read | Account, plans, OS images, servers and invoices. |
read and write | Everything above, plus power actions, ordering servers from credit and terminating hourly servers. |
Tokens created before scopes existed are read only.
Errors
Every error has the same shape and a matching HTTP status:
{
"error": {
"code": "insufficient_scope",
"message": "This token does not have the \"write\" scope."
}
}| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | The body or a parameter is invalid. A param field may name it. |
| 401 | unauthorized | Missing, invalid, expired or revoked token. |
| 402 | insufficient_credit | Not enough credit for an order. amount_needed says how much to add. |
| 403 | insufficient_scope | The token is read only. Also account_suspended, email_unverified, or billing_hold (orders are paused while a payment dispute is open). |
| 404 | not_found | No such server (or not yours), or unknown endpoint. |
| 409 | conflict | The server can't do that in its current state. Also out_of_stock, not_supported, idempotency_key_in_use. |
| 422 | idempotency_key_reused | The Idempotency-Key was already used with a different body. |
| 429 | rate_limited | Too many requests. Wait for Retry-After seconds. |
| 5xx | internal_error | Something failed on our side, or upstream_error from the hypervisor. |
Rate limits
Each token may make 120 read and 30 write requests per minute. Ordering is further limited to 10 orders per 10 minutes per account. Responses carry X-RateLimit-Limit and X-RateLimit-Remaining; a 429 carries Retry-After.
Account
GET /account · scope read
Your account and exact credit balance.
curl -s https://v4vm.com/api/v1/account \
-H "Authorization: Bearer $V4VM_TOKEN"{
"id": "4b1c...",
"email": "[email protected]",
"name": "Ada",
"balance": {
"amount_micros": 25004500,
"currency": "EUR",
"formatted": "25,0045 €",
"spendable_cents": 2500
},
"token": { "id": "...", "name": "deploy", "scopes": ["read", "write"], "expires_at": null }
}Plans
GET /plans · scope read
Every plan you can order right now. in_stock is the live capacity check run before an order is taken (null when it couldn't be checked). billing_cycles lists what the API can order.
curl -s https://v4vm.com/api/v1/plans -H "Authorization: Bearer $V4VM_TOKEN"{
"data": [
{
"slug": "nl-2gb",
"name": "2 GB",
"location": { "country": "NL", "name": "Netherlands" },
"specs": { "vcpu": 2, "ram_gb": 2, "disk_gb": 40, "ipv4": 1 },
"currency": "EUR",
"prices": {
"monthly": { "amount_cents": 600, "currency": "EUR", "formatted": "6,00 €" },
"yearly": null,
"hourly": { "amount_micros": 9000, "currency": "EUR", "formatted": "0,009 €/h" },
"setup_fee": { "amount_cents": 0, "currency": "EUR", "formatted": "0,00 €" }
},
"billing_cycles": ["monthly", "hourly"],
"in_stock": true
}
]
}OS images
GET /os-images · scope read
Images you can install on a new server. Pass an image's id as os_image when ordering. One-click applications are listed too.
curl -s https://v4vm.com/api/v1/os-images -H "Authorization: Bearer $V4VM_TOKEN"{
"data": [
{ "id": 30, "name": "Ubuntu 26.04", "image_id": 7, "version": "26.04" },
{ "id": 16, "name": "Debian 13", "image_id": 4, "version": "13" }
],
"applications": [{ "id": 3, "name": "Docker" }],
"default_os_image_id": 16
}Servers
GET /servers · scope read
Your servers, newest first. Add ?include_terminated=1 to include removed ones. Power state in the list can be a few minutes old; fetch a single server for a live value.
curl -s https://v4vm.com/api/v1/servers -H "Authorization: Bearer $V4VM_TOKEN"GET /servers/{id} · scope read
{
"id": "9f2e...",
"hostname": "web1.example.com",
"status": "active",
"power_state": "started",
"plan": { "slug": "nl-2gb", "name": "2 GB" },
"location": { "country": "NL", "name": "Netherlands" },
"specs": { "vcpu": 2, "ram_gb": 2, "disk_gb": 40, "ipv4": 1 },
"ipv4": "203.0.113.10",
"ip_addresses": ["203.0.113.10"],
"os": "Debian 13",
"billing_cycle": "hourly",
"next_due_at": "2026-11-18T15:00:00.000Z",
"hourly_rate": { "amount_micros": 9000, "currency": "EUR", "formatted": "0,009 €/h" },
"addons": [],
"created_at": "2026-11-18T14:00:00.000Z",
"suspended_at": null,
"terminated_at": null
}| Field | Values |
|---|---|
status | pending, active, suspended, terminated |
power_state | started, stopped, paused, unknown, or null before setup finishes |
billing_cycle | monthly, yearly or hourly |
hourly_rate | Current hourly charge for hourly servers (plan plus extra IPs and add-ons), else null |
addons | Paid add-ons on the server (for example automatic backups) with their price per billing cycle |
Power actions
POST /servers/{id}/power · scope write
Body {"action": "start" | "stop" | "shutdown" | "restart"}. stop and shutdown both power the server off. Only active servers accept power actions; suspended or pending servers answer 409. The answer is 202: the signal was sent, the server changes state a few seconds later.
curl -s -X POST https://v4vm.com/api/v1/servers/$SERVER_ID/power \
-H "Authorization: Bearer $V4VM_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action":"restart"}'Ordering a server
POST /servers · scope write
Orders a server and pays for it from your account credit. There is no card or crypto step: if your credit doesn't cover it, the answer is 402 with amount_needed, and nothing is charged. Add funds under Billing · Add funds first.
| Field | Required | Notes |
|---|---|---|
plan | yes | A plan slug from GET /plans. |
billing_cycle | no | monthly (default) or hourly, if the plan lists it. |
hostname | no | Letters, digits, hyphens and dots. Left empty, we generate one. |
os_image | no | An id from GET /os-images. Defaults to the plan's default image. |
application | no | An application id from GET /os-images. |
ssh_key | no | A public key installed for root. Strongly recommended. |
Idempotency
An Idempotency-Key header is required (any unique string, for example a UUID). If a request times out, send it again with the same key and body: you get the original answer back (with Idempotent-Replayed: true) and never a second server. Reusing a key with a different body answers 422. When an order is refused (no credit, out of stock, invalid input) nothing is kept, so the same key can be retried after you fix the cause.
Billing
- Monthly: the first month is taken from your credit straight away, then the server renews monthly like any other.
- Hourly: your credit must cover at least the first hour. The first hour is charged when the server goes live, then every hour after that from your credit.
curl -s -X POST https://v4vm.com/api/v1/servers \
-H "Authorization: Bearer $V4VM_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"plan": "nl-2gb",
"billing_cycle": "hourly",
"hostname": "web1.example.com",
"ssh_key": "ssh-ed25519 AAAA... you@laptop"
}'HTTP/1.1 201 Created
{
"order": {
"id": "c0ff...",
"invoice_id": "1d2e...",
"invoice_number": "INV-1042",
"billing_cycle": "hourly",
"charged": { "amount_cents": 0, "currency": "EUR", "formatted": "0,00 €" },
"first_hour": { "amount_micros": 9000, "currency": "EUR", "formatted": "0,009 €" }
},
"server": { "id": "9f2e...", "status": "active", "...": "..." }
}Not enough credit:
HTTP/1.1 402 Payment Required
{
"error": {
"code": "insufficient_credit",
"message": "Not enough account credit. Add at least 4,00 € and try again.",
"required": { "amount_micros": 6000000, "currency": "EUR", "formatted": "6,00 €" },
"balance": { "amount_micros": 2000000, "currency": "EUR", "formatted": "2,00 €" },
"amount_needed": { "amount_cents": 400, "currency": "EUR", "formatted": "4,00 €" },
"top_up_url": "/account/funds"
}
}Terminating a server
DELETE /servers/{id} · scope write
Permanently deletes an hourly server and all its data, exactly like the Terminate button in the panel. Monthly and yearly servers can't be terminated by the customer (open a ticket instead). There is no refund; hours already charged stay charged. As a safety catch, the body must repeat the server's hostname:
curl -s -X DELETE https://v4vm.com/api/v1/servers/$SERVER_ID \
-H "Authorization: Bearer $V4VM_TOKEN" \
-H "Content-Type: application/json" \
-d '{"confirm":"web1.example.com"}'Invoices
GET /invoices · scope read
Your invoices, newest first. Optional query: status (draft, open, paid, void, uncollectible, refunded), limit (1 to 200, default 50) and offset. When has_more is true, pass next_offset as offset.
curl -s "https://v4vm.com/api/v1/invoices?status=open" -H "Authorization: Bearer $V4VM_TOKEN"{
"data": [
{
"id": "1d2e...",
"number": "INV-1042",
"status": "paid",
"currency": "EUR",
"subtotal": { "amount_cents": 600, "currency": "EUR", "formatted": "6,00 €" },
"tax": { "amount_cents": 0, "currency": "EUR", "formatted": "0,00 €" },
"total": { "amount_cents": 600, "currency": "EUR", "formatted": "6,00 €" },
"issued_at": "2026-11-18T14:00:00.000Z",
"due_at": null,
"paid_at": "2026-11-18T14:00:00.000Z"
}
],
"has_more": false,
"next_offset": null
}Good practice
- Keep tokens in a secret store or environment variable, never in a repository.
- Give each script its own token, read only unless it needs to change things, with an expiry.
- Revoke a token as soon as you suspect it leaked. Writes made with a token are recorded in your account activity.
- More help: the API guide in the help center.