warm: compute billing stops, the VM suspends, and the next inbound HTTP request wakes it in 100–500ms with process state preserved. If the Sprite stays idle long enough it transitions to cold. In-memory state is dropped and the next wake takes 1–2s.
Either way, work-in-progress stalls:
- Open TCP connections drop on the pause, even on warm. A websocket subscriber, a queue worker’s broker connection, an agent’s streaming API call: the remote end can’t be held across the suspension.
- Process state pauses on warm, dies on cold. A warm-paused agent loop resumes its work on wake; a cold one starts over.
When to use it
- AI coding agents running in the background (Claude Code, Codex) that should still be there when you come back
- Queue workers waiting on jobs from an external broker
- Anything holding outbound connections: websockets, MQTT, replication streams
When not to use it
- A web server with no other long-lived state. A Service plus the URL’s wake-on-request handles that without paying for compute while the Sprite is idle.
- A short script. Just run it and the Sprite stays up while it runs.
- Anything you might forget to clean up. A single forgotten task expires on its own, but a forgotten heartbeat loop keeps the Sprite billing until you notice.
The basics
All Tasks API calls go to the management socket at/.sprite/api.sock. Plain HTTP, JSON body, virtual host sprite. Inside a Sprite, sprite-env curl is a shorthand that handles the socket and host. sprite-env curl -X POST /v1/tasks -d '...' is equivalent to the long form below; this guide uses the explicit curl --unix-socket form to keep the wire-level mechanics visible.
Create a task. The Sprite is now held in an active state for an hour (the maximum lifetime per task):
The heartbeat pattern
A single task expires after at most an hour, so anything that needs to run longer uses a heartbeat: a short expiry, refreshed on a shorter interval, deleted on exit. If the process crashes without cleaning up, the task expires on its own and the Sprite pauses.Verifying
expires_at. If the list is empty, the Sprite isn’t held and will pause on the next idle window.
Tasks API reference
HTTP/JSON over/.sprite/api.sock, virtual host sprite.
List
Get
Create
expire is seconds (integer) or a duration string ("30m", "1h"). Maximum is 1 hour; longer holds require refreshing (see Upsert below). 201 on success, 409 if the name is taken.