Game hosting API: manage and order servers
Create an API key, control your servers, read the console and order new servers paid from prepaid balance.
With an organization API key, scripts and bots can do what you do on the server page. The full reference is in your control panel under Organization, Developers, Game servers.
1. Create a key
- Open Organization, Settings, API keys and create a key.
- Choose the scope game:read to read servers and console, or game:write to also control servers and order.
- Copy the key (it starts with org_k_). It is shown only once.
2. Control a server
GET
/api/v1/customer/game-serversv1POST
/api/v1/customer/game-servers/{id}/powerv1API="https://api.thunderhosting.com/management"
curl -H "Authorization: Bearer org_k_..." \
$API/api/v1/customer/game-servers
curl -X POST -H "Authorization: Bearer org_k_..." -H "Content-Type: application/json" \
-d '{"action":"restart"}' \
$API/api/v1/customer/game-servers/SERVER_ID/power3. Console: commands and output
GET
/api/v1/customer/game-servers/{id}/console?lines=100v1POST
/api/v1/customer/game-servers/{id}/command/capturev1curl -X POST -H "Authorization: Bearer org_k_..." -H "Content-Type: application/json" \
-d '{"command":"list","waitMs":1500}' \
$API/api/v1/customer/game-servers/SERVER_ID/command/capture
# {"command":"list","lines":["There are 2 of a max of 20 players online: Alex, Sam"]}The console endpoint returns the last lines (up to 500). The capture endpoint sends a command and returns what the server printed within the wait time. Use /command when you do not need the output.
4. Order a server with prepaid balance
POST
/api/v1/customer/game-servers/quotev1POST
/api/v1/customer/game-servers/ordersv1curl -X POST -H "Authorization: Bearer org_k_..." -H "Content-Type: application/json" \
-H "Idempotency-Key: my-order-001" \
-d '{"game":"minecraft-paper","plan":"custom","memoryMb":8192,"cpuPercent":200,
"diskMb":40960,"eulaAccepted":true,"acceptTerms":true}' \
$API/api/v1/customer/game-servers/orders- Top up your prepaid balance first; the order is paid from it at once.
- Use quote with the same body to see the price before ordering.
- If the balance is too low, the answer is 402 and nothing is ordered.
- Send an Idempotency-Key so a retried request never orders twice.
- Then poll the server list with the returned subscriptionId until the server is ACTIVE.
An API key is like a password for your organization. Keep it secret, give each script its own key and delete keys you no longer use.

