On this page

Presets, usage & keys

Store complete workspace settings and manage API access.

Saved presets

MethodPathBehavior
GET/v1/presetsList your presets
POST/v1/presetsCreate a preset
GET/v1/presets/{id}Load one preset
PATCH/v1/presets/{id}Update selected fields
DELETE/v1/presets/{id}Delete a preset
{
  "name": "Portrait study",
  "generator": "mesh-gradient",
  "params": {},
  "seed": 42,
  "size": { "width": 540, "height": 960, "pixelRatio": 2 },
  "format": "png",
  "mode": "image"
}

Name, generator, parameters and seed form the saved recipe. Size, format and mode are optional for compatibility with older presets. Generator parameters and export settings are validated before saving. Responses include ID, owner and creation/update timestamps.

Persistence and migration

SQLite stores presets, keys, jobs and daily usage in .data/shaderweave.sqlite. Writes use transactions and WAL mode.

At first startup, both legacy JSON stores are validated and backed up to .data/backups. Entity IDs are deduplicated and usage is combined by key and day. Completed imports are recorded so restarting does not import them twice. Invalid input aborts the import; original files remain intact.

Usage

GET /v1/usage returns { usage, keyId }. Each usage record contains keyId, day, stills and animations. The response covers all keys belonging to your workspace.

Only successful renders are counted. Cache hits count as successful requests. Failed or cancelled jobs do not count; completed jobs are counted once.

Keys

MethodPathBehavior
GET/v1/keysList key metadata
POST/v1/keysCreate with a label
DELETE/v1/keys/{id}Revoke immediately

A created key includes its plaintext secret once. Listing keys never returns that secret or its stored hash. See authentication.