The v4VM API lets scripts and tools do what you do in the panel: list your servers, start and stop them, order new ones paid from your credit, and read invoices. The full endpoint list is in the API reference.
Step 1: Create a token
Open Account โ API tokens and fill in:
- Name: something you'll recognise later, like
deploy-script. - Access: Read only for scripts that only look (dashboards, monitoring). Read and write for scripts that power servers, order or terminate.
- Expires: pick the shortest period that works. Choose Never only for tokens you rotate yourself.
Copy the token straight away. It is shown once; we store only a hash of it.
Step 2: Make a request
Send the token in the Authorization header:
export V4VM_TOKEN="v4vm_..."
curl -s https://v4vm.com/api/v1/servers -H "Authorization: Bearer $V4VM_TOKEN"The answer is JSON. Errors always look like {"error": {"code": "...", "message": "..."}} with a matching HTTP status.
Common tasks
Restart a server:
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"}'Order an hourly server 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-1gb","billing_cycle":"hourly","ssh_key":"ssh-ed25519 AAAA... you@laptop"}'Find plan slugs with GET /api/v1/plans and OS image ids with GET /api/v1/os-images.
Paying for orders
Orders placed through the API are paid from your account credit only. If your credit doesn't cover the order, the API answers 402 with the amount you need to add, and nothing is charged. Add funds under Billing โ Add funds, then send the same request again.
- Monthly: the first month is taken from credit right away.
- Hourly: your credit must cover at least the first hour, which is charged when the server goes live. See Hourly vs monthly billing.
Always send an Idempotency-Key header (a fresh UUID per order). If the connection drops, repeat the request with the same key and body: you get the original answer back instead of a second server.
What the API can't do
The API never has more power than your panel login. In particular:
- Only hourly servers can be terminated through the API (send
{"confirm": "<hostname>"}as the body). Monthly and yearly servers are cancelled through a ticket, as in the panel. - Suspended servers don't accept power actions.
- Coupons, card, PayPal and crypto payments are panel only.
Limits
Each token can make 120 read and 30 write requests per minute, and an account can place 10 orders per 10 minutes. When you hit a limit the API answers 429 with a Retry-After header.
Keeping tokens safe
- Store tokens in a secret manager or environment variable, never in a repository.
- Use a separate token per script, read only where possible.
- If a token leaks, revoke it under Account โ API tokens. It stops working immediately.
- Writes made with a token (orders, power actions, terminations) are recorded in your account activity.