How to connect Hetzner Cloud to Toolspoke
Give your Toolspoke agents read access to Hetzner Cloud servers, metrics, networks and volumes, and optionally let them create servers and change power state. One project API token, and an agent that reports on your servers.
Checked against Hetzner's documentation on 2026-11-25.
Toolspoke's Hetzner toolkit calls the Hetzner Cloud API at https://api.hetzner.cloud/v1 with a project API token you generate in the Hetzner Console. Once it's installed, any agent in the project can use it. This guide sets it up read-only first, so an agent can tell you what's running and how loaded it is before it can boot or power off anything. Then it builds an agent that reports on your servers.
It covers Hetzner Cloud projects only. Dedicated servers managed through Robot use different credentials and aren't part of this toolkit. It takes about five minutes.
What an agent can do once it's connected
The toolkit has 12 named actions. Ten of them only read:
- Servers:
list_serversreturns each server's status, type, datacenter and public IPs, plus the numeric ID the other actions need.get_serveradds attached volumes, private networks and firewalls. - Load:
server_metricsreads CPU, disk or network time series for one server. - Network and storage:
list_networksandlist_volumes. - What you could create:
list_server_types,list_images,list_locationsandlist_ssh_keys. - Progress:
get_actionpolls a long-running action until it succeeds or fails.
The other two change things:
| Action | What it changes | Kind |
|---|---|---|
create_server | Provisions a new server, which Hetzner bills you for | Write |
server_power | Power on, ACPI shutdown, hard power off, reboot or reset | Write |
There is no delete, rebuild or resize action. You decide which of the two your agents may call (step 3).
What you need
- A Hetzner Cloud project and access to its Security settings in the Hetzner Console.
- A Toolspoke workspace, and a project to install the toolkit in.
Step 1: Generate a project API token
You generate a Hetzner Cloud token inside a project, and the rate limit is counted per project. If you keep production and staging in separate projects, an agent only sees the project whose token you paste.
- In the Hetzner Console, open the project.
- Click Security in the left menu, then API tokens in the menu at the top.
- Choose Generate API token and give it a description, for example
toolspoke. - Choose a permission:
- Read only allows GET requests. That covers all ten read actions.
- Read & Write allows GET, POST, PUT and DELETE. You need it for
create_serverandserver_power.
- Copy the token. Hetzner can't show it again once the window closes.
- Your project
- Security
- API tokens
- Generate API token
Start with Read. If the team later wants agents to reboot servers, generate a second token with Read & Write and swap it in.
A Read & Write token can do anything in the project through Hetzner's API, including deleting servers. Through Toolspoke it can only call the two write actions above, because the toolkit exposes nothing else. Still, keep that token out of other tools.
Step 2: Install the Hetzner toolkit in Toolspoke
- In Toolspoke, open the project your agents work in. Find Hetzner in the marketplace and add it.
- Paste the API token from step 1.
list_locations answered. The credential works.
There is no base URL to enter. The toolkit always calls api.hetzner.cloud.
Toolspoke checks the connection by listing locations. If that fails, see Troubleshooting.
The token is encrypted at rest and attached to each request by the gateway. The agent never sees it, and it never appears in the arguments an agent sends or in the audit log.
Step 3: Decide what agents may change
In the project's toolkit settings, Hetzner's actions are grouped as read, write and destructive. Each one can be switched on or off for everyone in the project. An action that's switched off can't be called, whatever the prompt says.
If you pasted a Read token, the write actions fail at Hetzner anyway. Switch them off too, so agents don't try calls that can't work.
A sensible start is a Read token with both write actions off:
Hetzner actions in your project
Agents can call 10 of 12, and none of them change anything.
list_serversList the servers in the project with status, type, datacenter, and public IPs.get_serverFetch one server by id, including its attached volumes, private networks, and applied firewalls.server_metricsRead time-series metrics for one server — cpu (percent), disk (IOPS and bandwidth), or network (packets and bytes per second).get_actionPoll a long-running action by id to see whether it is still running, succeeded, or errored.list_server_typesList the server types available to the project with their cores, memory, disk, CPU type, and architecture.list_imagesList bootable images.list_locationsList the datacenter locations servers can be created in, with their city, country, and network zone.list_ssh_keysList the SSH keys stored in the project.list_networksList the project's private networks with their IP ranges, subnets, routes, and attached server ids.list_volumesList block-storage volumes with their size, location, format, and the server each one is attached to.
create_serverProvision a new cloud server.server_powerChange a server's power state: poweron boots it, shutdown asks the guest OS to halt via ACPI, poweroff cuts power immediately, reboot sends an ACPI restart, and reset is a hard restart.
If you pasted a Read & Write token, think about server_power before create_server. Power changes are the ones that take things offline:
shutdownsends an ACPI request. Hetzner notes the action only shows the request was sent, not that the OS actually halted.poweroffcuts power immediately. Hetzner compares it to pulling the power cord and says it may lose data.resetis a hard restart.
Every case keeps the server and its disks. create_server costs money from the moment the server exists, so leave it off unless someone asked for it.
Every call is recorded with the agent and person behind it, the request, the response and the duration.
Step 4: Build an agent that uses it
In Toolspoke, create an agent and describe its job in one sentence. The builder proposes the instructions, the toolkits it needs, a schedule and where it should answer. You add or skip each one, then create the agent. Every piece stays editable afterwards.
The same agent answers when someone asks it in Slack or emails it, and it replies in the thread it was asked in. With the write actions off, it can only look.
Try it
Ask the agent the way you'd ask whoever runs your servers:
- List my Hetzner servers with their type, location and IPs. Are any of them off?
- Show CPU and network for db-01 over the last 24 hours. Was it saturated around 03:00?
- Which volumes aren't attached to any server?
- Which private network is web-02 on, and which firewalls apply to it?
- Which server types with Arm CPUs can I create, and how much memory do they have?
- Reboot worker-03 and tell me when the action has finished.
The last one needs server_power switched on and a Read & Write token.
For metrics, the agent has to pass a start and an end time. Hetzner keeps metrics for the last 30 days only, and returns at most 500 samples per call, adjusting the step to fit. The CPU value is per vCPU, so 100 is full use of one core: on a 4-vCPU server, 100 means 25%.
For anything that returns an action, the agent polls get_action until it reports success or an error. The Hetzner toolkit page lists every action.
Troubleshooting
unauthorized (401).
The token is wrong, was deleted, or belongs to a different project than you think. Generate a new one in the right project.
Write calls fail while reads work.
The token has Read permission, which only allows GET requests. Generate a Read & Write token and paste it into the toolkit's credentials.
A server you can see in the console is missing.
It's in a different project. Each token only reaches its own project.
ratelimitexceeded (429).
Hetzner allows 3600 requests an hour per project by default, and refills about one request a second. The limit is shared with everything else that uses the project's API, such as Terraform or a Kubernetes cloud controller.
resourcelimitexceeded (403) on create.
The project has hit a quantity limit on that resource. The error's details say which.
locked (423) on a power change.
Another action is already running on that server. Wait for it with get_action and try again.
Questions
Does the agent see my Hetzner token?
No. The token is attached to the request by Toolspoke's gateway, never shown to the agent, and masked in the audit log.
Can an agent delete or rebuild a server?
No. The toolkit only has the 12 actions above. Deletes, rebuilds, rescaling, snapshots, firewall and DNS changes aren't reachable through it, whatever the token allows.
Does it cover Hetzner dedicated servers or Storage Boxes?
No. It's Hetzner Cloud only.
If an agent creates a server without SSH keys, where does the root password go?
Hetzner returns a one-time root password in the create response, which the agent then sees. Ask the agent to pass SSH keys from list_ssh_keys instead.