Appearance
Internal API
Available inside the sprite via Unix socket. Used by the sprite-env CLI.
Socket: /.sprite/api.sock
Scope: Services and checkpoints for this sprite only.
Cannot modify: network policy, URL settings, sprite configuration, or anything else—those require the External API.
bash
curl --unix-socket /.sprite/api.sock http://sprite/v1/servicesOr use the CLI wrapper:
bash
sprite-env curl /v1/servicesServices
List Services
GET /v1/servicesjson
[
{
"name": "myapp",
"cmd": "/usr/bin/node",
"args": ["server.js"],
"env": {"NODE_ENV": "production"},
"dir": "/home/sprite/app",
"needs": [],
"http_port": 3000,
"state": {
"status": "running",
"pid": 1234,
"started_at": "2025-01-01T00:00:00Z",
"restart_count": 0
}
}
]Get Service
GET /v1/services/{name}Create/Update Service
PUT /v1/services/{name}json
{
"cmd": "/usr/bin/node",
"args": ["server.js"],
"env": {"NODE_ENV": "production"},
"dir": "/home/sprite/app",
"needs": ["postgres"],
"http_port": 3000
}Query params:
duration— Log stream duration (e.g.,10s,1m)
Response streams NDJSON:
json
{"type": "started", "data": "Service myapp started"}
{"type": "stdout", "data": "Server listening on :3000"}
{"type": "complete", "log_files": {"stdout": "/.sprite/logs/services/myapp.log"}}Delete Service
DELETE /v1/services/{name}Start/Stop Service
POST /v1/services/{name}/start
POST /v1/services/{name}/stopSignal Service
POST /v1/services/signaljson
{
"name": "myapp",
"signal": "TERM"
}Checkpoints
List Checkpoints
GET /v1/checkpoints
GET /v1/checkpoints?history=v1.2.3Get Checkpoint
GET /v1/checkpoints/{id}Create Checkpoint
POST /v1/checkpointStreams NDJSON progress.
Restore Checkpoint
POST /v1/checkpoints/{id}/restoreTriggers async restore and environment restart.