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, specified in seconds. When the TTL expires, Gameye force-terminates the container. Billing stops at the moment of termination.
{ "location": "europe", "image": "your-game-server", "ttl": 3600}The example above starts a session that will be automatically terminated after one hour (3600 seconds), regardless of what is happening inside the container.
When to use TTL
Section titled “When to use TTL”Development and testing — set a short TTL to prevent containers running indefinitely when you forget to clean up. A TTL of 600 (10 minutes) is a reasonable default for test sessions.
Matches with predictable maximum durations — if your matches cannot exceed 30 minutes, set ttl: 1800 as a safety net, and also call DELETE /session when the match ends normally. Whichever happens first terminates the session.
What happens at TTL expiry
Section titled “What happens at TTL expiry”Gameye force-terminates the container. The termination is immediate — there is no graceful shutdown signal before the TTL fires. If you need to preserve state (match results, logs, save files), ensure your server retrieves artifacts or writes to external storage before the TTL is reached.
To retrieve files from a container before or shortly after it terminates, use the GET /artifact endpoint.
TTL vs explicit stop
Section titled “TTL vs explicit stop”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.