On this page

Generate

Synchronous render endpoint at POST /v1/generate/:slug

Render a recipe and return the binary (or text) asset immediately.

POST /v1/generate/{slug}
Authorization: Bearer <key>
Content-Type: application/json

Path

ParamDescription
slugGenerator id from discovery

Body

All fields optional.

{
  "params": {
    "colors": ["#FF5C38", "#FFCDB0", "#0C0C0E"],
    "speed": 0.6
  },
  "seed": 42,
  "size": {
    "width": 1920,
    "height": 1080,
    "pixelRatio": 1
  },
  "format": "png"
}
FieldDefaultNotes
params{}Merged over generator defaults
seed00 → derive from params
size1920×1080@1Validated against engine limits; never silently resized
formatpngSee recipes

Success

  • Body: binary (image/png, image/webp, image/gif, video/mp4, image/svg+xml) or text/css
  • Headers:
    • X-ShaderWeave-Recipe: base64url canonical recipe
    • X-ShaderWeave-Recipe-Hash: sha256 hex
    • X-ShaderWeave-Cache: HIT | MISS
    • X-ShaderWeave-Engine: version

Example

curl -s \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"seed":11,"format":"webp","size":{"width":640,"height":360}}' \
  http://localhost:3001/v1/generate/aurora-curtain \
  -o aurora.webp

GIF / MP4

Animated generators accept format: "gif" or "mp4". Rendering is synchronous within an animation budget; over budget → 504.

For long work, prefer async jobs.

Embed URL form

GET /v1/render/{recipeHash}?r={base64urlRecipe}&format=webp

The server re-hashes r and rejects mismatches (400). Direct requests require bearer authentication. Use an authenticated same-origin gateway for image tags. Optional w, h and pr query parameters select output dimensions.