Skip to content

How does TTL work and how does billing stop?

A TTL (Time to Live) is a maximum session lifetime you set at session start time, given as a duration string with unit m (minutes) or h (hours) — for example "15m" or "2h". Leaving it empty means the session has no TTL and runs until it is stopped. When the TTL expires, Gameye stops the container the same way as a DELETE /session. Billing stops when the container exits.

{
"location": "europe",
"image": "your-game-server",
"ttl": "1h"
}

The example above starts a session that Gameye stops after one hour ("1h"), regardless of what is happening inside the container.

Development and testing — set a short TTL to prevent containers running indefinitely when you forget to clean up. A TTL of "10m" is a reasonable default for test sessions.

Matches with predictable maximum durations — if your matches cannot exceed 30 minutes, set ttl: "30m" as a safety net, and also call DELETE /session when the match ends normally. Whichever happens first terminates the session.

Gameye sends SIGTERM to the container’s main process, the same signal as a DELETE /session. If the process is still running 50 seconds later, Gameye kills it with SIGKILL. Handle SIGTERM to save match results, logs or save files to external storage, then exit. Each engine guide shows how: Unity, Godot and Unreal.

To retrieve files from a container before or shortly after it terminates, use the GET /artifact endpoint.

Both TTL and DELETE /session stop billing at the moment the container terminates. Use whichever is appropriate for your architecture — TTL as a safety net, explicit stop as the primary lifecycle signal from your backend.