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
| Param | Description |
|---|---|
slug | Generator 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"
}
| Field | Default | Notes |
|---|---|---|
params | {} | Merged over generator defaults |
seed | 0 | 0 → derive from params |
size | 1920×1080@1 | Validated against engine limits; never silently resized |
format | png | See recipes |
Success
- Body: binary (
image/png,image/webp,image/gif,video/mp4,image/svg+xml) ortext/css - Headers:
X-ShaderWeave-Recipe: base64url canonical recipeX-ShaderWeave-Recipe-Hash: sha256 hexX-ShaderWeave-Cache:HIT|MISSX-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.