The Hetzner Inference API is an OpenAI-compatible LLM endpoint at inference.hetzner.com/v1, billed in euros per million tokens. It serves GLM 5.3, GLM 5.3 Flash, Aleph Alpha’s Kolibri 1 and the BGE M3 embedding model from Hetzner’s own hardware. The token management API went GA on December 1, and the free experiment on the same host ends December 8. Most of what you need to know fits in four facts: it is cheap but not the cheapest, it caps spend per token, it answers from Finland by our measurements, and GLM reasons at full effort unless you tell it otherwise.
We walk through a capped token, the first curl and Python calls, the reasoning trap that returns empty answers, and what 100 requests cost at list price against OpenRouter’s GLM 5.3 Flash providers. Network latency and the error probes come from our own curl runs in Falkenstein, Frankfurt, Finland and US East against the live endpoint. Token, model and billing behavior follows Hetzner’s docs as of December 2026, and the price comparison uses OpenRouter’s live endpoint list.
What the Hetzner Inference API actually serves
Think of it as a hosted, pay-per-token LLM gateway with no GPU to rent and no server to manage. You create an inference token in the Hetzner Console, point any OpenAI SDK at https://inference.hetzner.com/v1, and pay for input, cached input and output tokens on a monthly invoice. Hetzner’s pricing page says prompts and outputs are not retained, and that prompt-cache fragments stay only briefly in RAM, which is the main reason a European team would pick it over a US router.
The compatibility docs list six routes: GET /v1/models, POST /v1/chat/completions, /v1/responses, /v1/embeddings, and the Anthropic-style /v1/messages plus /v1/messages/count_tokens. Everything else the OpenAI SDK can call is missing, and a few of those gaps change how you’d build on it:
- No legacy completions.
/v1/completionsis not there, so old code that sends a bareprompthas to move to chat messages. - No batches or files. There’s no
/v1/batchesdiscount path, so bulk jobs pay the same per-token price as live traffic. - Nothing stored on the Responses API.
previous_response_iddoes not work andbackground: truereturns 400, so you resend the conversation each turn. - Images as base64 only. GLM 5.3 Flash reads images, but an image URL gets a 400; encode the file into the request instead.
Two quieter behaviors matter more than the missing routes. Unknown request fields are silently ignored, so a misspelled parameter will not raise an error. It simply does nothing. And prompt caching is always on, which is why the cached input price below is worth reading.
Which models it runs and what they cost
Hetzner lists four models as of December 1, 2026. Prices are in euros per million tokens without VAT, taken from the pricing page, and the API names come from the models and licences page. Use the API name exactly as written, because model names are case-sensitive.
| Model | API name | Input | Cached input | Output |
|---|---|---|---|---|
| GLM 5.3 Flash (MIT) | zai-org/GLM-5.3-Flash | €0.10 | €0.025 | €0.40 |
| GLM 5.3 | zai-org/GLM-5.3 | €0.63 | €0.158 | €2.52 |
| Kolibri 1 (Apache 2.0) | Aleph-Alpha/Kolibri-1 | €0.07 | €0.018 | €0.28 |
| BGE M3 (embeddings) | BAAI/bge-m3 | €0.01 | n/a | free |
According to the models page, all three chat models run quantised to NVFP4, while BGE M3 runs in BF16. GLM Flash is the one most people will start with: it handles chat, code and images, and it is priced a little above Kolibri 1. Hetzner’s models and licences page lists second names for the GLM models, the lowercase OpenRouter-style z-ai/glm-5.3-flash and z-ai/glm-5.3, so code written for OpenRouter often works after a base URL change. The same page recommends the Hugging Face names. Hetzner says it announces a model’s retirement about two months ahead, and after shutdown the old name starts returning 401.
How to create a capped inference token
In the Hetzner Console, open your project, choose Inference, then Create Inference Token. Keep the Usage-Based type, give it a name, set the monthly cost cap with the slider and confirm with Create & Buy now. Hetzner shows the token once; it starts with hit_, and cannot be recovered later, so put it in your secret store before closing the dialog.
A cap is what makes this safe to hand to a CI job. Hetzner’s limits docs put it between €1 and €20,000 per month, defaulting to €10 when you do not set one, and the pricing page suggests a €1 token for testing. The cap is checked before a request starts, though, so a request already in flight still finishes. Their own example ends a month at €10.09 on a €10 cap, which you should budget for when you cap tightly.
Tokens can also be created over the Hetzner management API, which is how you’d script per-environment tokens. That API takes a project API token from Security, API Tokens in the Console with Read & Write permission, not an inference token. A Read-only project token fails the POST. The request below follows the POST /inference_tokens schema in Hetzner’s published OpenAPI spec, with a €1 cap and a label:
curl -X POST https://api.hetzner.com/v1/inference_tokens \
-H "Authorization: Bearer $HETZNER_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"ci-test","inference_token_type":"usgb","cost_cap":{"net":"1.00"},"labels":{"env":"ci"}}'
The response carries the secret in key (again, only this once) and a short key_prefix you can use to recognise the token later. The cap is a net amount in your account’s currency, written as a string with exactly two decimals; "1" or 1.0 will not match the schema’s pattern. Raising the cap later is a PUT /inference_tokens/{id} with a new cost_cap, and the spec says the new value cannot be lower than what the token has already used this month.
Each account can hold 20 inference tokens. That is enough for one per service and environment, but not for one per developer on a large team, so we’d group them by workload and lean on labels.
What a first request looks like with curl
Hetzner’s text-generation docs read the token from HETZNER_INFERENCE_TOKEN, and we’d keep that name so their examples paste cleanly. Export it in the shell you’ll test from:
export HETZNER_INFERENCE_TOKEN="paste-the-hit-token-here"
Listing the models first is the cheapest way to prove the token works, since it costs nothing and returns the exact names the token is allowed to call. The max_model_len field in each entry is also where the context window comes from if you’d rather not trust a docs page:
curl https://inference.hetzner.com/v1/models \
-H "Authorization: Bearer $HETZNER_INFERENCE_TOKEN"
Then send a chat completion. This is the docs’ request with reasoning_effort and max_tokens added, because leaving them out on GLM is the most common way to get a slow, expensive “Hello” (the reasoning section below explains why):
curl https://inference.hetzner.com/v1/chat/completions \
-H "Authorization: Bearer $HETZNER_INFERENCE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "zai-org/GLM-5.3-Flash",
"messages": [{"role": "user", "content": "Hello!"}],
"reasoning_effort": "low",
"max_tokens": 1024
}'
A successful reply puts the answer in choices[0].message.content, any reasoning in choices[0].message.reasoning, and usage.completion_tokens_details.reasoning_tokens tells you how much of the bill went on thinking. Check finish_reason as well: stop means the model finished, while length means it hit max_tokens.
For streaming, add "stream": true and run curl with -N so it does not buffer the server-sent events. Content arrives in choices[0].delta.content and reasoning in choices[0].delta.reasoning. The compatibility docs note that every streamed chunk carries a usage object, so you can count tokens as they arrive without asking for stream_options.
curl -N https://inference.hetzner.com/v1/chat/completions \
-H "Authorization: Bearer $HETZNER_INFERENCE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "zai-org/GLM-5.3-Flash",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}'
Some gateway errors come back as plain text instead of JSON, which trips client code that always calls .json() on the response. We saw that on every unauthenticated probe below, so wrap the parse rather than assume an error object.
How the OpenAI Python SDK talks to it
No Hetzner SDK exists or is needed. The official openai package works once base_url points at Hetzner, which also means LangChain, LlamaIndex and most agent frameworks work the same way. Install it into a project environment:
pip install openai
Save the following as first_call.py. It’s Hetzner’s documented Python example; the client reads the same environment variable as the curl calls, and the model’s answer is printed from message.content:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://inference.hetzner.com/v1",
api_key=os.environ["HETZNER_INFERENCE_TOKEN"],
)
response = client.chat.completions.create(
model="zai-org/GLM-5.3-Flash",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
Pass reasoning_effort="low" straight into create() when you do not need deep reasoning, and the SDK sends it as-is. Retries deserve a look too. Hetzner’s limits page says the OpenAI and Anthropic SDKs retry a 429 twice by default and wait for the Retry-After header, which handles the rate limit for you. A token that has hit its cost cap also returns 429, though, and those retries fail every time, so alert on that case instead of raising max_retries.
Embeddings use the same client with BAAI/bge-m3 on /v1/embeddings. A list of texts in input counts as one request toward the rate limit, which is the cheapest way to embed a corpus:
response = client.embeddings.create(
model="BAAI/bge-m3",
input=["First text", "Second text"],
)
for item in response.data:
print(item.index, item.embedding[:5])
Each text can be at most 8,192 tokens, and the docs say to keep each request to about a million tokens at most, because larger requests are not processed faster and cost more to resend when they fail. Sending a chat model to /v1/embeddings, or BGE M3 to chat, returns a 404 route not found instead of a helpful model error.
Why GLM returns an empty reply at low max_tokens
GLM 5.3 and GLM 5.3 Flash default to reasoning_effort max, according to Hetzner’s models page. Reasoning tokens are part of completion_tokens and count toward max_tokens, so a request with max_tokens of 100 can spend all 100 on thinking. The docs spell out the result: content is empty or missing, and finish_reason reads length. Code that only checks for a 200 status treats that as a successful blank answer.
Setting the effort explicitly solves it, as long as you pick a value GLM accepts. Hetzner lists only low, high and max for the GLM models, and an unsupported level silently falls back to max. So "none" or "medium", both normal values elsewhere, quietly give you the most expensive behavior. Kolibri 1 is different: it accepts levels from none to max and defaults to high.
- Short answers, classification, extraction:
reasoning_effortlow with amax_tokensthat leaves room for the answer. - Code and multi-step tasks: high, and a generous
max_tokens, then readreasoning_tokensfrom usage for a week before deciding. - Anthropic SDK users:
output_config.effortlow turns GLM Flash reasoning off;thinkingdisabled does not fully stop it, per the compatibility docs.
Hetzner’s billing page and its Anthropic SDK page both say reasoning tokens are billed as output tokens, which would put them at €0.40 per million on GLM 5.3 Flash, the same as the visible answer. Hold your first week of traffic to that: compare the reasoning_tokens your client logs against the per-model usage the Console shows for the token. If the docs hold, the reasoning-to-answer ratio drives the bill far more than the list price does.
How far the endpoint is from your servers
Time to first token is network time plus queueing plus prompt processing, and only the first part depends on where your code runs. We measured that part on December 1, 2026, with a small script that posts an empty body twenty times to each chat endpoint and records TCP connect, TLS handshake and the moment the 401 answer arrives. No token is needed, nothing is billed, and the same request goes to OpenRouter for comparison:
#!/bin/bash
# 20 unauthenticated requests per endpoint: connect, TLS and time to the 401 answer, in ms (median, min, max)
N=${N:-20}
probe() {
name=$1; url=$2
for i in $(seq $N); do
curl -s -o /dev/null -w '%{time_connect} %{time_appconnect} %{time_starttransfer}\n' -X POST "$url" -H 'Content-Type: application/json' -d '{}'
done | python3 -I -c "
import sys,statistics as s
r=[list(map(float,l.split())) for l in sys.stdin]
for i,lab in enumerate(['tcp','tls','401']):
v=sorted(x[i]*1000 for x in r)
print(f'$name {lab:4} median {s.median(v):6.1f} ms min {v[0]:6.1f} max {v[-1]:6.1f}')
"
}
echo "# $(date -u '+%Y-%m-%d %H:%M UTC') $(hostname -s) N=$N"
probe hetzner https://inference.hetzner.com/v1/chat/completions
probe openrouter https://openrouter.ai/api/v1/chat/completions
Curl’s timers are cumulative, so the tls column is when the handshake finished and the 401 column is the whole round trip to an answer. From a Hetzner dedicated server in Falkenstein, Germany, the kind you’d get after installing Proxmox VE on a Hetzner root server, the result surprised us:

A Hetzner box in Germany reaches Hetzner’s inference endpoint in 107 ms but OpenRouter in 38 ms. The 35 ms TCP connect is the giveaway: that’s a cross-border round trip, not a hop inside one data center. The IP that inference.hetzner.com resolved to on test day geolocates to Helsinki, while api.hetzner.com resolves to Nuremberg, so the inference servers aren’t in the German sites at all.
A Google Cloud VM in Frankfurt (europe-west3) tells the same story, a little slower to Hetzner and about the same to OpenRouter, which answers from close by wherever you are:

Moving the client to Finland flips the result. From Google Cloud’s europe-north1 region in Hamina, about 150 km from Helsinki, the TCP connect drops to 5.5 ms and the full answer to 26.7 ms, half of OpenRouter’s time from the same VM:

From US East (Google Cloud us-east1), every new connection pays an Atlantic crossing three times over: once for TCP, once for the TLS handshake and once for the request itself. The answer took 350 ms against OpenRouter’s 51 ms:

Put side by side, the medians show that location matters more than provider for this part of the latency budget:
| Client location (Dec 1, 2026, network only) | Hetzner TCP | Hetzner TLS done | Hetzner 401 answer | OpenRouter 401 answer |
|---|---|---|---|---|
| Hetzner server, Falkenstein DE | 35.1 ms | 72.6 ms | 107.4 ms | 37.9 ms |
| Google Cloud, Frankfurt DE | 43.5 ms | 90.1 ms | 132.0 ms | 39.0 ms |
| Google Cloud, Hamina FI | 5.5 ms | 22.8 ms | 26.7 ms | 51.0 ms |
| Google Cloud, US East | 116.4 ms | 236.0 ms | 350.3 ms | 51.0 ms |
Most of that gap disappears once a connection is open. We sent five requests in one curl invocation from the Falkenstein server, which keeps the TLS session alive between them:

Only the first request opened a connection; the next four answered in 34.8 ms each, saving about 70 ms per call. The OpenAI SDK keeps a connection pool, so a long-lived worker pays the handshake once. A serverless function or a shell script that spawns curl per request pays it every time, and from the US that’s roughly 230 ms of pure handshake before the model sees a token.
To see full time to first token with a real token, run the streaming request from earlier with -o /dev/null -w '%{time_starttransfer}\n' added; on a stream, that timer stops when the first chunk arrives. Queueing and prefill then sit on top of the network numbers above, and they’re the part that differs between Hetzner’s GPUs and whichever provider OpenRouter routed you to. If your app already runs on Hetzner, say a cluster built with KubeOne in Hetzner Cloud, putting the workers in Helsinki is the cheapest latency win available.
What 100 requests cost at list price against OpenRouter
OpenRouter listed 40 provider endpoints for z-ai/glm-5.3-flash when we pulled its endpoint API on December 1, 2026, priced in US dollars and ranging from $0.0356 input and $0.0815 output (Relace) to $0.225 and $0.75 (a Fireworks tier). Z.AI’s own first-party endpoint sat at $0.15 and $0.50. Hetzner charges €0.10 and €0.40, which puts it in the middle of that range and well above the floor.
Our table works out 100 requests at two token profiles from those list prices. Profile A is 1,000 input and 1,000 output tokens per request, roughly a short chat turn at low effort. Profile B keeps the input and assumes 4,000 output tokens, a stand-in for max reasoning billed as output the way Hetzner’s billing page describes. Both profiles are a calculation, not metered usage. Hetzner’s figures are euros without VAT; OpenRouter’s are dollars, so compare the shape rather than the cents:
| Endpoint (GLM 5.3 Flash) | Input / output per 1M | 100 requests, profile A | 100 requests, profile B |
|---|---|---|---|
| Hetzner | €0.10 / €0.40 | €0.050 | €0.170 |
| OpenRouter, Relace (cheapest) | $0.0356 / $0.0815 | $0.012 | $0.036 |
| OpenRouter, DeepInfra | $0.09 / $0.30 | $0.039 | $0.129 |
| OpenRouter, Z.AI first party | $0.15 / $0.50 | $0.065 | $0.215 |
| OpenRouter, Fireworks (top tier) | $0.225 / $0.75 | $0.098 | $0.323 |
Against the cheapest OpenRouter row, Hetzner’s nominal price is about 2.8 times higher on input and 4.9 times on output (euros against dollars, so the real gap is a little wider). That matches the “3x and 5x” gap a commenter worked out in the Hacker News launch thread. Others in that thread pointed out the catch: the cheapest providers rotate, run different quantisations (Relace lists fp4) and sometimes return errors or rate limits. Against Z.AI’s own endpoint, Hetzner is cheaper on both input and output before currency conversion.
Profile B is the column to watch. If max reasoning really adds 3,000 output tokens per call, the bill roughly triples on every row, which is a bigger swing than switching providers. Two billing details from Hetzner’s docs also bite at small volume. Each invoice line (model, token type and token) is rounded up to the next cent. And the Console shows consumption without VAT, so the invoice total is higher once VAT applies. A test token that sends a handful of requests across three models will show a few cents of rounding on the invoice.
Errors you will hit and what each one means
Hetzner’s gateway checks the token before it looks at the path. We sent requests without a token and with a made-up one to four routes, including two that Hetzner documents as unsupported, and every one answered the same way:

So a 401 on /v1/completions from a test without a valid token proves nothing about the route. Note the two formats as well: the inference gateway answers in plain text, while the management API at api.hetzner.com returns a JSON error object. The plain unauthorized text below comes from that run. The other messages, including inference error: Unauthorized - unauthorized, are quoted from Hetzner’s error-codes and limits pages.
unauthorized (HTTP 401)
A plain unauthorized means the token is missing, mistyped, deleted, or sent in the wrong header. Hetzner only reads Authorization: Bearer; a token in x-api-key, the Anthropic default, is rejected. With the Anthropic SDK, pass the token as auth_token and use the base URL https://inference.hetzner.com without /v1.
inference error: Unauthorized – unauthorized
Here the token is fine but the model is not. Hetzner’s error-codes page says it returns 401 on purpose for a model name that’s misspelled, wrongly cased or not allowed for this token, rather than a 404, so callers can’t probe which models exist. The models page adds retired models to that list. Compare the name against GET /v1/models with the same token. Since the docs call model names case-sensitive, zai-org/glm-5.3-flash is a different name from zai-org/GLM-5.3-Flash.
ResourceExhausted – token limit exceeded (HTTP 429)
This one means the token has reached its monthly cost cap, €10 if you never changed it. Nothing resets until the next month unless you raise the cap in the Console or with the management API. Monitoring that alerts on 429s has to tell this apart from the next error, which shares the status code and needs the opposite response. Hetzner notes the wording of these texts can change and tells you to key on the status code. Since both cases share 429, we would still match loosely on “token limit” and “rate limit” to route the alert.
ResourceExhausted – rate limit exceeded (HTTP 429)
The token sent more than 100 requests per minute to one model. The response carries a Retry-After header, so wait that long and retry. Parallel requests count toward the limit too, and it applies per model per token. Hetzner raises it on a support request where you explain why 100 is not enough.
route not found (HTTP 404)
A 404 means the model and the endpoint do not match, such as BGE M3 on /v1/chat/completions or GLM on /v1/embeddings. Check which endpoint the model belongs to in the table above before suspecting the URL itself.
max_tokens cannot be greater than max_model_len (HTTP 400)
The full message is max_tokens=... cannot be greater than max_model_len=..., with your numbers filled in. Read max_model_len from /v1/models and cap below it. Other 400s in the same family are No user query found in messages. for a request with no user turn, and Unsupported Media Type: Only 'application/json' is allowed when the content type header is missing.
Two limits round this out: a request body over 32 MiB gets a 413, and a request that runs longer than 300 seconds is cancelled. Without streaming that shows up as a 504; a stream is simply cut off, which a long max-effort answer can reach.
Why hcloud and Terraform can’t create the token yet
Hetzner’s integrations page already documents an hcloud inference command group and names the Terraform provider, the Ansible collection and the Go and Python libraries as ways to manage tokens. The catch is its first prerequisite: “the hcloud CLI in a version with support for the Inference API”. On December 1, 2026 no such release existed. The latest CLI was v1.71.0 from November 26, with no inference command in its tree, and the hcloud Terraform provider’s latest release, v1.70.2 from October 26, has no inference token resource.
Once a supporting release lands, Hetzner’s page says token creation is a single command that takes a name, the usage-based type and the monthly cap, and prints the key once. It uses the same project API token as your existing hcloud context:
hcloud inference token create --name inference-token-1 --type usgb --cost-cap 5.00
The same page lists hcloud inference model list, token list, token list-models for per-model usage, token update and token delete. Run hcloud version first, because v1.71.0 and older don’t have the inference command group at all.
Until then, the management API is the path that works, and it is complete. Hetzner’s OpenAPI spec covers the full token lifecycle (list, get, create, update and delete), and separate paths list models and token types. We would wrap the create call from earlier in a small script your pipeline runs and store the returned key in your secret manager. Keep the rest of the project where it already lives, whether that’s managing servers with the hcloud CLI or deploying Hetzner Cloud instances with Terraform. A Terraform http data source is not a good fit, because the key only appears once and would land in state.
The management endpoint confirms its auth shape without a token too: GET https://api.hetzner.com/v1/inference_models returns {"error":{"code":"unauthorized","message":"token is required"}}, as the probe screenshot above shows. The CLI and provider commands, when they ship, sit on these same endpoints, so a curl script written today keeps working after you switch.
Where the Hetzner Inference API breaks down
Price is not the reason to pick it. If cost per token is the only metric, the cheapest OpenRouter providers undercut it by three to five times, and a batch job gets no discount here because there’s no batch endpoint. What you pay for is one provider, one quantisation, a hard monthly cap per token, zero retention and an EU invoice. For regulated workloads or a team that is already billed by Hetzner, that is worth the gap.
- US-based apps: the 350 ms first-request round trip we measured adds up fast without connection reuse; route through a US provider instead.
- Bursty traffic: 100 requests per minute per model per token is low for a busy API, and raising it means a support ticket.
- Large model choice: four models is the whole catalogue. Anything else means self-hosting, and the vLLM cheat sheet and our GPU guide for LLMs cover that path.
- Stateful agents: no stored responses and no files API means the client carries every conversation and document itself.
For an EU team running workers on Hetzner, we would set a capped token per service and reasoning_effort on every GLM call. Then put the workers in Helsinki next to the endpoint, where our Finland numbers beat OpenRouter on network time. If you’re still choosing where those workers run, our comparison of cheap VPS hosting prices puts Hetzner’s cloud plans next to the alternatives. Hetzner’s limits page is the one to bookmark, because the cap, rate limit and context sizes there are what you’ll tune first.