{"components":{"securitySchemes":{"apiKey":{"description":"An API key of your workspace (`rmg_…`), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"Clip":{"type":"object","properties":{"cleanVideoKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]},{"type":"null"}],"description":"Storage key of the clip without captions or hook burned in (`video.mp4`), for an editor; `null` for clips made before editor outputs existed.","examples":["jobs/5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40/clips/0/video.mp4"]},"cleanVideoUrl":{"anyOf":[{"type":"string","format":"uri","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]},{"type":"null"}],"description":"URL of `video.mp4`, the clip with nothing burned in (same access rules as `videoUrl`); `null` when there is none.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When the clip was stored.","examples":["2026-09-27T12:00:00.000Z"]},"durationSeconds":{"type":"number","minimum":0,"description":"Clip length in seconds.","examples":[42.5]},"endSeconds":{"type":"number","minimum":0,"description":"Where the clip ends in the source video, in seconds.","examples":[175.2]},"hookText":{"type":"string","description":"Headline of the hook card.","examples":["Nobody tells you this about pricing"]},"id":{"type":"string","description":"Clip id.","examples":["9d2e7a61-3b0f-4c1e-b5a8-7f4d2c6e1a93"]},"index":{"type":"integer","minimum":0,"description":"Position in the job's clip list, starting at 0.","examples":[0]},"jobId":{"type":"string","description":"The job this clip belongs to.","examples":["5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40"]},"layout":{"type":"string","description":"Layout covering most of the clip: `track` (follows one subject), `general` (whole frame over a blurred background), `split` (two-shot stacked), `side_by_side` (two-shot side by side, 16:9), `alternate` (speaker cuts), `stream` (a streamer's webcam and the gameplay, stacked or inset) or `screencast` (a screen recording, over its webcam when it has one).","examples":["track"]},"posterKey":{"type":"string","description":"Storage key of the poster image.","examples":["jobs/5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40/clips/0/poster.jpg"]},"posterUrl":{"type":"string","format":"uri","description":"URL of the poster image (JPEG). Public when the deployment has a public storage domain, otherwise presigned and valid for 1 hour.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"score":{"type":"integer","description":"How strong the moment is, 0-100 (higher is better), as ranked by the selector.","examples":[87]},"startSeconds":{"type":"number","minimum":0,"description":"Where the clip starts in the source video, in seconds.","examples":[132.7]},"title":{"type":"string","description":"Suggested title for the clip.","examples":["Why most startups underprice"]},"videoKey":{"type":"string","description":"Storage key of the rendered video.","examples":["jobs/5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40/clips/0/clip.mp4"]},"videoUrl":{"type":"string","format":"uri","description":"URL of the rendered vertical clip (MP4). Public when the deployment has a public storage domain, otherwise presigned and valid for 1 hour.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]},"wordsKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"Storage key of `words.json`: clip-relative word timings, the resolved caption style and pages, the hook (text, style, placement, visibility) and layout ranges. Schema: apps/clip-worker/schemas/words.schema.json.","examples":["jobs/5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40/clips/0/words.json"]},"wordsUrl":{"anyOf":[{"type":"string","format":"uri","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"URL of `words.json` (same access rules as `videoUrl`); `null` when there is none.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["cleanVideoKey","cleanVideoUrl","createdAt","durationSeconds","endSeconds","hookText","id","index","jobId","layout","posterKey","posterUrl","score","startSeconds","title","videoKey","videoUrl","wordsKey","wordsUrl"],"description":"One finished vertical clip."},"ClipExport":{"type":"object","properties":{"clipId":{"type":"string","description":"The clip this export re-renders.","examples":["9d2e7a61-3b0f-4c1e-b5a8-7f4d2c6e1a93"]},"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When the export completed; `null` until then.","examples":["2026-09-27T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When the export was requested.","examples":["2026-09-27T12:00:00.000Z"]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the export failed; otherwise `null`.","examples":[null]},"id":{"type":"string","description":"Export id.","examples":["3c7b1e90-52d4-4f8a-9e61-0b2d7a4c5f18"]},"jobId":{"type":"string","description":"The job the clip belongs to.","examples":["5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40"]},"options":{"type":"object","properties":{"captionStyle":{"type":"object","properties":{"animation":{"type":"object","properties":{"bgColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Box behind the spoken word (word-bg-highlight); null: none."},"highlightColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Text colour of the spoken word; null: the font colour."},"name":{"enum":["none","karaoke-fill-pop","pop","scale","box-highlight","word-bg-highlight","glitch-zoom","bounce","shake","blur-switch","focus","blur-in","words-pop","slide-down","hover","scale-in","breathe","glow","reveal"],"type":"string"}},"additionalProperties":false},"background":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean","description":"A box behind every line (replaces the outline and shadow)."},"opacity":{"type":"number","minimum":0,"maximum":1,"examples":[1]}},"additionalProperties":false},"font":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"family":{"enum":["Anton","Archivo","Bangers","Barlow Condensed","Bebas Neue","Courier Prime","Heebo","Kanit","Lemon","Lilita One","Montserrat","Noto Serif","Oswald","Poltawski Nowy","Poppins","Roboto","Spline Sans"],"type":"string"},"italic":{"type":"boolean"},"letterSpacing":{"type":"number","minimum":-10,"maximum":40,"description":"Extra space after every character, in reference units.","examples":[1]},"size":{"type":"number","maximum":200,"exclusiveMinimum":0,"description":"In reference units: 1 unit is the frame's short side / 540 px (a 40-unit font has an 80 px em at 1080×1920).","examples":[2457600]},"weight":{"type":"integer","minimum":100,"maximum":900,"description":"The closest bundled weight of the family is drawn.","examples":[1]}},"additionalProperties":false},"highlight":{"type":"object","properties":{"primary":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"secondary":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Colour already-spoken words keep (karaoke-fill-pop)."}},"additionalProperties":false},"layout":{"type":"object","properties":{"lines":{"enum":["single","multi"],"type":"string"},"maxCharsPerLine":{"type":"integer","minimum":4,"maximum":60,"examples":[1]},"maxLines":{"type":"integer","minimum":1,"maximum":4,"description":"Used when `lines` is `multi`.","examples":[1]},"maxSeconds":{"type":"number","minimum":0.3,"maximum":10,"description":"A page never spans more seconds of speech than this.","examples":[5]},"maxWordsPerLine":{"type":"integer","minimum":1,"maximum":12,"examples":[1]}},"additionalProperties":false},"position":{"type":"object","properties":{"anchor":{"enum":["auto","top","middle","bottom"],"type":"string","description":"`auto`: the bottom, clear of the platforms' UI."},"offset":{"type":"number","minimum":-0.5,"maximum":0.5,"description":"Shift as a share of the frame height, positive = down.","examples":[1]}},"additionalProperties":false},"shadow":{"type":"object","properties":{"blur":{"type":"number","minimum":0,"maximum":40,"examples":[1]},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"x":{"type":"number","minimum":-40,"maximum":40,"examples":[1]},"y":{"type":"number","minimum":-40,"maximum":40,"examples":[1]}},"additionalProperties":false},"stroke":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"width":{"type":"number","minimum":0,"maximum":60,"description":"A centred outline in reference units: half shows outside.","examples":[1024]}},"additionalProperties":false},"uppercase":{"type":"boolean"},"preset":{"enum":["none","bold-pop","karaoke","deep-diver","youshaei","pod-p","simple","beasty","mozi","popline","think-media","soft-landing","baby-earthquake","breathe","seamless-bounce","focus","blur-switch","grow","glitch-infinite","highlighter-box","blur-in","with-backdrop","baby-steps","neon-glow","stream-pop","stream-box","one-word"],"type":"string"}},"additionalProperties":false,"description":"Caption look: `preset` (one of the ids below) plus optional overrides, each patching one field of the preset's style:\n`font` (`family`, `weight`, `italic`, `size`, `color`, `letterSpacing`), `stroke` (`enabled`, `color`, `width`),\n`shadow` (`enabled`, `color`, `x`, `y`, `blur`), `uppercase`, `animation` (`name`, `highlightColor`, `bgColor`),\n`highlight` (`primary`, `secondary`), `background` (`enabled`, `color`, `opacity`),\n`layout` (`lines`, `maxLines`, `maxWordsPerLine`, `maxCharsPerLine`, `maxSeconds`) and `position` (`anchor`, `offset`).\nSizes are reference units (1 unit = the frame's short side / 540 px); colours are `#RRGGBB` or `#RRGGBBAA`.\n\nPresets: `none`, `bold-pop`, `karaoke`, `deep-diver`, `youshaei`, `pod-p`, `simple`, `beasty`, `mozi`, `popline`, `think-media`, `soft-landing`, `baby-earthquake`, `breathe`, `seamless-bounce`, `focus`, `blur-switch`, `grow`, `glitch-infinite`, `highlighter-box`, `blur-in`, `with-backdrop`, `baby-steps`, `neon-glow`, `stream-pop`, `stream-box`, `one-word`. `none` burns no captions.\n\nOmit it to keep the clip's own style.","examples":[{"preset":"beasty"},{"font":{"size":60},"preset":"karaoke"}]},"captions":{"type":"boolean","description":"Burn the captions. Omit it to keep what the clip did (captions on unless the job turned them off).","examples":[true]},"hook":{"type":"object","properties":{"position":{"anyOf":[{"enum":["top","center","bottom"],"type":"string","description":"A named spot; the card is placed near it, off the faces."},{"type":"object","properties":{"scale":{"type":"number","minimum":0.5,"maximum":2,"description":"Card size relative to the style's (0.5-2); default 1.","examples":[1.2]},"x":{"type":"number","minimum":0,"maximum":1,"description":"Horizontal centre of the card, as a share of the frame width (0 = left edge, 1 = right edge).","examples":[0.5]},"y":{"type":"number","minimum":0,"maximum":1,"description":"Vertical centre of the card, as a share of the frame height (0 = top, 1 = bottom).","examples":[0.12]}},"required":["x","y"],"additionalProperties":false,"description":"An exact spot: the card's centre."}],"description":"Where the card goes. Either a named spot or an exact box:\n\n- `\"top\"`, `\"center\"`, `\"bottom\"`: placed near that spot, off the faces measured on the clip and clear of the captions.\n- `{ x, y, scale? }`: the card's **centre** as shares of the frame (0-1 each, `{ \"x\": 0.5, \"y\": 0.1 }` is centred near the top), as the editor dropped it. `scale` (0.5-2, default 1) resizes the card. The card is kept wholly inside the frame.\n\nOmit it to re-place the card at the clip's own spot, around the faces (useful when only the text or style changed).","examples":["top",{"x":0.5,"y":0.12}]},"style":{"enum":["pill","classic","dark","yellow","red","outline","outline_yellow","title_card","title_card_serif","headline","bubble"],"type":"string","description":"Look of the card: `pill`, `classic`, `dark`, `yellow`, `red`, `outline`, `outline_yellow`, `title_card`, `title_card_serif`, `headline`, `bubble`. Omit it to keep the clip's.","examples":["dark"]},"text":{"type":"string","maxLength":200,"description":"The card's headline (at most 200 characters). Omit it to keep the clip's.","examples":["Nobody tells you this about pricing"]},"visible":{"type":"boolean","description":"Burn the card into the export. `false` hides it (the export's words.json still records where it would go).","examples":[true]}},"required":["visible"],"additionalProperties":false,"description":"The hook card. Omit the whole object to keep the clip's hook as it is."},"words":{"type":"array","maxItems":3000,"items":{"type":"object","properties":{"end":{"type":"number","minimum":0,"examples":[1]},"speaker":{"anyOf":[{"type":"integer","minimum":0,"examples":[1]},{"type":"null"}],"examples":[1]},"start":{"type":"number","minimum":0,"examples":[1]},"word":{"type":"string","minLength":1,"maxLength":40}},"required":["end","start","word"],"additionalProperties":false,"description":"One word, in seconds from the clip's start. `word` is 1-40 characters with no line breaks; `end` is not before `start`.","examples":[{"end":0.48,"start":0.12,"word":"Nobody"}]},"description":"The clip's words, edited: fix a transcription typo or retime a word. At most 3000 words, sorted by `start`, all ending within the clip.\nStart from `words` in the clip's `words.json` (`wordsUrl`). Omit it to keep the clip's words.","examples":[[{"end":0.48,"start":0.12,"word":"Nobody"},{"end":0.8,"start":0.5,"word":"tells"}]]}},"description":"What the export was asked to change, as sent."},"posterUrl":{"anyOf":[{"type":"string","format":"uri","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"URL of the export's poster (JPEG) once `completed`, else `null`. Same access rules as `videoUrl`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"status":{"enum":["queued","processing","completed","failed"],"type":"string","description":"Where the export is:\n\n- `queued`: accepted, waiting for a worker.\n- `processing`: a worker is burning it (seconds, not minutes).\n- `completed`: done; `videoUrl` is the new clip.\n- `failed`: gave up after retries; `error` says why.","examples":["completed"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When the export last changed.","examples":["2026-09-27T12:00:00.000Z"]},"videoKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]},{"type":"null"}],"description":"Storage key of the exported MP4 once `completed`, else `null`.","examples":["jobs/5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40/clips/0/exports/3c7b1e90-52d4-4f8a-9e61-0b2d7a4c5f18.mp4"]},"videoUrl":{"anyOf":[{"type":"string","format":"uri","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]},{"type":"null"}],"description":"URL of the exported clip (MP4) once `completed`, else `null`. Public when the deployment has a public storage domain, otherwise presigned and valid for 1 hour.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]},"wordsUrl":{"anyOf":[{"type":"string","format":"uri","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"URL of the export's own `words.json` (the words, style and hook box it was burned with) once `completed`, else `null`. An editor can continue from it.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["clipId","completedAt","createdAt","error","id","jobId","options","posterUrl","status","updatedAt","videoKey","videoUrl","wordsUrl"],"description":"One re-export of a clip."},"ClipExportOptions":{"type":"object","properties":{"captionStyle":{"type":"object","properties":{"animation":{"type":"object","properties":{"bgColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Box behind the spoken word (word-bg-highlight); null: none."},"highlightColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Text colour of the spoken word; null: the font colour."},"name":{"enum":["none","karaoke-fill-pop","pop","scale","box-highlight","word-bg-highlight","glitch-zoom","bounce","shake","blur-switch","focus","blur-in","words-pop","slide-down","hover","scale-in","breathe","glow","reveal"],"type":"string"}},"additionalProperties":false},"background":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean","description":"A box behind every line (replaces the outline and shadow)."},"opacity":{"type":"number","minimum":0,"maximum":1,"examples":[1]}},"additionalProperties":false},"font":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"family":{"enum":["Anton","Archivo","Bangers","Barlow Condensed","Bebas Neue","Courier Prime","Heebo","Kanit","Lemon","Lilita One","Montserrat","Noto Serif","Oswald","Poltawski Nowy","Poppins","Roboto","Spline Sans"],"type":"string"},"italic":{"type":"boolean"},"letterSpacing":{"type":"number","minimum":-10,"maximum":40,"description":"Extra space after every character, in reference units.","examples":[1]},"size":{"type":"number","maximum":200,"exclusiveMinimum":0,"description":"In reference units: 1 unit is the frame's short side / 540 px (a 40-unit font has an 80 px em at 1080×1920).","examples":[2457600]},"weight":{"type":"integer","minimum":100,"maximum":900,"description":"The closest bundled weight of the family is drawn.","examples":[1]}},"additionalProperties":false},"highlight":{"type":"object","properties":{"primary":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"secondary":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Colour already-spoken words keep (karaoke-fill-pop)."}},"additionalProperties":false},"layout":{"type":"object","properties":{"lines":{"enum":["single","multi"],"type":"string"},"maxCharsPerLine":{"type":"integer","minimum":4,"maximum":60,"examples":[1]},"maxLines":{"type":"integer","minimum":1,"maximum":4,"description":"Used when `lines` is `multi`.","examples":[1]},"maxSeconds":{"type":"number","minimum":0.3,"maximum":10,"description":"A page never spans more seconds of speech than this.","examples":[5]},"maxWordsPerLine":{"type":"integer","minimum":1,"maximum":12,"examples":[1]}},"additionalProperties":false},"position":{"type":"object","properties":{"anchor":{"enum":["auto","top","middle","bottom"],"type":"string","description":"`auto`: the bottom, clear of the platforms' UI."},"offset":{"type":"number","minimum":-0.5,"maximum":0.5,"description":"Shift as a share of the frame height, positive = down.","examples":[1]}},"additionalProperties":false},"shadow":{"type":"object","properties":{"blur":{"type":"number","minimum":0,"maximum":40,"examples":[1]},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"x":{"type":"number","minimum":-40,"maximum":40,"examples":[1]},"y":{"type":"number","minimum":-40,"maximum":40,"examples":[1]}},"additionalProperties":false},"stroke":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"width":{"type":"number","minimum":0,"maximum":60,"description":"A centred outline in reference units: half shows outside.","examples":[1024]}},"additionalProperties":false},"uppercase":{"type":"boolean"},"preset":{"enum":["none","bold-pop","karaoke","deep-diver","youshaei","pod-p","simple","beasty","mozi","popline","think-media","soft-landing","baby-earthquake","breathe","seamless-bounce","focus","blur-switch","grow","glitch-infinite","highlighter-box","blur-in","with-backdrop","baby-steps","neon-glow","stream-pop","stream-box","one-word"],"type":"string"}},"additionalProperties":false,"description":"Caption look: `preset` (one of the ids below) plus optional overrides, each patching one field of the preset's style:\n`font` (`family`, `weight`, `italic`, `size`, `color`, `letterSpacing`), `stroke` (`enabled`, `color`, `width`),\n`shadow` (`enabled`, `color`, `x`, `y`, `blur`), `uppercase`, `animation` (`name`, `highlightColor`, `bgColor`),\n`highlight` (`primary`, `secondary`), `background` (`enabled`, `color`, `opacity`),\n`layout` (`lines`, `maxLines`, `maxWordsPerLine`, `maxCharsPerLine`, `maxSeconds`) and `position` (`anchor`, `offset`).\nSizes are reference units (1 unit = the frame's short side / 540 px); colours are `#RRGGBB` or `#RRGGBBAA`.\n\nPresets: `none`, `bold-pop`, `karaoke`, `deep-diver`, `youshaei`, `pod-p`, `simple`, `beasty`, `mozi`, `popline`, `think-media`, `soft-landing`, `baby-earthquake`, `breathe`, `seamless-bounce`, `focus`, `blur-switch`, `grow`, `glitch-infinite`, `highlighter-box`, `blur-in`, `with-backdrop`, `baby-steps`, `neon-glow`, `stream-pop`, `stream-box`, `one-word`. `none` burns no captions.\n\nOmit it to keep the clip's own style.","examples":[{"preset":"beasty"},{"font":{"size":60},"preset":"karaoke"}]},"captions":{"type":"boolean","description":"Burn the captions. Omit it to keep what the clip did (captions on unless the job turned them off).","examples":[true]},"hook":{"type":"object","properties":{"position":{"anyOf":[{"enum":["top","center","bottom"],"type":"string","description":"A named spot; the card is placed near it, off the faces."},{"type":"object","properties":{"scale":{"type":"number","minimum":0.5,"maximum":2,"description":"Card size relative to the style's (0.5-2); default 1.","examples":[1.2]},"x":{"type":"number","minimum":0,"maximum":1,"description":"Horizontal centre of the card, as a share of the frame width (0 = left edge, 1 = right edge).","examples":[0.5]},"y":{"type":"number","minimum":0,"maximum":1,"description":"Vertical centre of the card, as a share of the frame height (0 = top, 1 = bottom).","examples":[0.12]}},"required":["x","y"],"additionalProperties":false,"description":"An exact spot: the card's centre."}],"description":"Where the card goes. Either a named spot or an exact box:\n\n- `\"top\"`, `\"center\"`, `\"bottom\"`: placed near that spot, off the faces measured on the clip and clear of the captions.\n- `{ x, y, scale? }`: the card's **centre** as shares of the frame (0-1 each, `{ \"x\": 0.5, \"y\": 0.1 }` is centred near the top), as the editor dropped it. `scale` (0.5-2, default 1) resizes the card. The card is kept wholly inside the frame.\n\nOmit it to re-place the card at the clip's own spot, around the faces (useful when only the text or style changed).","examples":["top",{"x":0.5,"y":0.12}]},"style":{"enum":["pill","classic","dark","yellow","red","outline","outline_yellow","title_card","title_card_serif","headline","bubble"],"type":"string","description":"Look of the card: `pill`, `classic`, `dark`, `yellow`, `red`, `outline`, `outline_yellow`, `title_card`, `title_card_serif`, `headline`, `bubble`. Omit it to keep the clip's.","examples":["dark"]},"text":{"type":"string","maxLength":200,"description":"The card's headline (at most 200 characters). Omit it to keep the clip's.","examples":["Nobody tells you this about pricing"]},"visible":{"type":"boolean","description":"Burn the card into the export. `false` hides it (the export's words.json still records where it would go).","examples":[true]}},"required":["visible"],"additionalProperties":false,"description":"The hook card. Omit the whole object to keep the clip's hook as it is."},"words":{"type":"array","maxItems":3000,"items":{"type":"object","properties":{"end":{"type":"number","minimum":0,"examples":[1]},"speaker":{"anyOf":[{"type":"integer","minimum":0,"examples":[1]},{"type":"null"}],"examples":[1]},"start":{"type":"number","minimum":0,"examples":[1]},"word":{"type":"string","minLength":1,"maxLength":40}},"required":["end","start","word"],"additionalProperties":false,"description":"One word, in seconds from the clip's start. `word` is 1-40 characters with no line breaks; `end` is not before `start`.","examples":[{"end":0.48,"start":0.12,"word":"Nobody"}]},"description":"The clip's words, edited: fix a transcription typo or retime a word. At most 3000 words, sorted by `start`, all ending within the clip.\nStart from `words` in the clip's `words.json` (`wordsUrl`). Omit it to keep the clip's words.","examples":[[{"end":0.48,"start":0.12,"word":"Nobody"},{"end":0.8,"start":0.5,"word":"tells"}]]}},"description":"What to change. Everything is optional; whatever is left out stays as the clip has it."},"ClipJob":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When the job completed; `null` until then (and for failed jobs).","examples":["2026-09-27T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When the job was created.","examples":["2026-09-27T12:00:00.000Z"]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the job failed. On a `completed` job with no clips it can also explain why (e.g. the video is shorter than the chosen `clipLength`); otherwise `null`.","examples":[null]},"id":{"type":"string","description":"Job id.","examples":["5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40"]},"options":{"$ref":"#/components/schemas/ClipJobOptions"},"progress":{"$ref":"#/components/schemas/ClipJobProgress"},"sourceKey":{"type":"string","description":"The upload the job cuts: `uploads/<organizationId>/<uuid>/<filename>`.","examples":["uploads/Uq4pY2m0JmHnL1mR/0b6f3c8e-6f1a-4c52-9d61-6c1f2d9f6a10/keynote.mp4"]},"status":{"enum":["queued","processing","completed","failed"],"type":"string","description":"Where the job is:\n\n- `queued`: accepted, waiting for a worker.\n- `processing`: a worker is cutting clips.\n- `completed`: done; `clips` holds the results.\n- `failed`: gave up after retries; `error` says why.","examples":["processing"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When the job last changed.","examples":["2026-09-27T12:00:00.000Z"]},"clips":{"type":"array","items":{"$ref":"#/components/schemas/Clip"},"description":"Finished clips in order; empty until the job is `completed`."},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Id of the user who started the job; `null` when it was started with an API key or that user was deleted.","examples":["Uq4pY2m0JmHnL1mR"]},"organizationId":{"type":"string","description":"Id of the workspace that owns the job (yours).","examples":["5b0c1e7a-3f7d-4d8e-9d7a-2f1c9a4e6b21"]}},"required":["completedAt","createdAt","error","id","options","progress","sourceKey","status","updatedAt","clips","createdByUserId","organizationId"],"description":"A clip job with its clips and download links."},"ClipJobOptions":{"type":"object","properties":{"aspectRatio":{"enum":["9:16","1:1","16:9","4:5"],"type":"string","default":"9:16","description":"Frame of the clips:\n\n- `9:16`: 1080x1920.\n- `1:1`: 1080x1080.\n- `16:9`: 1920x1080.\n- `4:5`: 1080x1350.\n\nSpeakers are tracked in every frame. Two people in one shot are stacked in 9:16 and side by side in 16:9; 1:1 and 4:5 keep the whole shot. A source already at the chosen shape passes through.\n\nThese are the `1080p` sizes; `resolution` picks 720p instead.","examples":["9:16"]},"captionStyle":{"type":"object","properties":{"animation":{"type":"object","properties":{"bgColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Box behind the spoken word (word-bg-highlight); null: none."},"highlightColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Text colour of the spoken word; null: the font colour."},"name":{"enum":["none","karaoke-fill-pop","pop","scale","box-highlight","word-bg-highlight","glitch-zoom","bounce","shake","blur-switch","focus","blur-in","words-pop","slide-down","hover","scale-in","breathe","glow","reveal"],"type":"string"}},"additionalProperties":false},"background":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean","description":"A box behind every line (replaces the outline and shadow)."},"opacity":{"type":"number","minimum":0,"maximum":1,"examples":[1]}},"additionalProperties":false},"font":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"family":{"enum":["Anton","Archivo","Bangers","Barlow Condensed","Bebas Neue","Courier Prime","Heebo","Kanit","Lemon","Lilita One","Montserrat","Noto Serif","Oswald","Poltawski Nowy","Poppins","Roboto","Spline Sans"],"type":"string"},"italic":{"type":"boolean"},"letterSpacing":{"type":"number","minimum":-10,"maximum":40,"description":"Extra space after every character, in reference units.","examples":[1]},"size":{"type":"number","maximum":200,"exclusiveMinimum":0,"description":"In reference units: 1 unit is the frame's short side / 540 px (a 40-unit font has an 80 px em at 1080×1920).","examples":[2457600]},"weight":{"type":"integer","minimum":100,"maximum":900,"description":"The closest bundled weight of the family is drawn.","examples":[1]}},"additionalProperties":false},"highlight":{"type":"object","properties":{"primary":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"secondary":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Colour already-spoken words keep (karaoke-fill-pop)."}},"additionalProperties":false},"layout":{"type":"object","properties":{"lines":{"enum":["single","multi"],"type":"string"},"maxCharsPerLine":{"type":"integer","minimum":4,"maximum":60,"examples":[1]},"maxLines":{"type":"integer","minimum":1,"maximum":4,"description":"Used when `lines` is `multi`.","examples":[1]},"maxSeconds":{"type":"number","minimum":0.3,"maximum":10,"description":"A page never spans more seconds of speech than this.","examples":[5]},"maxWordsPerLine":{"type":"integer","minimum":1,"maximum":12,"examples":[1]}},"additionalProperties":false},"position":{"type":"object","properties":{"anchor":{"enum":["auto","top","middle","bottom"],"type":"string","description":"`auto`: the bottom, clear of the platforms' UI."},"offset":{"type":"number","minimum":-0.5,"maximum":0.5,"description":"Shift as a share of the frame height, positive = down.","examples":[1]}},"additionalProperties":false},"shadow":{"type":"object","properties":{"blur":{"type":"number","minimum":0,"maximum":40,"examples":[1]},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"x":{"type":"number","minimum":-40,"maximum":40,"examples":[1]},"y":{"type":"number","minimum":-40,"maximum":40,"examples":[1]}},"additionalProperties":false},"stroke":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"width":{"type":"number","minimum":0,"maximum":60,"description":"A centred outline in reference units: half shows outside.","examples":[1024]}},"additionalProperties":false},"uppercase":{"type":"boolean"},"preset":{"enum":["none","bold-pop","karaoke","deep-diver","youshaei","pod-p","simple","beasty","mozi","popline","think-media","soft-landing","baby-earthquake","breathe","seamless-bounce","focus","blur-switch","grow","glitch-infinite","highlighter-box","blur-in","with-backdrop","baby-steps","neon-glow","stream-pop","stream-box","one-word"],"type":"string"}},"additionalProperties":false,"default":{"preset":"bold-pop"},"description":"Caption look: `preset` (one of the ids below) plus optional overrides, each patching one field of the preset's style:\n`font` (`family`, `weight`, `italic`, `size`, `color`, `letterSpacing`), `stroke` (`enabled`, `color`, `width`),\n`shadow` (`enabled`, `color`, `x`, `y`, `blur`), `uppercase`, `animation` (`name`, `highlightColor`, `bgColor`),\n`highlight` (`primary`, `secondary`), `background` (`enabled`, `color`, `opacity`),\n`layout` (`lines`, `maxLines`, `maxWordsPerLine`, `maxCharsPerLine`, `maxSeconds`) and `position` (`anchor`, `offset`).\nSizes are reference units (1 unit = the frame's short side / 540 px); colours are `#RRGGBB` or `#RRGGBBAA`.\n\nPresets: `none`, `bold-pop`, `karaoke`, `deep-diver`, `youshaei`, `pod-p`, `simple`, `beasty`, `mozi`, `popline`, `think-media`, `soft-landing`, `baby-earthquake`, `breathe`, `seamless-bounce`, `focus`, `blur-switch`, `grow`, `glitch-infinite`, `highlighter-box`, `blur-in`, `with-backdrop`, `baby-steps`, `neon-glow`, `stream-pop`, `stream-box`, `one-word`. `none` burns no captions.","examples":[{"font":{"size":48},"preset":"karaoke"},{"animation":{"highlightColor":"#FFD400"},"preset":"mozi"}]},"captions":{"type":"boolean","default":true,"description":"Burn word-by-word captions into every clip. `false` burns none; every clip still ships `words.json` for an editor."},"clipLength":{"enum":["auto","lt30","s30_59","s60_89","s90_3m","m3_5","m5_10","m10_15"],"type":"string","default":"auto","description":"How long each clip should be (default `auto`).\n\n- `auto` (Auto (0m-3m)): 15-180 s.\n- `lt30` (<30s): 10-30 s.\n- `s30_59` (30s~59s): 30-59 s.\n- `s60_89` (60s~89s): 60-89 s.\n- `s90_3m` (90s~3m): 90-180 s.\n- `m3_5` (3m~5m): 180-300 s.\n- `m5_10` (5m~10m): 300-600 s.\n- `m10_15` (10m~15m): 600-900 s.\n\n`auto` lets the selector pick each clip's length within its band. Longer lengths yield fewer clips. A video shorter than the chosen minimum completes with no clips and `error` explaining why.","examples":["s30_59"]},"facecam":{"enum":["top","bottom"],"type":"string","default":"top","description":"Stream videos (a webcam overlay over gameplay or a screen): where the enlarged webcam goes when the clip stacks it with the gameplay in a 9:16 frame, `top` or `bottom`. 1:1 and 4:5 clips show the webcam as an inset in its own corner instead. A webcam too small to enlarge keeps the whole stream frame. Other videos ignore it.","examples":["top"]},"fps":{"enum":[30,60],"default":30,"description":"The clips' frame rate at most, `30` (default) or `60`. A faster source is cut down to it; a slower one (24 fps film) keeps its own rate. 60 suits fast gameplay and takes about half as many bytes again.","examples":[60]},"hook":{"type":"boolean","default":true,"description":"Draw a hook card (a short headline grounded in the clip) over its first seconds."},"hookStyle":{"enum":["pill","classic","dark","yellow","red","outline","outline_yellow","title_card","title_card_serif","headline","bubble"],"type":"string","default":"pill","description":"Look of the hook card: `pill` (rounded label), `classic`, `dark`, `yellow`, `red`, `outline`, `outline_yellow`, `title_card` (a white box hugging each line, black bold sans), `title_card_serif` (the same in a heavy serif), `headline` (outlined white text, words marked `*like this*` in yellow) or `bubble` (a white speech bubble with a tail toward the face). The last four sit just above the seam of a facecam-over-gameplay clip.","examples":["pill"]},"maxMinutes":{"type":"number","exclusiveMinimum":0,"description":"Only process the first N minutes of the source. Omit it to process the whole video.","examples":[10]},"resolution":{"enum":["1080p","720p"],"type":"string","default":"1080p","description":"Size of the clips: the frame's short side, keeping `aspectRatio`'s shape (default `1080p`).\n\n- `1080p`: 1080x1920 (9:16), 1080x1080 (1:1), 1920x1080 (16:9), 1080x1350 (4:5).\n- `720p`: 720x1280 (9:16), 720x720 (1:1), 1280x720 (16:9), 720x900 (4:5).\n\n720p files are about 40% smaller and render faster. Captions, the hook card and the watermark scale with the frame.","examples":["720p"]}},"description":"Render options. Each is optional and has a sensible default."},"ClipJobProgress":{"type":"object","properties":{"clipsDone":{"anyOf":[{"type":"integer","minimum":0,"examples":[1]},{"type":"null"}],"description":"Clips rendered so far; `null` until the moments are selected.","examples":[2]},"clipsTotal":{"anyOf":[{"type":"integer","minimum":0,"examples":[1]},{"type":"null"}],"description":"Clips the job will render; `null` until the moments are selected.","examples":[6]},"etaSeconds":{"anyOf":[{"type":"integer","minimum":0,"examples":[5]},{"type":"null"}],"description":"Rough seconds until the job completes, extrapolated from the time spent so far. Only set while rendering, once the first clip is done (before that the estimate would be a guess); `null` otherwise.","examples":[95]},"message":{"type":"string","description":"What is happening, in a short line for people.","examples":["Rendering clip 3 of 6"]},"percent":{"type":"number","minimum":0,"maximum":100,"description":"Overall progress, 0-100. Each stage counts as much as it typically takes (rendering about 65%, split evenly over the clips; transcription about 27%), so it moves roughly evenly with time. Never goes down; 100 once completed.","examples":[55.7]},"stage":{"enum":["queued","preparing","transcribing","selecting","rendering","finalizing","completed","failed"],"type":"string","description":"What the job is doing now:\n\n- `queued`: waiting for a worker.\n- `preparing`: fetching the video, trimming it to `maxMinutes` when the job sets it, extracting the audio.\n- `transcribing`: transcribing the speech; the layout of the shot is analyzed at the same time.\n- `selecting`: picking the strongest moments.\n- `rendering`: cutting, reframing and captioning clip `clipsDone + 1` of `clipsTotal`.\n- `finalizing`: saving the results.\n- `completed` / `failed`: final, as `status`.","examples":["rendering"]},"stageStartedAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When the current stage began.","examples":["2026-09-27T12:00:52.000Z"]},"startedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When a worker started the job; `null` while `queued` (and for jobs that failed before a worker picked them up).","examples":["2026-09-27T12:00:04.000Z"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When the progress last changed.","examples":["2026-09-27T12:01:40.000Z"]}},"required":["clipsDone","clipsTotal","etaSeconds","message","percent","stage","stageStartedAt","startedAt","updatedAt"],"description":"Live progress of the job. Poll `GET /clip-jobs/{jobId}` every 5 seconds or so, or stream `GET /clip-jobs/{jobId}/events`."},"ClipJobSummary":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When the job completed; `null` until then (and for failed jobs).","examples":["2026-09-27T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When the job was created.","examples":["2026-09-27T12:00:00.000Z"]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the job failed. On a `completed` job with no clips it can also explain why (e.g. the video is shorter than the chosen `clipLength`); otherwise `null`.","examples":[null]},"id":{"type":"string","description":"Job id.","examples":["5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40"]},"options":{"$ref":"#/components/schemas/ClipJobOptions"},"progress":{"$ref":"#/components/schemas/ClipJobProgress"},"sourceKey":{"type":"string","description":"The upload the job cuts: `uploads/<organizationId>/<uuid>/<filename>`.","examples":["uploads/Uq4pY2m0JmHnL1mR/0b6f3c8e-6f1a-4c52-9d61-6c1f2d9f6a10/keynote.mp4"]},"status":{"enum":["queued","processing","completed","failed"],"type":"string","description":"Where the job is:\n\n- `queued`: accepted, waiting for a worker.\n- `processing`: a worker is cutting clips.\n- `completed`: done; `clips` holds the results.\n- `failed`: gave up after retries; `error` says why.","examples":["processing"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When the job last changed.","examples":["2026-09-27T12:00:00.000Z"]},"clipCount":{"type":"integer","minimum":0,"description":"How many clips the job produced so far.","examples":[6]}},"required":["completedAt","createdAt","error","id","options","progress","sourceKey","status","updatedAt","clipCount"],"description":"A clip job in a list, without its clips."},"ClipJobUpdate":{"type":"object","properties":{"clipCount":{"type":"integer","minimum":0,"description":"Clips saved so far. Each one is saved as soon as it renders, so this grows while the job runs; fetch the job when it changes to show the new clips.","examples":[2]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"As `error` on the job.","examples":[null]},"id":{"type":"string","description":"Job id.","examples":["5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40"]},"progress":{"$ref":"#/components/schemas/ClipJobProgress"},"status":{"enum":["queued","processing","completed","failed"],"type":"string","description":"As `status` on the job.","examples":["processing"]}},"required":["clipCount","error","id","progress","status"],"description":"The job's status, progress and saved clip count, sent when any of them changes. Fetch the job for its clips when `clipCount` grows, and once more when `status` is `completed`."},"CreateClipExportRequest":{"type":"object","properties":{"captionStyle":{"type":"object","properties":{"animation":{"type":"object","properties":{"bgColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Box behind the spoken word (word-bg-highlight); null: none."},"highlightColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Text colour of the spoken word; null: the font colour."},"name":{"enum":["none","karaoke-fill-pop","pop","scale","box-highlight","word-bg-highlight","glitch-zoom","bounce","shake","blur-switch","focus","blur-in","words-pop","slide-down","hover","scale-in","breathe","glow","reveal"],"type":"string"}},"additionalProperties":false},"background":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean","description":"A box behind every line (replaces the outline and shadow)."},"opacity":{"type":"number","minimum":0,"maximum":1,"examples":[1]}},"additionalProperties":false},"font":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"family":{"enum":["Anton","Archivo","Bangers","Barlow Condensed","Bebas Neue","Courier Prime","Heebo","Kanit","Lemon","Lilita One","Montserrat","Noto Serif","Oswald","Poltawski Nowy","Poppins","Roboto","Spline Sans"],"type":"string"},"italic":{"type":"boolean"},"letterSpacing":{"type":"number","minimum":-10,"maximum":40,"description":"Extra space after every character, in reference units.","examples":[1]},"size":{"type":"number","maximum":200,"exclusiveMinimum":0,"description":"In reference units: 1 unit is the frame's short side / 540 px (a 40-unit font has an 80 px em at 1080×1920).","examples":[2457600]},"weight":{"type":"integer","minimum":100,"maximum":900,"description":"The closest bundled weight of the family is drawn.","examples":[1]}},"additionalProperties":false},"highlight":{"type":"object","properties":{"primary":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"secondary":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Colour already-spoken words keep (karaoke-fill-pop)."}},"additionalProperties":false},"layout":{"type":"object","properties":{"lines":{"enum":["single","multi"],"type":"string"},"maxCharsPerLine":{"type":"integer","minimum":4,"maximum":60,"examples":[1]},"maxLines":{"type":"integer","minimum":1,"maximum":4,"description":"Used when `lines` is `multi`.","examples":[1]},"maxSeconds":{"type":"number","minimum":0.3,"maximum":10,"description":"A page never spans more seconds of speech than this.","examples":[5]},"maxWordsPerLine":{"type":"integer","minimum":1,"maximum":12,"examples":[1]}},"additionalProperties":false},"position":{"type":"object","properties":{"anchor":{"enum":["auto","top","middle","bottom"],"type":"string","description":"`auto`: the bottom, clear of the platforms' UI."},"offset":{"type":"number","minimum":-0.5,"maximum":0.5,"description":"Shift as a share of the frame height, positive = down.","examples":[1]}},"additionalProperties":false},"shadow":{"type":"object","properties":{"blur":{"type":"number","minimum":0,"maximum":40,"examples":[1]},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"x":{"type":"number","minimum":-40,"maximum":40,"examples":[1]},"y":{"type":"number","minimum":-40,"maximum":40,"examples":[1]}},"additionalProperties":false},"stroke":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"width":{"type":"number","minimum":0,"maximum":60,"description":"A centred outline in reference units: half shows outside.","examples":[1024]}},"additionalProperties":false},"uppercase":{"type":"boolean"},"preset":{"enum":["none","bold-pop","karaoke","deep-diver","youshaei","pod-p","simple","beasty","mozi","popline","think-media","soft-landing","baby-earthquake","breathe","seamless-bounce","focus","blur-switch","grow","glitch-infinite","highlighter-box","blur-in","with-backdrop","baby-steps","neon-glow","stream-pop","stream-box","one-word"],"type":"string"}},"additionalProperties":false,"description":"Caption look: `preset` (one of the ids below) plus optional overrides, each patching one field of the preset's style:\n`font` (`family`, `weight`, `italic`, `size`, `color`, `letterSpacing`), `stroke` (`enabled`, `color`, `width`),\n`shadow` (`enabled`, `color`, `x`, `y`, `blur`), `uppercase`, `animation` (`name`, `highlightColor`, `bgColor`),\n`highlight` (`primary`, `secondary`), `background` (`enabled`, `color`, `opacity`),\n`layout` (`lines`, `maxLines`, `maxWordsPerLine`, `maxCharsPerLine`, `maxSeconds`) and `position` (`anchor`, `offset`).\nSizes are reference units (1 unit = the frame's short side / 540 px); colours are `#RRGGBB` or `#RRGGBBAA`.\n\nPresets: `none`, `bold-pop`, `karaoke`, `deep-diver`, `youshaei`, `pod-p`, `simple`, `beasty`, `mozi`, `popline`, `think-media`, `soft-landing`, `baby-earthquake`, `breathe`, `seamless-bounce`, `focus`, `blur-switch`, `grow`, `glitch-infinite`, `highlighter-box`, `blur-in`, `with-backdrop`, `baby-steps`, `neon-glow`, `stream-pop`, `stream-box`, `one-word`. `none` burns no captions.\n\nOmit it to keep the clip's own style.","examples":[{"preset":"beasty"},{"font":{"size":60},"preset":"karaoke"}]},"captions":{"type":"boolean","description":"Burn the captions. Omit it to keep what the clip did (captions on unless the job turned them off).","examples":[true]},"hook":{"type":"object","properties":{"position":{"anyOf":[{"enum":["top","center","bottom"],"type":"string","description":"A named spot; the card is placed near it, off the faces."},{"type":"object","properties":{"scale":{"type":"number","minimum":0.5,"maximum":2,"description":"Card size relative to the style's (0.5-2); default 1.","examples":[1.2]},"x":{"type":"number","minimum":0,"maximum":1,"description":"Horizontal centre of the card, as a share of the frame width (0 = left edge, 1 = right edge).","examples":[0.5]},"y":{"type":"number","minimum":0,"maximum":1,"description":"Vertical centre of the card, as a share of the frame height (0 = top, 1 = bottom).","examples":[0.12]}},"required":["x","y"],"additionalProperties":false,"description":"An exact spot: the card's centre."}],"description":"Where the card goes. Either a named spot or an exact box:\n\n- `\"top\"`, `\"center\"`, `\"bottom\"`: placed near that spot, off the faces measured on the clip and clear of the captions.\n- `{ x, y, scale? }`: the card's **centre** as shares of the frame (0-1 each, `{ \"x\": 0.5, \"y\": 0.1 }` is centred near the top), as the editor dropped it. `scale` (0.5-2, default 1) resizes the card. The card is kept wholly inside the frame.\n\nOmit it to re-place the card at the clip's own spot, around the faces (useful when only the text or style changed).","examples":["top",{"x":0.5,"y":0.12}]},"style":{"enum":["pill","classic","dark","yellow","red","outline","outline_yellow","title_card","title_card_serif","headline","bubble"],"type":"string","description":"Look of the card: `pill`, `classic`, `dark`, `yellow`, `red`, `outline`, `outline_yellow`, `title_card`, `title_card_serif`, `headline`, `bubble`. Omit it to keep the clip's.","examples":["dark"]},"text":{"type":"string","maxLength":200,"description":"The card's headline (at most 200 characters). Omit it to keep the clip's.","examples":["Nobody tells you this about pricing"]},"visible":{"type":"boolean","description":"Burn the card into the export. `false` hides it (the export's words.json still records where it would go).","examples":[true]}},"required":["visible"],"additionalProperties":false,"description":"The hook card. Omit the whole object to keep the clip's hook as it is."},"words":{"type":"array","maxItems":3000,"items":{"type":"object","properties":{"end":{"type":"number","minimum":0,"examples":[1]},"speaker":{"anyOf":[{"type":"integer","minimum":0,"examples":[1]},{"type":"null"}],"examples":[1]},"start":{"type":"number","minimum":0,"examples":[1]},"word":{"type":"string","minLength":1,"maxLength":40}},"required":["end","start","word"],"additionalProperties":false,"description":"One word, in seconds from the clip's start. `word` is 1-40 characters with no line breaks; `end` is not before `start`.","examples":[{"end":0.48,"start":0.12,"word":"Nobody"}]},"description":"The clip's words, edited: fix a transcription typo or retime a word. At most 3000 words, sorted by `start`, all ending within the clip.\nStart from `words` in the clip's `words.json` (`wordsUrl`). Omit it to keep the clip's words.","examples":[[{"end":0.48,"start":0.12,"word":"Nobody"},{"end":0.8,"start":0.5,"word":"tells"}]]},"clipId":{"type":"string","minLength":1,"maxLength":128,"description":"Id of one of your clips (`clips[].id` from `GET /clip-jobs/{jobId}`).","examples":["9d2e7a61-3b0f-4c1e-b5a8-7f4d2c6e1a93"]}},"required":["clipId"],"description":"The clip to re-export (path) and what to change (body). An empty body re-renders the clip as it is."},"CreateClipJobRequest":{"type":"object","properties":{"aspectRatio":{"enum":["9:16","1:1","16:9","4:5"],"type":"string","default":"9:16","description":"Frame of the clips:\n\n- `9:16`: 1080x1920.\n- `1:1`: 1080x1080.\n- `16:9`: 1920x1080.\n- `4:5`: 1080x1350.\n\nSpeakers are tracked in every frame. Two people in one shot are stacked in 9:16 and side by side in 16:9; 1:1 and 4:5 keep the whole shot. A source already at the chosen shape passes through.\n\nThese are the `1080p` sizes; `resolution` picks 720p instead.","examples":["9:16"]},"captionStyle":{"type":"object","properties":{"animation":{"type":"object","properties":{"bgColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Box behind the spoken word (word-bg-highlight); null: none."},"highlightColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Text colour of the spoken word; null: the font colour."},"name":{"enum":["none","karaoke-fill-pop","pop","scale","box-highlight","word-bg-highlight","glitch-zoom","bounce","shake","blur-switch","focus","blur-in","words-pop","slide-down","hover","scale-in","breathe","glow","reveal"],"type":"string"}},"additionalProperties":false},"background":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean","description":"A box behind every line (replaces the outline and shadow)."},"opacity":{"type":"number","minimum":0,"maximum":1,"examples":[1]}},"additionalProperties":false},"font":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"family":{"enum":["Anton","Archivo","Bangers","Barlow Condensed","Bebas Neue","Courier Prime","Heebo","Kanit","Lemon","Lilita One","Montserrat","Noto Serif","Oswald","Poltawski Nowy","Poppins","Roboto","Spline Sans"],"type":"string"},"italic":{"type":"boolean"},"letterSpacing":{"type":"number","minimum":-10,"maximum":40,"description":"Extra space after every character, in reference units.","examples":[1]},"size":{"type":"number","maximum":200,"exclusiveMinimum":0,"description":"In reference units: 1 unit is the frame's short side / 540 px (a 40-unit font has an 80 px em at 1080×1920).","examples":[2457600]},"weight":{"type":"integer","minimum":100,"maximum":900,"description":"The closest bundled weight of the family is drawn.","examples":[1]}},"additionalProperties":false},"highlight":{"type":"object","properties":{"primary":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"secondary":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Colour already-spoken words keep (karaoke-fill-pop)."}},"additionalProperties":false},"layout":{"type":"object","properties":{"lines":{"enum":["single","multi"],"type":"string"},"maxCharsPerLine":{"type":"integer","minimum":4,"maximum":60,"examples":[1]},"maxLines":{"type":"integer","minimum":1,"maximum":4,"description":"Used when `lines` is `multi`.","examples":[1]},"maxSeconds":{"type":"number","minimum":0.3,"maximum":10,"description":"A page never spans more seconds of speech than this.","examples":[5]},"maxWordsPerLine":{"type":"integer","minimum":1,"maximum":12,"examples":[1]}},"additionalProperties":false},"position":{"type":"object","properties":{"anchor":{"enum":["auto","top","middle","bottom"],"type":"string","description":"`auto`: the bottom, clear of the platforms' UI."},"offset":{"type":"number","minimum":-0.5,"maximum":0.5,"description":"Shift as a share of the frame height, positive = down.","examples":[1]}},"additionalProperties":false},"shadow":{"type":"object","properties":{"blur":{"type":"number","minimum":0,"maximum":40,"examples":[1]},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"x":{"type":"number","minimum":-40,"maximum":40,"examples":[1]},"y":{"type":"number","minimum":-40,"maximum":40,"examples":[1]}},"additionalProperties":false},"stroke":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"width":{"type":"number","minimum":0,"maximum":60,"description":"A centred outline in reference units: half shows outside.","examples":[1024]}},"additionalProperties":false},"uppercase":{"type":"boolean"},"preset":{"enum":["none","bold-pop","karaoke","deep-diver","youshaei","pod-p","simple","beasty","mozi","popline","think-media","soft-landing","baby-earthquake","breathe","seamless-bounce","focus","blur-switch","grow","glitch-infinite","highlighter-box","blur-in","with-backdrop","baby-steps","neon-glow","stream-pop","stream-box","one-word"],"type":"string"}},"additionalProperties":false,"default":{"preset":"bold-pop"},"description":"Caption look: `preset` (one of the ids below) plus optional overrides, each patching one field of the preset's style:\n`font` (`family`, `weight`, `italic`, `size`, `color`, `letterSpacing`), `stroke` (`enabled`, `color`, `width`),\n`shadow` (`enabled`, `color`, `x`, `y`, `blur`), `uppercase`, `animation` (`name`, `highlightColor`, `bgColor`),\n`highlight` (`primary`, `secondary`), `background` (`enabled`, `color`, `opacity`),\n`layout` (`lines`, `maxLines`, `maxWordsPerLine`, `maxCharsPerLine`, `maxSeconds`) and `position` (`anchor`, `offset`).\nSizes are reference units (1 unit = the frame's short side / 540 px); colours are `#RRGGBB` or `#RRGGBBAA`.\n\nPresets: `none`, `bold-pop`, `karaoke`, `deep-diver`, `youshaei`, `pod-p`, `simple`, `beasty`, `mozi`, `popline`, `think-media`, `soft-landing`, `baby-earthquake`, `breathe`, `seamless-bounce`, `focus`, `blur-switch`, `grow`, `glitch-infinite`, `highlighter-box`, `blur-in`, `with-backdrop`, `baby-steps`, `neon-glow`, `stream-pop`, `stream-box`, `one-word`. `none` burns no captions.","examples":[{"font":{"size":48},"preset":"karaoke"},{"animation":{"highlightColor":"#FFD400"},"preset":"mozi"}]},"captions":{"type":"boolean","default":true,"description":"Burn word-by-word captions into every clip. `false` burns none; every clip still ships `words.json` for an editor."},"clipLength":{"enum":["auto","lt30","s30_59","s60_89","s90_3m","m3_5","m5_10","m10_15"],"type":"string","default":"auto","description":"How long each clip should be (default `auto`).\n\n- `auto` (Auto (0m-3m)): 15-180 s.\n- `lt30` (<30s): 10-30 s.\n- `s30_59` (30s~59s): 30-59 s.\n- `s60_89` (60s~89s): 60-89 s.\n- `s90_3m` (90s~3m): 90-180 s.\n- `m3_5` (3m~5m): 180-300 s.\n- `m5_10` (5m~10m): 300-600 s.\n- `m10_15` (10m~15m): 600-900 s.\n\n`auto` lets the selector pick each clip's length within its band. Longer lengths yield fewer clips. A video shorter than the chosen minimum completes with no clips and `error` explaining why.","examples":["s30_59"]},"facecam":{"enum":["top","bottom"],"type":"string","default":"top","description":"Stream videos (a webcam overlay over gameplay or a screen): where the enlarged webcam goes when the clip stacks it with the gameplay in a 9:16 frame, `top` or `bottom`. 1:1 and 4:5 clips show the webcam as an inset in its own corner instead. A webcam too small to enlarge keeps the whole stream frame. Other videos ignore it.","examples":["top"]},"fps":{"enum":[30,60],"default":30,"description":"The clips' frame rate at most, `30` (default) or `60`. A faster source is cut down to it; a slower one (24 fps film) keeps its own rate. 60 suits fast gameplay and takes about half as many bytes again.","examples":[60]},"hook":{"type":"boolean","default":true,"description":"Draw a hook card (a short headline grounded in the clip) over its first seconds."},"hookStyle":{"enum":["pill","classic","dark","yellow","red","outline","outline_yellow","title_card","title_card_serif","headline","bubble"],"type":"string","default":"pill","description":"Look of the hook card: `pill` (rounded label), `classic`, `dark`, `yellow`, `red`, `outline`, `outline_yellow`, `title_card` (a white box hugging each line, black bold sans), `title_card_serif` (the same in a heavy serif), `headline` (outlined white text, words marked `*like this*` in yellow) or `bubble` (a white speech bubble with a tail toward the face). The last four sit just above the seam of a facecam-over-gameplay clip.","examples":["pill"]},"maxMinutes":{"type":"number","exclusiveMinimum":0,"description":"Only process the first N minutes of the source. Omit it to process the whole video.","examples":[10]},"resolution":{"enum":["1080p","720p"],"type":"string","default":"1080p","description":"Size of the clips: the frame's short side, keeping `aspectRatio`'s shape (default `1080p`).\n\n- `1080p`: 1080x1920 (9:16), 1080x1080 (1:1), 1920x1080 (16:9), 1080x1350 (4:5).\n- `720p`: 720x1280 (9:16), 720x720 (1:1), 1280x720 (16:9), 720x900 (4:5).\n\n720p files are about 40% smaller and render faster. Captions, the hook card and the watermark scale with the frame.","examples":["720p"]},"sourceKey":{"type":"string","minLength":1,"maxLength":1024,"description":"The `key` returned by `POST /uploads`, after the PUT finished. It must be one of your own uploads.","examples":["uploads/Uq4pY2m0JmHnL1mR/0b6f3c8e-6f1a-4c52-9d61-6c1f2d9f6a10/keynote.mp4"]},"sourceSeconds":{"type":"number","maximum":36000,"exclusiveMinimum":0,"description":"Ignored, and kept so older clients still validate: the job is held and charged for the length measured from the upload itself (cut to `maxMinutes`), never for what a caller says.","examples":[1068]}},"required":["sourceKey"],"description":"The upload to clip and how to render it. Only `sourceKey` is required."},"CreateUploadRequest":{"type":"object","properties":{"contentType":{"type":"string","pattern":"^((video|audio|image)\\/[\\w.+-]+|application\\/pdf|application\\/vnd\\.openxmlformats-officedocument\\.wordprocessingml\\.document)$","description":"MIME type of the file: any `video/*`, `audio/*` or `image/*` type, or a PDF or Word (.docx) brand file for `POST /brand-kits/from-file`. The upload PUT must send exactly this `Content-Type`.","examples":["video/mp4"]},"filename":{"type":"string","minLength":1,"maxLength":255,"description":"Original file name. It is sanitised and becomes the last segment of the storage key.","examples":["keynote.mp4"]},"size":{"type":"integer","maximum":5363466240,"exclusiveMinimum":0,"description":"File size in bytes. At most 5363466240 (5 GiB minus 5 MiB, the single-request upload limit).","examples":[734003200]}},"required":["contentType","filename","size"],"description":"The file you are about to upload."},"UploadTicket":{"type":"object","properties":{"expiresAt":{"type":"string","format":"date-time","description":"When `uploadUrl` stops working (15 minutes after issue).","examples":["2026-09-27T12:15:00.000Z"]},"headers":{"type":"object","properties":{"Content-Type":{"type":"string","description":"The `contentType` you sent; it's part of the signature.","examples":["video/mp4"]}},"required":["Content-Type"],"description":"Send exactly these headers with the PUT."},"key":{"type":"string","description":"Storage key of the upload: `uploads/<organizationId>/<uuid>/<filename>`. Pass it as `sourceKey` to `POST /clip-jobs` once the PUT has finished.","examples":["uploads/Uq4pY2m0JmHnL1mR/0b6f3c8e-6f1a-4c52-9d61-6c1f2d9f6a10/keynote.mp4"]},"method":{"const":"PUT","description":"HTTP method for the upload."},"uploadUrl":{"type":"string","format":"uri","description":"Presigned object-storage URL. PUT the raw file bytes here; they go straight to storage, not through this API.","examples":["https://storage.example.com/remagica/uploads/…/keynote.mp4?X-Amz-Signature=…"]}},"required":["expiresAt","headers","key","method","uploadUrl"],"description":"Where and how to upload the file."},"ValidationErrorData":{"type":"object","properties":{"issues":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","description":"What is wrong with the value.","examples":["Too small: expected number to be >0"]},"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number","examples":[1]}]},"description":"Where the invalid value is in the input.","examples":[["size"]]}},"required":["message"],"additionalProperties":{},"description":"One failed validation check."},"description":"Every check the input failed, in input order."}},"required":["issues"]}}},"info":{"description":"Remagica turns long videos into short vertical clips. It finds the strongest moments, reframes them to 9:16, and adds karaoke captions and a hook card. This API covers the whole flow: upload a video, start a clip job, and fetch the finished clips.\n\n## Authentication\n\nEvery request carries an **API key** in the `x-api-key` header:\n\n1. In the Remagica app's **Settings**, under **API keys**, create a key.\n2. Pick its scopes: start from a preset (API is the recommended one) or tick them one by one. A key can do only what its scopes allow.\n3. Copy the key (it starts with `rmg_` and is shown once) and send it with every request:\n\n```sh\ncurl https://api.remagica.com/api/v1/models -H \"x-api-key: rmg_…\"\n```\n\nA key belongs to one **workspace** and acts for it, not for a person: what it makes is the workspace's, it spends the workspace's credits, and it keeps working when the person who created it leaves. So nothing it makes is personal; projects and Library items it creates are the team's.\n\nA request without a valid key gets `401 UNAUTHORIZED`. One whose key lacks the scope an operation needs gets `403 FORBIDDEN`, naming the scope (`This key needs workflows:run.`). Each operation lists its scope as `x-required-scope`.\n\n## Scopes\n\n| Resource | Scopes |\n| --- | --- |\n| Apps | `apps:publish`: Publish apps for the workspace or the community.<br>`apps:read`: List and read apps and their runs.<br>`apps:run`: Run apps.<br>`apps:write`: Create, edit, remix and delete apps. |\n| Brand | `brand:delete`: Delete brand kits and moodboards.<br>`brand:read`: List and read brand kits and moodboards.<br>`brand:write`: Create and edit brand kits and moodboards. |\n| Clips | `clips:read`: List and read clip jobs, their clips and exports.<br>`clips:submit`: Start clip jobs and re-export clips. |\n| Generations | `generations:cancel`: Stop generations in progress.<br>`generations:read`: List and read generations and characters.<br>`generations:submit`: Generate images, videos, audio and characters. |\n| Library | `library:delete`: Trash, restore and permanently delete Library items.<br>`library:read`: List and read Library items, folders and labels.<br>`library:share`: Read and change files' share links.<br>`library:write`: Add, edit, move and label Library items and folders. |\n| Models | `models:list`: List models, their capabilities, node types and prices. |\n| Projects | `projects:delete`: Delete project folders.<br>`projects:read`: List projects and their folders.<br>`projects:share`: Share projects by link and copy shared ones.<br>`projects:write`: Create, rename, duplicate and move projects and folders. |\n| References | `references:delete`: Delete references.<br>`references:read`: List references, their previews and bookmarks, and the thumbnail reference library.<br>`references:write`: Add references and bookmark them. |\n| Sprites | `sprites:read`: List and read Sprite Studio games, characters, Sprite DNA, outfits, actions, takes, master candidates, presets, drift reports and exports, estimate runs and follow the live feed.<br>`sprites:write`: Create and edit Sprite Studio games, characters, outfits, actions and presets, draw masters, views and takes (spending credits), approve takes, edit, redraw, add and remove frames, pin storyboard sketches, fix drift and export. |\n| Templates | `templates:delete`: Delete templates.<br>`templates:read`: List and read templates and presets.<br>`templates:use`: Start projects from templates and keep presets' examples.<br>`templates:write`: Save projects as templates. |\n| Uploads | `uploads:write`: Upload files, import them from links and sign their URLs. |\n| Usage | `usage:read`: Read the credit balance, history and usage. |\n| Webhooks | `webhooks:read`: List webhook endpoints and their deliveries.<br>`webhooks:write`: Add, change and test webhook endpoints. |\n| Workflows | `workflows:cancel`: Stop workflow runs and results.<br>`workflows:delete`: Delete workflows, revisions and results.<br>`workflows:read`: Read workflows, revisions, runs and their files.<br>`workflows:run`: Run workflows.<br>`workflows:write`: Create and edit workflows and their revisions. |\n\n## Downloads\n\nGenerations, Library items and clips come with signed download URLs. A workflow's files also download as zips, streamed, with `workflows:read`:\n\n- `GET /api/v1/workflows/{workflowId}/groups/{groupId}/download`: every file of a group.\n- `GET /api/v1/workflows/{workflowId}/nodes/{nodeId}/download`: every result one node has made.\n\n## Upload, then clip, then poll\n\n1. **`POST /uploads`** with the file's name, MIME type and size. The response has a presigned `uploadUrl` and a storage `key`.\n2. **`PUT` the raw file bytes to `uploadUrl`**, sending exactly the returned `headers`. The bytes go straight to object storage, not through this API. The URL expires after 15 minutes.\n3. **`POST /clip-jobs`** with `sourceKey` set to that `key`. The job is queued and you get `202 Accepted` with its `jobId`.\n4. **Poll `GET /clip-jobs/{jobId}`** every 5 seconds or so until `status` is `completed` (`clips` lists each clip with `videoUrl` and `posterUrl`) or `failed` (`error` says why). A job takes minutes, depending on the video's length. Meanwhile `progress` says which stage it is in (`preparing`, `transcribing`, `selecting`, `rendering` clip N of M, `finalizing`), with an overall `percent` and a short `message`. To be told instead of asking, stream **`GET /clip-jobs/{jobId}/events`** (server-sent events), which sends each change and ends when the job does.\n5. **Optionally re-export a clip** with `POST /clips/{clipId}/exports`: another caption style, a changed or moved hook, or corrected words. It takes seconds; poll `GET /clips/{clipId}/exports/{exportId}` for the new `videoUrl`.\n\n## Generate images, video and audio\n\n1. **`GET /models`** lists the models, what each accepts (`capabilities`) and what it costs (`pricing`, in credits).\n2. **`POST /generations/images`** (or `/videos`, `/speech`, `/sound-effects`, `/music`) with a `model` and its input. Reference files by storage `key`: an upload's, or an output of an earlier generation (a video's `last_frame` output makes a good first frame for the next shot). You get `202 Accepted` with the generation.\n3. **Poll `GET /generations/{generationId}`** until `status` is `completed` (`outputs` lists the files with download URLs) or `failed` (`error` says why). Images and audio take seconds; video takes minutes.\n\nTo know the price first, send the same body to **`POST /generations/estimate`** with a `kind` (`image`, `video`, ...): it answers the credits that request would be charged, and starts nothing.\n\n## Retries and idempotency\n\nEvery `POST` that spends credits or starts work (generations, characters, clip jobs and exports, workflow and app runs, uploads, brand kits from a website or file) takes an optional `Idempotency-Key` header: a unique value of 1 to 255 printable characters, such as a UUID. Send the same request again with the same key within 24 hours, after a timeout say, and you get the first response back: nothing runs or is charged twice. The same key with a different body or endpoint is `409 CONFLICT` (`This Idempotency-Key was already used with a different request`), and so is a retry while the first request is still being answered (`A request with this Idempotency-Key is still in progress`). A request that fails frees its key, so a retry runs afresh. Keys belong to the workspace, whichever key or person sends them.\n\n## Build and run a workflow\n\n1. **`POST /workflows`** creates one (a document of pages of nodes and edges; `GET /node-types` lists the node types, their settings and handles). Save edits with **`PUT /workflows/{workflowId}`**, sending the `version` you read.\n2. **`POST /workflows/{workflowId}/runs`** with `nodeIds` and a `count` (1–20) runs those nodes: each adds `count` results (per item, when an iterator or a splitter feeds it). Nodes upstream are read as the result they show, never run again. A run that can't start is refused with `409 RUN_REFUSED` and a `code`.\n3. **Follow it** with **`GET /workflows/{workflowId}/events`** (server-sent events: each result as it changes), or read **`GET /workflows/{workflowId}`** again: every node carries its `results`, with download URLs.\n\n## Captions in a workflow\n\nA Captions node (see `GET /node-types`) burns word-timed captions into its video by default, so its `video` output is a finished video. Its params: `style` (a caption preset), `overrides` (any field of that preset's style, section by section: `font`, `stroke`, `shadow`, `uppercase`, `animation`, `highlight`, `background`, `layout`, `position`; sizes in reference units, 1 unit = the frame's short side / 540 px) and `burn`. With `burn: false` the `video` output is the input video, untouched, and you draw the captions yourself from the `track` output: a JSON caption track (`application/vnd.remagica.captions+json`) with the words and their times, the resolved style and the exact layout (pages, lines, scale and position in frame pixels) the worker would burn. `subtitles` has SRT and WebVTT either way.\n\n## Limits\n\n- One upload is at most **5 GiB minus 5 MiB** (5,363,466,240 bytes), the single-request upload limit of the storage. Only `video/*`, `audio/*` and `image/*` files are accepted.\n- Presigned download links for clips expire after 1 hour; fetch the job again for fresh ones.\n- `GET /clip-jobs` returns your 100 most recent jobs, `GET /clips/{clipId}/exports` a clip's 100 most recent exports.\n- An export's edited `words` hold at most 3000 words of up to 40 characters each.\n\n## Errors\n\nErrors are JSON with a stable, machine-readable `code` and a human-readable `message`:\n\n```json\n{ \"defined\": true, \"code\": \"NOT_FOUND\", \"status\": 404, \"message\": \"No such job.\" }\n```\n\n`400 BAD_REQUEST` adds `data.issues`, one entry per failed check with its `path` and `message`. Each operation lists the errors it can return.\n\n## Webhooks\n\nInstead of polling, add a **webhook endpoint** (`POST /webhook-endpoints`, or **Settings → Webhooks** in the app) and pick its events. When one happens, Remagica POSTs JSON to your URL:\n\n```json\n{ \"id\": \"evt_…\", \"type\": \"generation.succeeded\", \"createdAt\": \"2026-10-21T12:00:00.000Z\", \"organizationId\": \"…\", \"data\": { \"id\": \"…\", \"status\": \"completed\", \"outputs\": [] } }\n```\n\n`data` is the resource as its `GET` returns it (`GET /generations/{generationId}`, `GET /workflow-runs/{runId}`, ...). Each request carries `Remagica-Event-Id` (the same in every retry and redelivery, to drop repeats), `Remagica-Event-Type` and `Remagica-Signature: t=<unix seconds>,v1=<signature>`.\n\n- Answer any **2xx** within 10 seconds. Anything else (or no answer) is retried with backoff for about a day; after 20 deliveries in a row fail, or 3 days of failing, the endpoint is switched off.\n- URLs must be `https://` on the public internet.\n- `POST /webhook-endpoints/{endpointId}/test` sends a `webhook.test` event; the delivery log (`GET /webhook-endpoints/{endpointId}/deliveries`) shows each attempt, and `POST /webhook-deliveries/{deliveryId}/redeliver` sends one again.\n\n### Verify the signature\n\n`v1` is the hex HMAC-SHA256 of `\"<t>.<raw body>\"`, keyed with the endpoint's secret (`whsec_…`, shown once when you create it). Check it against the raw body, before parsing it, and refuse old timestamps:\n\n```js\nimport { createHmac, timingSafeEqual } from \"node:crypto\";\n\nexport function verifyRemagicaSignature(rawBody, header, secret, toleranceSeconds = 300) {\n  const parts = Object.fromEntries(header.split(\",\").map((part) => part.split(\"=\")));\n  const timestamp = Number(parts.t);\n  if (!Number.isInteger(timestamp) || Math.abs(Date.now() / 1000 - timestamp) > toleranceSeconds) {\n    return false;\n  }\n  const expected = createHmac(\"sha256\", secret).update(`${timestamp}.${rawBody}`).digest(\"hex\");\n  const actual = Buffer.from(parts.v1 ?? \"\");\n  return actual.length === expected.length && timingSafeEqual(actual, Buffer.from(expected));\n}\n\n// Express: app.post(\"/webhooks\", express.raw({ type: \"application/json\" }), (req, res) => {\n//   if (!verifyRemagicaSignature(req.body.toString(), req.get(\"Remagica-Signature\"), process.env.REMAGICA_WEBHOOK_SECRET)) return res.sendStatus(400);\n//   const event = JSON.parse(req.body); res.sendStatus(200); // then handle event.type\n// });\n```","title":"Remagica API","version":"0.1.0"},"servers":[{"description":"This server","url":"/api/v1"},{"description":"Public URL","url":"https://api.remagica.com/api/v1"}],"tags":[{"description":"Get a presigned URL and upload a video straight to object storage. This is always the first step.","name":"Uploads"},{"description":"Turn an upload into short vertical clips. Jobs run asynchronously: create one, then poll it (or stream its progress) until it completes.","name":"Clip jobs"},{"description":"Re-render a finished clip with another caption style, a changed hook or edited words (the editor's Export button). Exports reuse the clip's clean picture and take seconds: create one, then poll it.","name":"Clip exports"},{"description":"Generate images, videos, speech, sound effects and music with the models from `GET /models`. Models are named by what they are (`google/nano-banana-pro`, `bytedance/seedance-2.0`); which provider serves a request is chosen for you. Files go in by storage key (an upload's or an earlier generation's), and results come back as files in your storage. Generations run asynchronously: create one, then poll it.","name":"Generations"},{"description":"What everything costs, in credits: the live price book every estimate and charge reads. Prices can change; a run started with the `priceVersion` you showed is refused with `409 PRICE_CHANGED` rather than charged more.","name":"Pricing"},{"description":"The Library: reusable media and Elements (a character, place, prop or style with a locked description, ordered reference files and an optional generated sheet), in the Team Library or your Private one, with folders, favorites and versions. Mention an item in any prompt with its `mention` token; its files and description go with the request, pinned to a version.","name":"Library"},{"description":"Brand kits: a brand's logos, palette, fonts, tone of voice, guidelines and reference images, in the Team or your Private scope. A generation node that uses a kit gets its tone and guidelines in the prompt and its logos and references as reference images.","name":"Brand kits"},{"description":"Moodboards: a titled board of images with notes, in the Team or your Private scope. A generation node that uses a moodboard gets its images as style references.","name":"Moodboards"},{"description":"References a generation node attaches as `activeReferences` (styles, colour palettes, characters, elements, image looks, camera angles, brand kits, moodboards and Library assets): their text joins the prompt and their images go in as references. Built-ins ship with the app; add your own, save any for the workspace, and read the built-ins' preview images.","name":"References"},{"description":"Node-based workflows: a document of pages of nodes (Prompt, Copilot, Image, Video, Voice, Music, Sound Effects, iterators, Router, the video-editing actions, ...) and the typed edges between them. A run executes the nodes you name, `count` times each, and each node keeps every result it makes; nodes read what's upstream as the result it shows (pull, not push), so nothing upstream runs again.","name":"Workflows"},{"description":"The Projects page over your workflows: list them a page at a time by scope (team or personal) and folder, with a canvas preview and their asset and credit counts; nest them in team or personal folders; duplicate, rename and move them; and share one by link, read-only, for anyone to view and copy.","name":"Projects"},{"description":"Apps: one page of a workflow packaged as a form. Pick its inputs (a Prompt's text, an Import's file, a setting a node exposes) and outputs, publish it for yourself, your team or the community (public apps are reviewed first), and run it with your own values; each run executes in a workflow of your own and streams like any workflow run.","name":"Apps"},{"description":"Ready-made workflows and presets. Templates are whole projects by category: read one's canvas, then start a project from it (`POST /projects` with `templateId`), example results included. Presets are small graphs in Sections for the canvas's Presets panel: insert one, save, then keep its example results (`POST /presets/{slug}/results`).","name":"Templates"},{"description":"The thumbnail reference library: example thumbnails by niche recipe and source, curated ones first, with 480px previews. Send a reference's `key` as a reference image (with a `role`) to use it in a generation.","name":"Thumbnails"},{"description":"Sprite Studio: games (a style bible of style, recipe, camera, canvas, size classes, rules and cleanup) and their cast of characters, each a Library item of kind `sprite` whose versions are its masters. Each character has outfits and actions (idle, walk, attack, ...); an action's takes, one per direction, hold its frames with their timing and gameplay data. Presets save timing and export setups. Masters, takes and drift fixes spend credits (each has an estimate route); exports are free. Follow runs on the live feed (`GET /sprites/events`). MCP clients get the same work as `sprites_*` tools.","name":"Sprites"},{"description":"Webhook endpoints: URLs Remagica POSTs signed events to when your generations, workflow runs, app runs, clip jobs and clip exports end. Add them, test them, read their delivery log and redeliver. The events themselves are listed under the document's `webhooks`.","name":"Webhooks"},{"description":"Credits: the workspace's balance (what it may spend now), what's set aside and about to expire, and its ledger of grants, charges and refunds.","name":"Usage"}],"openapi":"3.1.1","paths":{"/apps":{"post":{"operationId":"createApp","summary":"Create an app","description":"Makes the app of a workflow page (a page has at most one: asking again returns it). It starts as a `draft` with no inputs or outputs.\n\nRequires scope `apps:write`.","tags":["Apps"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pageId":{"type":"string","minLength":1,"maxLength":128,"description":"The page the app packages.","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","minLength":1,"maxLength":100,"description":"Its name; `Untitled App` when left out.","examples":["Autumn campaign"]},"workflowId":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["pageId","workflowId"]}}}},"responses":{"201":{"description":"The page's app.","content":{"application/json":{"schema":{"type":"object","properties":{"canEdit":{"type":"boolean","description":"Whether you can change it (you can edit its workflow)."},"coverUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"id":{"type":"string","examples":["5d1e8a42-7b9c-4f30-a2d6-0c3e9b7f1a54"]},"metrics":{"type":"object","properties":{"lastRunAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixes":{"type":"integer","examples":[1]},"runs":{"type":"integer","examples":[1]}},"required":["lastRunAt","remixes","runs"],"description":"How much it's used: runs (by everyone), the last one, and remixes."},"ownerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixable":{"type":"boolean"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Its address on the Apps page (`/apps/<slug>`)."},"status":{"enum":["draft","in_review","published","rejected"],"type":"string","description":"`draft` → `published`; a public app goes `in_review` first and ends `published` or `rejected`."},"title":{"type":"string","examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["personal","team","public"],"type":"string"},"coverKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"creditsEstimate":{"anyOf":[{"type":"integer","examples":[12]},{"type":"null"}],"description":"What a run with the app's own values would cost, or null when it couldn't run as it is.","examples":[12]},"draft":{"anyOf":[{"type":"object","properties":{"inputs":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":300,"examples":["Product shots for the autumn campaign."]},"key":{"type":"string","minLength":1,"maxLength":64,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":100},"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","parameter"],"type":"string"}},"required":["key","label","nodeId","type"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["nodeId"]}}},"required":["inputs","outputs"]},{"type":"null"}],"description":"The inputs and outputs being edited (people who can edit only); a run uses the published ones."},"form":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":300,"examples":["Product shots for the autumn campaign."]},"key":{"type":"string","minLength":1,"maxLength":64,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":100},"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","parameter"],"type":"string"},"control":{"anyOf":[{"type":"object","properties":{"kind":{"const":"number"},"max":{"type":"number","examples":[1]},"min":{"type":"number","examples":[1]},"step":{"type":"number","examples":[1]}},"required":["kind","step"]},{"type":"object","properties":{"kind":{"const":"select"},"options":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number","examples":[1]}]}}},"required":["kind","options"]},{"type":"object","properties":{"kind":{"const":"switch"}},"required":["kind"]},{"type":"object","properties":{"kind":{"const":"text"}},"required":["kind"]}],"description":"How a parameter is filled in."},"defaultUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A download URL of a media input's own file.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"defaultValue":{"anyOf":[{"anyOf":[{"type":"string","maxLength":20000},{"type":"number","examples":[1]},{"type":"boolean"}]},{"type":"null"}],"description":"The app's own value: what runs when it's left out."},"id":{"type":"string","description":"`nodeId:key`.","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["key","label","nodeId","type","defaultUrl","defaultValue","id"]},"description":"The inputs a run takes: the published ones, or the draft's for a test run."},"outputs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["label","nodeId"]}},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"reviewNote":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"testOnly":{"type":"boolean","description":"Not published yet: only a test run (`test: true`) can run it."},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Its workflow (people who can edit it only).","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["canEdit","coverUrl","createdAt","description","id","metrics","ownerName","publishedAt","remixable","slug","status","title","updatedAt","visibility","coverKey","creditsEstimate","draft","form","outputs","pageId","reviewNote","testOnly","workflowId"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"apps:write"},"get":{"operationId":"listApps","summary":"List apps","description":"Apps to run: your workspace's (`team`), your own (`mine`), the community's public ones (`community`), or those waiting for review (`review`, platform admins). 100 at most, newest first.\n\nRequires scope `apps:read`.","tags":["Apps"],"parameters":[{"name":"scope","in":"query","schema":{"enum":["team","mine","community","review"],"type":"string","default":"team","description":"`team`: your workspace's published apps; `mine`: the ones you made, in any state; `community`: public apps from every workspace; `review`: public apps waiting for review (platform admins only)."},"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string","maxLength":200},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The apps.","content":{"application/json":{"schema":{"type":"object","properties":{"apps":{"type":"array","items":{"type":"object","properties":{"canEdit":{"type":"boolean","description":"Whether you can change it (you can edit its workflow)."},"coverUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"id":{"type":"string","examples":["5d1e8a42-7b9c-4f30-a2d6-0c3e9b7f1a54"]},"metrics":{"type":"object","properties":{"lastRunAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixes":{"type":"integer","examples":[1]},"runs":{"type":"integer","examples":[1]}},"required":["lastRunAt","remixes","runs"],"description":"How much it's used: runs (by everyone), the last one, and remixes."},"ownerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixable":{"type":"boolean"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Its address on the Apps page (`/apps/<slug>`)."},"status":{"enum":["draft","in_review","published","rejected"],"type":"string","description":"`draft` → `published`; a public app goes `in_review` first and ends `published` or `rejected`."},"title":{"type":"string","examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["personal","team","public"],"type":"string"}},"required":["canEdit","coverUrl","createdAt","description","id","metrics","ownerName","publishedAt","remixable","slug","status","title","updatedAt","visibility"]}}},"required":["apps"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"apps:read"}},"/apps/{appId}":{"delete":{"operationId":"deleteApp","summary":"Delete an app","description":"Deletes an app. Runs people made keep their results in their own workspaces.\n\nRequires scope `apps:write`.","tags":["Apps"],"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"The app's id, or its `slug`.","examples":["5d1e8a42-7b9c-4f30-a2d6-0c3e9b7f1a54"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"apps:write"},"get":{"operationId":"getApp","summary":"Get an app","description":"Returns an app: its form (the inputs a run takes, with the app's own values), its outputs and an estimate of a run's cost.\n\nRequires scope `apps:read`.","tags":["Apps"],"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"The app's id, or its `slug`.","examples":["5d1e8a42-7b9c-4f30-a2d6-0c3e9b7f1a54"]}}],"responses":{"200":{"description":"The app.","content":{"application/json":{"schema":{"type":"object","properties":{"canEdit":{"type":"boolean","description":"Whether you can change it (you can edit its workflow)."},"coverUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"id":{"type":"string","examples":["5d1e8a42-7b9c-4f30-a2d6-0c3e9b7f1a54"]},"metrics":{"type":"object","properties":{"lastRunAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixes":{"type":"integer","examples":[1]},"runs":{"type":"integer","examples":[1]}},"required":["lastRunAt","remixes","runs"],"description":"How much it's used: runs (by everyone), the last one, and remixes."},"ownerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixable":{"type":"boolean"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Its address on the Apps page (`/apps/<slug>`)."},"status":{"enum":["draft","in_review","published","rejected"],"type":"string","description":"`draft` → `published`; a public app goes `in_review` first and ends `published` or `rejected`."},"title":{"type":"string","examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["personal","team","public"],"type":"string"},"coverKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"creditsEstimate":{"anyOf":[{"type":"integer","examples":[12]},{"type":"null"}],"description":"What a run with the app's own values would cost, or null when it couldn't run as it is.","examples":[12]},"draft":{"anyOf":[{"type":"object","properties":{"inputs":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":300,"examples":["Product shots for the autumn campaign."]},"key":{"type":"string","minLength":1,"maxLength":64,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":100},"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","parameter"],"type":"string"}},"required":["key","label","nodeId","type"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["nodeId"]}}},"required":["inputs","outputs"]},{"type":"null"}],"description":"The inputs and outputs being edited (people who can edit only); a run uses the published ones."},"form":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":300,"examples":["Product shots for the autumn campaign."]},"key":{"type":"string","minLength":1,"maxLength":64,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":100},"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","parameter"],"type":"string"},"control":{"anyOf":[{"type":"object","properties":{"kind":{"const":"number"},"max":{"type":"number","examples":[1]},"min":{"type":"number","examples":[1]},"step":{"type":"number","examples":[1]}},"required":["kind","step"]},{"type":"object","properties":{"kind":{"const":"select"},"options":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number","examples":[1]}]}}},"required":["kind","options"]},{"type":"object","properties":{"kind":{"const":"switch"}},"required":["kind"]},{"type":"object","properties":{"kind":{"const":"text"}},"required":["kind"]}],"description":"How a parameter is filled in."},"defaultUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A download URL of a media input's own file.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"defaultValue":{"anyOf":[{"anyOf":[{"type":"string","maxLength":20000},{"type":"number","examples":[1]},{"type":"boolean"}]},{"type":"null"}],"description":"The app's own value: what runs when it's left out."},"id":{"type":"string","description":"`nodeId:key`.","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["key","label","nodeId","type","defaultUrl","defaultValue","id"]},"description":"The inputs a run takes: the published ones, or the draft's for a test run."},"outputs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["label","nodeId"]}},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"reviewNote":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"testOnly":{"type":"boolean","description":"Not published yet: only a test run (`test: true`) can run it."},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Its workflow (people who can edit it only).","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["canEdit","coverUrl","createdAt","description","id","metrics","ownerName","publishedAt","remixable","slug","status","title","updatedAt","visibility","coverKey","creditsEstimate","draft","form","outputs","pageId","reviewNote","testOnly","workflowId"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"apps:read"},"patch":{"operationId":"updateApp","summary":"Update an app","description":"Changes an app's name, description, cover, visibility, inputs or outputs. Inputs and outputs only reach people when it's published again; a visibility change on a published app takes effect then too.\n\nRequires scope `apps:write`.","tags":["Apps"],"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3106d2f0-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"coverKey":{"anyOf":[{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"Storage key of the cover: one of the page's results (an image or a video). `null` clears it.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"description":{"type":"string","maxLength":1000,"examples":["Product shots for the autumn campaign."]},"inputs":{"type":"array","maxItems":20,"items":{"type":"object","properties":{"description":{"type":"string","maxLength":300,"examples":["Product shots for the autumn campaign."]},"key":{"type":"string","minLength":1,"maxLength":64,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":100},"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","parameter"],"type":"string"}},"required":["key","label","nodeId","type"]},"description":"What people fill in: a Prompt's `text`, an Import's `key` (its file), or a setting a node exposes (`type: parameter`)."},"outputs":{"type":"array","minItems":0,"maxItems":10,"items":{"type":"object","properties":{"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["nodeId"]},"description":"The runnable nodes whose results people get back."},"remixable":{"type":"boolean","description":"Whether people who can run it may copy its workflow into a project of their own."},"slug":{"type":"string","minLength":3,"maxLength":60,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"Its address on the Apps page (`/apps/<slug>`), unique everywhere. Publishing gives it one from its name when it has none."},"title":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"visibility":{"enum":["personal","team","public"],"type":"string"}}}}}},"responses":{"200":{"description":"The app.","content":{"application/json":{"schema":{"type":"object","properties":{"canEdit":{"type":"boolean","description":"Whether you can change it (you can edit its workflow)."},"coverUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"id":{"type":"string","examples":["5d1e8a42-7b9c-4f30-a2d6-0c3e9b7f1a54"]},"metrics":{"type":"object","properties":{"lastRunAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixes":{"type":"integer","examples":[1]},"runs":{"type":"integer","examples":[1]}},"required":["lastRunAt","remixes","runs"],"description":"How much it's used: runs (by everyone), the last one, and remixes."},"ownerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixable":{"type":"boolean"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Its address on the Apps page (`/apps/<slug>`)."},"status":{"enum":["draft","in_review","published","rejected"],"type":"string","description":"`draft` → `published`; a public app goes `in_review` first and ends `published` or `rejected`."},"title":{"type":"string","examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["personal","team","public"],"type":"string"},"coverKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"creditsEstimate":{"anyOf":[{"type":"integer","examples":[12]},{"type":"null"}],"description":"What a run with the app's own values would cost, or null when it couldn't run as it is.","examples":[12]},"draft":{"anyOf":[{"type":"object","properties":{"inputs":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":300,"examples":["Product shots for the autumn campaign."]},"key":{"type":"string","minLength":1,"maxLength":64,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":100},"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","parameter"],"type":"string"}},"required":["key","label","nodeId","type"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["nodeId"]}}},"required":["inputs","outputs"]},{"type":"null"}],"description":"The inputs and outputs being edited (people who can edit only); a run uses the published ones."},"form":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":300,"examples":["Product shots for the autumn campaign."]},"key":{"type":"string","minLength":1,"maxLength":64,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":100},"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","parameter"],"type":"string"},"control":{"anyOf":[{"type":"object","properties":{"kind":{"const":"number"},"max":{"type":"number","examples":[1]},"min":{"type":"number","examples":[1]},"step":{"type":"number","examples":[1]}},"required":["kind","step"]},{"type":"object","properties":{"kind":{"const":"select"},"options":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number","examples":[1]}]}}},"required":["kind","options"]},{"type":"object","properties":{"kind":{"const":"switch"}},"required":["kind"]},{"type":"object","properties":{"kind":{"const":"text"}},"required":["kind"]}],"description":"How a parameter is filled in."},"defaultUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A download URL of a media input's own file.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"defaultValue":{"anyOf":[{"anyOf":[{"type":"string","maxLength":20000},{"type":"number","examples":[1]},{"type":"boolean"}]},{"type":"null"}],"description":"The app's own value: what runs when it's left out."},"id":{"type":"string","description":"`nodeId:key`.","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["key","label","nodeId","type","defaultUrl","defaultValue","id"]},"description":"The inputs a run takes: the published ones, or the draft's for a test run."},"outputs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["label","nodeId"]}},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"reviewNote":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"testOnly":{"type":"boolean","description":"Not published yet: only a test run (`test: true`) can run it."},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Its workflow (people who can edit it only).","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["canEdit","coverUrl","createdAt","description","id","metrics","ownerName","publishedAt","remixable","slug","status","title","updatedAt","visibility","coverKey","creditsEstimate","draft","form","outputs","pageId","reviewNote","testOnly","workflowId"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"apps:write"}},"/workflows/{workflowId}/app":{"get":{"operationId":"getPageApp","summary":"Get a page's app","description":"Returns the app of a workflow page, or `null` when it has none.\n\nRequires scope `apps:read`.","tags":["Apps"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"name":"pageId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The page's app, if any.","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"anyOf":[{"type":"object","properties":{"canEdit":{"type":"boolean","description":"Whether you can change it (you can edit its workflow)."},"coverUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"id":{"type":"string","examples":["5d1e8a42-7b9c-4f30-a2d6-0c3e9b7f1a54"]},"metrics":{"type":"object","properties":{"lastRunAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixes":{"type":"integer","examples":[1]},"runs":{"type":"integer","examples":[1]}},"required":["lastRunAt","remixes","runs"],"description":"How much it's used: runs (by everyone), the last one, and remixes."},"ownerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixable":{"type":"boolean"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Its address on the Apps page (`/apps/<slug>`)."},"status":{"enum":["draft","in_review","published","rejected"],"type":"string","description":"`draft` → `published`; a public app goes `in_review` first and ends `published` or `rejected`."},"title":{"type":"string","examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["personal","team","public"],"type":"string"},"coverKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"creditsEstimate":{"anyOf":[{"type":"integer","examples":[12]},{"type":"null"}],"description":"What a run with the app's own values would cost, or null when it couldn't run as it is.","examples":[12]},"draft":{"anyOf":[{"type":"object","properties":{"inputs":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":300,"examples":["Product shots for the autumn campaign."]},"key":{"type":"string","minLength":1,"maxLength":64,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":100},"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","parameter"],"type":"string"}},"required":["key","label","nodeId","type"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["nodeId"]}}},"required":["inputs","outputs"]},{"type":"null"}],"description":"The inputs and outputs being edited (people who can edit only); a run uses the published ones."},"form":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":300,"examples":["Product shots for the autumn campaign."]},"key":{"type":"string","minLength":1,"maxLength":64,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":100},"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","parameter"],"type":"string"},"control":{"anyOf":[{"type":"object","properties":{"kind":{"const":"number"},"max":{"type":"number","examples":[1]},"min":{"type":"number","examples":[1]},"step":{"type":"number","examples":[1]}},"required":["kind","step"]},{"type":"object","properties":{"kind":{"const":"select"},"options":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number","examples":[1]}]}}},"required":["kind","options"]},{"type":"object","properties":{"kind":{"const":"switch"}},"required":["kind"]},{"type":"object","properties":{"kind":{"const":"text"}},"required":["kind"]}],"description":"How a parameter is filled in."},"defaultUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A download URL of a media input's own file.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"defaultValue":{"anyOf":[{"anyOf":[{"type":"string","maxLength":20000},{"type":"number","examples":[1]},{"type":"boolean"}]},{"type":"null"}],"description":"The app's own value: what runs when it's left out."},"id":{"type":"string","description":"`nodeId:key`.","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["key","label","nodeId","type","defaultUrl","defaultValue","id"]},"description":"The inputs a run takes: the published ones, or the draft's for a test run."},"outputs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["label","nodeId"]}},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"reviewNote":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"testOnly":{"type":"boolean","description":"Not published yet: only a test run (`test: true`) can run it."},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Its workflow (people who can edit it only).","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["canEdit","coverUrl","createdAt","description","id","metrics","ownerName","publishedAt","remixable","slug","status","title","updatedAt","visibility","coverKey","creditsEstimate","draft","form","outputs","pageId","reviewNote","testOnly","workflowId"]},{"type":"null"}]}},"required":["app"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"apps:read"}},"/apps/{appId}/runs":{"get":{"operationId":"listAppRuns","summary":"List your app runs","description":"Your 30 most recent runs of an app, newest first.\n\nRequires scope `apps:read`.","tags":["Apps"],"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"The app's id, or its `slug`.","examples":["5d1e8a42-7b9c-4f30-a2d6-0c3e9b7f1a54"]}}],"responses":{"200":{"description":"Your runs.","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"appId":{"type":"string","examples":["3106d2f0-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputNodeIds":{"type":"array","items":{"type":"string"}},"run":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"anyOf":[{},{}]},{"type":"null"}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":20000},{"type":"number","examples":[1]},{"type":"boolean"}]},"examples":[{"node_prompt_1:text":"A cozy cabin in the snow"}]},"workflowId":{"type":"string","description":"The workflow the run runs in: follow `GET /workflows/{workflowId}/events` for its results.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["appId","createdAt","id","outputNodeIds","run","values","workflowId"]}}},"required":["runs"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"apps:read"},"post":{"operationId":"startAppRun","summary":"Run an app","description":"Runs an app with your values: they go into a copy of its published page in a workflow of your own, and every node its outputs need runs there (your workspace pays). Results show up `pending` at once.\n\nFollow them with `GET /workflows/{workflowId}/events` (the run's `workflowId`), or poll `GET /workflow-runs/{runId}`. A run that can't start is refused with `409 RUN_REFUSED`, as a workflow run is.\n\nRequires scope `apps:run`.","tags":["Apps"],"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3106d2f0-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","minimum":1,"maximum":20,"default":1,"description":"How many results each output makes."},"priceVersion":{"type":"integer","minimum":0,"description":"The price book version (`GET /pricing`) your estimate came from. If prices went up since, the run is refused with `409 PRICE_CHANGED` and its new estimate, rather than charged more than you showed.","examples":[3]},"test":{"type":"boolean","default":false,"description":"Run the workflow's page as it is now with the app's current inputs and outputs, published or not (people who can edit the workflow only)."},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":20000},{"type":"number","examples":[1]},{"type":"boolean"}]},"default":{},"description":"Values by input id (`nodeId:key`): text, a storage key of your workspace's file for a media input, or a parameter's value. Inputs left out keep the app's own value."}}}}}},"responses":{"202":{"description":"Accepted: the run is going.","content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","examples":["3106d2f0-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputNodeIds":{"type":"array","items":{"type":"string"}},"run":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":20000},{"type":"number","examples":[1]},{"type":"boolean"}]},"examples":[{"node_prompt_1:text":"A cozy cabin in the snow"}]},"workflowId":{"type":"string","description":"The workflow the run runs in: follow `GET /workflows/{workflowId}/events` for its results.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["appId","createdAt","id","outputNodeIds","run","values","workflowId"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["PRICE_CHANGED","RUN_REFUSED","CONFLICT"],"examples":["PRICE_CHANGED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Prices changed since you looked.","The run can't start.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"credits":{"type":"integer","minimum":0,"description":"The run's estimate at today's prices.","examples":[12]},"priceVersion":{"type":"integer","description":"The price book version it was priced with: send it as `priceVersion` to run at that price.","examples":[3]}},"required":["credits","priceVersion"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"apps:run"}},"/apps/{appId}/publish":{"post":{"operationId":"publishApp","summary":"Publish an app","description":"Publishes the app: its page, inputs and outputs as they are now become what runs. A `team` or `personal` app is `published` at once; a `public` one goes `in_review` until a platform admin approves it.\n\nRequires scope `apps:publish`.","tags":["Apps"],"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"The app's id, or its `slug`.","examples":["5d1e8a42-7b9c-4f30-a2d6-0c3e9b7f1a54"]}}],"responses":{"200":{"description":"The app.","content":{"application/json":{"schema":{"type":"object","properties":{"canEdit":{"type":"boolean","description":"Whether you can change it (you can edit its workflow)."},"coverUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"id":{"type":"string","examples":["5d1e8a42-7b9c-4f30-a2d6-0c3e9b7f1a54"]},"metrics":{"type":"object","properties":{"lastRunAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixes":{"type":"integer","examples":[1]},"runs":{"type":"integer","examples":[1]}},"required":["lastRunAt","remixes","runs"],"description":"How much it's used: runs (by everyone), the last one, and remixes."},"ownerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"remixable":{"type":"boolean"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Its address on the Apps page (`/apps/<slug>`)."},"status":{"enum":["draft","in_review","published","rejected"],"type":"string","description":"`draft` → `published`; a public app goes `in_review` first and ends `published` or `rejected`."},"title":{"type":"string","examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["personal","team","public"],"type":"string"},"coverKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"creditsEstimate":{"anyOf":[{"type":"integer","examples":[12]},{"type":"null"}],"description":"What a run with the app's own values would cost, or null when it couldn't run as it is.","examples":[12]},"draft":{"anyOf":[{"type":"object","properties":{"inputs":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":300,"examples":["Product shots for the autumn campaign."]},"key":{"type":"string","minLength":1,"maxLength":64,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":100},"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","parameter"],"type":"string"}},"required":["key","label","nodeId","type"]}},"outputs":{"type":"array","items":{"type":"object","properties":{"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["nodeId"]}}},"required":["inputs","outputs"]},{"type":"null"}],"description":"The inputs and outputs being edited (people who can edit only); a run uses the published ones."},"form":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string","maxLength":300,"examples":["Product shots for the autumn campaign."]},"key":{"type":"string","minLength":1,"maxLength":64,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":100},"nodeId":{"type":"string","minLength":1,"maxLength":64,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","parameter"],"type":"string"},"control":{"anyOf":[{"type":"object","properties":{"kind":{"const":"number"},"max":{"type":"number","examples":[1]},"min":{"type":"number","examples":[1]},"step":{"type":"number","examples":[1]}},"required":["kind","step"]},{"type":"object","properties":{"kind":{"const":"select"},"options":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number","examples":[1]}]}}},"required":["kind","options"]},{"type":"object","properties":{"kind":{"const":"switch"}},"required":["kind"]},{"type":"object","properties":{"kind":{"const":"text"}},"required":["kind"]}],"description":"How a parameter is filled in."},"defaultUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A download URL of a media input's own file.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"defaultValue":{"anyOf":[{"anyOf":[{"type":"string","maxLength":20000},{"type":"number","examples":[1]},{"type":"boolean"}]},{"type":"null"}],"description":"The app's own value: what runs when it's left out."},"id":{"type":"string","description":"`nodeId:key`.","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["key","label","nodeId","type","defaultUrl","defaultValue","id"]},"description":"The inputs a run takes: the published ones, or the draft's for a test run."},"outputs":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["label","nodeId"]}},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"reviewNote":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"testOnly":{"type":"boolean","description":"Not published yet: only a test run (`test: true`) can run it."},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Its workflow (people who can edit it only).","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["canEdit","coverUrl","createdAt","description","id","metrics","ownerName","publishedAt","remixable","slug","status","title","updatedAt","visibility","coverKey","creditsEstimate","draft","form","outputs","pageId","reviewNote","testOnly","workflowId"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"apps:publish"}},"/apps/{appId}/remix":{"post":{"operationId":"remixApp","summary":"Remix an app","description":"Copies an app's workflow (its published page, or the draft for its editors) into a new project of yours, to change and build on. The app must allow remixing, unless you can edit it.\n\nRequires scope `apps:write`.","tags":["Apps"],"parameters":[{"name":"appId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3106d2f0-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"folderId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The project folder for the copy; the top level otherwise.","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}}}}},"responses":{"201":{"description":"The new project.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","examples":["Autumn campaign"]},"workflowId":{"type":"string","description":"The new project.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["name","workflowId"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"apps:write"}},"/brand-kits":{"post":{"operationId":"createBrandKit","summary":"Create a brand kit","description":"Adds a brand kit to the Team or your Private scope. Images are storage keys of the workspace's own images (uploads, generations, Library files).\n\nRequires scope `brand:write`.","tags":["Brand kits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"donts":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160},"description":"Rules the brand never breaks."},"dos":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160},"description":"Rules the brand always follows."},"mission":{"type":"string","maxLength":4000,"description":"What the brand is for, in a sentence or two."},"photography":{"type":"object","properties":{"colorTreatment":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"composition":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"lighting":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"mood":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}}},"required":["colorTreatment","composition","lighting","mood"],"description":"How the brand's photos look: chips for lighting, mood, composition and colour treatment."},"spacing":{"type":"object","properties":{"notes":{"type":"string","maxLength":4000},"preset":{"anyOf":[{"enum":["compact","balanced","airy"],"type":"string"},{"type":"null"}],"description":"How dense its layouts are: `compact`, `balanced` or `airy`."}},"required":["notes","preset"],"description":"Spacing and layout."},"values":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160},"description":"The brand's values, as short phrases."},"colors":{"type":"array","maxItems":24,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#ff8800"]},"name":{"type":"string","maxLength":60,"examples":["Sunrise"]}},"required":["hex"],"description":"A palette colour."}},"fonts":{"type":"array","maxItems":6,"items":{"type":"object","properties":{"family":{"type":"string","minLength":1,"maxLength":100,"examples":["Inter"]},"role":{"enum":["display","heading","body","caption","accent"],"type":"string","description":"What it sets: `display`, `heading`, `body`, `caption` or `accent` text."}},"required":["family","role"],"description":"A typeface of the brand."}},"guidelines":{"type":"string","maxLength":8000,"description":"How to use the brand: do's and don'ts, layout, wording. Added to the prompt of nodes that use the kit."},"logos":{"type":"array","maxItems":10,"items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]}},"required":["key"],"description":"An image in your storage."},"description":"Logo images, in order. Sent as reference images."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"references":{"type":"array","maxItems":24,"items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]}},"required":["key"],"description":"An image in your storage."},"description":"Reference images of the brand's look, in order."},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only.","default":"private"},"tone":{"type":"string","maxLength":8000,"description":"The brand's tone of voice. Added to the prompt of nodes that use the kit."}},"required":["name"],"description":"A new brand kit."}}}},"responses":{"201":{"description":"The brand kit.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#ff8800"]},"name":{"type":"string","maxLength":60,"examples":["Sunrise"]}},"required":["hex"],"description":"A palette colour."}},"donts":{"type":"array","items":{"type":"string"}},"dos":{"type":"array","items":{"type":"string"}},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string","minLength":1,"maxLength":100,"examples":["Inter"]},"role":{"enum":["display","heading","body","caption","accent"],"type":"string","description":"What it sets: `display`, `heading`, `body`, `caption` or `accent` text."}},"required":["family","role"],"description":"A typeface of the brand."}},"guidelines":{"type":"string"},"logos":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"mission":{"type":"string"},"name":{"type":"string","examples":["Autumn campaign"]},"photography":{"type":"object","properties":{"colorTreatment":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"composition":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"lighting":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"mood":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}}},"required":["colorTreatment","composition","lighting","mood"],"description":"How the brand's photos look: chips for lighting, mood, composition and colour treatment."},"references":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"sourceUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The website it was made from, if any.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"spacing":{"type":"object","properties":{"notes":{"type":"string","maxLength":4000},"preset":{"anyOf":[{"enum":["compact","balanced","airy"],"type":"string"},{"type":"null"}],"description":"How dense its layouts are: `compact`, `balanced` or `airy`."}},"required":["notes","preset"],"description":"Spacing and layout."},"tone":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["createdAt","id","ownerUserId","scope","updatedAt","colors","donts","dos","fonts","guidelines","logos","mission","name","photography","references","sourceUrl","spacing","tone","values"],"description":"A brand kit."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:write"},"get":{"operationId":"listBrandKits","summary":"List brand kits","description":"The workspace's Team brand kits and your Private ones, last edited first.\n\nRequires scope `brand:read`.","tags":["Brand kits"],"parameters":[{"name":"q","in":"query","schema":{"type":"string","maxLength":120,"description":"Only those whose name contains this (any case)."},"allowEmptyValue":true,"allowReserved":true},{"name":"scope","in":"query","schema":{"enum":["all","private","team"],"type":"string","default":"all","description":"`all` (default): Team and your Private ones."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The brand kits.","content":{"application/json":{"schema":{"type":"object","properties":{"brandKits":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#ff8800"]},"name":{"type":"string","maxLength":60,"examples":["Sunrise"]}},"required":["hex"],"description":"A palette colour."}},"donts":{"type":"array","items":{"type":"string"}},"dos":{"type":"array","items":{"type":"string"}},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string","minLength":1,"maxLength":100,"examples":["Inter"]},"role":{"enum":["display","heading","body","caption","accent"],"type":"string","description":"What it sets: `display`, `heading`, `body`, `caption` or `accent` text."}},"required":["family","role"],"description":"A typeface of the brand."}},"guidelines":{"type":"string"},"logos":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"mission":{"type":"string"},"name":{"type":"string","examples":["Autumn campaign"]},"photography":{"type":"object","properties":{"colorTreatment":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"composition":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"lighting":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"mood":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}}},"required":["colorTreatment","composition","lighting","mood"],"description":"How the brand's photos look: chips for lighting, mood, composition and colour treatment."},"references":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"sourceUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The website it was made from, if any.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"spacing":{"type":"object","properties":{"notes":{"type":"string","maxLength":4000},"preset":{"anyOf":[{"enum":["compact","balanced","airy"],"type":"string"},{"type":"null"}],"description":"How dense its layouts are: `compact`, `balanced` or `airy`."}},"required":["notes","preset"],"description":"Spacing and layout."},"tone":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["createdAt","id","ownerUserId","scope","updatedAt","colors","donts","dos","fonts","guidelines","logos","mission","name","photography","references","sourceUrl","spacing","tone","values"],"description":"A brand kit."}}},"required":["brandKits"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:read"}},"/brand-kits/from-file":{"post":{"operationId":"createBrandKitFromFile","summary":"Create a brand kit from a file","description":"Makes a brand kit from a brand file you uploaded (a PDF or Word brand book, up to 50 MB): its text is summarised into the kit's sections and its pictures become the kit's photography.\n\nRequires scope `brand:write`.","tags":["Brand kits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":255,"description":"The file's name, for the kit's name if the file has none.","examples":["Brand book.pdf"]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of an upload of yours (`POST /uploads`): a PDF or Word (.docx) file of up to 50 MB.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"scope":{"enum":["private","team"],"type":"string","description":"Where the new kit goes: your Private kits (default) or the Team.","default":"private"}},"required":["fileName","key"]}}}},"responses":{"201":{"description":"The new kit.","content":{"application/json":{"schema":{"type":"object","properties":{"brandKit":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#ff8800"]},"name":{"type":"string","maxLength":60,"examples":["Sunrise"]}},"required":["hex"],"description":"A palette colour."}},"donts":{"type":"array","items":{"type":"string"}},"dos":{"type":"array","items":{"type":"string"}},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string","minLength":1,"maxLength":100,"examples":["Inter"]},"role":{"enum":["display","heading","body","caption","accent"],"type":"string","description":"What it sets: `display`, `heading`, `body`, `caption` or `accent` text."}},"required":["family","role"],"description":"A typeface of the brand."}},"guidelines":{"type":"string"},"logos":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"mission":{"type":"string"},"name":{"type":"string","examples":["Autumn campaign"]},"photography":{"type":"object","properties":{"colorTreatment":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"composition":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"lighting":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"mood":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}}},"required":["colorTreatment","composition","lighting","mood"],"description":"How the brand's photos look: chips for lighting, mood, composition and colour treatment."},"references":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"sourceUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The website it was made from, if any.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"spacing":{"type":"object","properties":{"notes":{"type":"string","maxLength":4000},"preset":{"anyOf":[{"enum":["compact","balanced","airy"],"type":"string"},{"type":"null"}],"description":"How dense its layouts are: `compact`, `balanced` or `airy`."}},"required":["notes","preset"],"description":"Spacing and layout."},"tone":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["createdAt","id","ownerUserId","scope","updatedAt","colors","donts","dos","fonts","guidelines","logos","mission","name","photography","references","sourceUrl","spacing","tone","values"],"description":"A brand kit."},"summarised":{"type":"boolean","description":"Whether a language model wrote its sections; when false it holds only what was found (name, colours, fonts, pictures)."}},"required":["brandKit","summarised"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"brand:write"}},"/brand-kits/from-sample":{"post":{"operationId":"createBrandKitFromSample","summary":"Create a brand kit from a sample","description":"Copies a sample brand kit (`GET /brand-kits/samples`) into a kit of your own to edit or use.\n\nRequires scope `brand:write`.","tags":["Brand kits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"enum":["private","team"],"type":"string","description":"Where the new kit goes: your Private kits (default) or the Team.","default":"private"},"slug":{"type":"string","minLength":1,"maxLength":80,"examples":["fernwood-coffee"]}},"required":["slug"]}}}},"responses":{"201":{"description":"The new kit.","content":{"application/json":{"schema":{"type":"object","properties":{"brandKit":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#ff8800"]},"name":{"type":"string","maxLength":60,"examples":["Sunrise"]}},"required":["hex"],"description":"A palette colour."}},"donts":{"type":"array","items":{"type":"string"}},"dos":{"type":"array","items":{"type":"string"}},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string","minLength":1,"maxLength":100,"examples":["Inter"]},"role":{"enum":["display","heading","body","caption","accent"],"type":"string","description":"What it sets: `display`, `heading`, `body`, `caption` or `accent` text."}},"required":["family","role"],"description":"A typeface of the brand."}},"guidelines":{"type":"string"},"logos":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"mission":{"type":"string"},"name":{"type":"string","examples":["Autumn campaign"]},"photography":{"type":"object","properties":{"colorTreatment":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"composition":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"lighting":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"mood":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}}},"required":["colorTreatment","composition","lighting","mood"],"description":"How the brand's photos look: chips for lighting, mood, composition and colour treatment."},"references":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"sourceUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The website it was made from, if any.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"spacing":{"type":"object","properties":{"notes":{"type":"string","maxLength":4000},"preset":{"anyOf":[{"enum":["compact","balanced","airy"],"type":"string"},{"type":"null"}],"description":"How dense its layouts are: `compact`, `balanced` or `airy`."}},"required":["notes","preset"],"description":"Spacing and layout."},"tone":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["createdAt","id","ownerUserId","scope","updatedAt","colors","donts","dos","fonts","guidelines","logos","mission","name","photography","references","sourceUrl","spacing","tone","values"],"description":"A brand kit."},"summarised":{"type":"boolean","description":"Whether a language model wrote its sections; when false it holds only what was found (name, colours, fonts, pictures)."}},"required":["brandKit","summarised"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:write"}},"/brand-kits/from-website":{"post":{"operationId":"createBrandKitFromWebsite","summary":"Create a brand kit from a website","description":"Makes a brand kit from a brand's website: its name, colours, fonts, logo and share image, with mission, values, tone, photography, spacing and do's and don'ts written from its text. The page is fetched from our servers (public addresses only).\n\nRequires scope `brand:write`.","tags":["Brand kits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"enum":["private","team"],"type":"string","description":"Where the new kit goes: your Private kits (default) or the Team.","default":"private"},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"The brand's website (`https://...`). It's read from our servers: public addresses only, a few seconds and a few MB at most.","examples":["https://example.com"]}},"required":["url"]}}}},"responses":{"201":{"description":"The new kit.","content":{"application/json":{"schema":{"type":"object","properties":{"brandKit":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#ff8800"]},"name":{"type":"string","maxLength":60,"examples":["Sunrise"]}},"required":["hex"],"description":"A palette colour."}},"donts":{"type":"array","items":{"type":"string"}},"dos":{"type":"array","items":{"type":"string"}},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string","minLength":1,"maxLength":100,"examples":["Inter"]},"role":{"enum":["display","heading","body","caption","accent"],"type":"string","description":"What it sets: `display`, `heading`, `body`, `caption` or `accent` text."}},"required":["family","role"],"description":"A typeface of the brand."}},"guidelines":{"type":"string"},"logos":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"mission":{"type":"string"},"name":{"type":"string","examples":["Autumn campaign"]},"photography":{"type":"object","properties":{"colorTreatment":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"composition":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"lighting":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"mood":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}}},"required":["colorTreatment","composition","lighting","mood"],"description":"How the brand's photos look: chips for lighting, mood, composition and colour treatment."},"references":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"sourceUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The website it was made from, if any.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"spacing":{"type":"object","properties":{"notes":{"type":"string","maxLength":4000},"preset":{"anyOf":[{"enum":["compact","balanced","airy"],"type":"string"},{"type":"null"}],"description":"How dense its layouts are: `compact`, `balanced` or `airy`."}},"required":["notes","preset"],"description":"Spacing and layout."},"tone":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["createdAt","id","ownerUserId","scope","updatedAt","colors","donts","dos","fonts","guidelines","logos","mission","name","photography","references","sourceUrl","spacing","tone","values"],"description":"A brand kit."},"summarised":{"type":"boolean","description":"Whether a language model wrote its sections; when false it holds only what was found (name, colours, fonts, pictures)."}},"required":["brandKit","summarised"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"brand:write"}},"/brand-kits/{brandKitId}":{"delete":{"operationId":"deleteBrandKit","summary":"Delete a brand kit","description":"Deletes a brand kit. Its images stay in storage (the Library may use them).\n\nRequires scope `brand:delete`.","tags":["Brand kits"],"parameters":[{"name":"brandKitId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["5b1f0c2e-8f0a-4c5b-9a3d-2e7b6c1d4f80"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:delete"},"get":{"operationId":"getBrandKit","summary":"Get a brand kit","description":"Requires scope `brand:read`.","tags":["Brand kits"],"parameters":[{"name":"brandKitId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["5b1f0c2e-8f0a-4c5b-9a3d-2e7b6c1d4f80"]}}],"responses":{"200":{"description":"The brand kit.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#ff8800"]},"name":{"type":"string","maxLength":60,"examples":["Sunrise"]}},"required":["hex"],"description":"A palette colour."}},"donts":{"type":"array","items":{"type":"string"}},"dos":{"type":"array","items":{"type":"string"}},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string","minLength":1,"maxLength":100,"examples":["Inter"]},"role":{"enum":["display","heading","body","caption","accent"],"type":"string","description":"What it sets: `display`, `heading`, `body`, `caption` or `accent` text."}},"required":["family","role"],"description":"A typeface of the brand."}},"guidelines":{"type":"string"},"logos":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"mission":{"type":"string"},"name":{"type":"string","examples":["Autumn campaign"]},"photography":{"type":"object","properties":{"colorTreatment":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"composition":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"lighting":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"mood":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}}},"required":["colorTreatment","composition","lighting","mood"],"description":"How the brand's photos look: chips for lighting, mood, composition and colour treatment."},"references":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"sourceUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The website it was made from, if any.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"spacing":{"type":"object","properties":{"notes":{"type":"string","maxLength":4000},"preset":{"anyOf":[{"enum":["compact","balanced","airy"],"type":"string"},{"type":"null"}],"description":"How dense its layouts are: `compact`, `balanced` or `airy`."}},"required":["notes","preset"],"description":"Spacing and layout."},"tone":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["createdAt","id","ownerUserId","scope","updatedAt","colors","donts","dos","fonts","guidelines","logos","mission","name","photography","references","sourceUrl","spacing","tone","values"],"description":"A brand kit."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:read"},"patch":{"operationId":"updateBrandKit","summary":"Update a brand kit","description":"Changes a brand kit: the fields you send replace theirs (lists whole, in order); the rest stay.\n\nRequires scope `brand:write`.","tags":["Brand kits"],"parameters":[{"name":"brandKitId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["5b1f0c2e-8f0a-4c5b-9a3d-2e7b6c1d4f80"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"donts":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160},"description":"Rules the brand never breaks."},"dos":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160},"description":"Rules the brand always follows."},"mission":{"type":"string","maxLength":4000,"description":"What the brand is for, in a sentence or two."},"photography":{"type":"object","properties":{"colorTreatment":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"composition":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"lighting":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"mood":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}}},"required":["colorTreatment","composition","lighting","mood"],"description":"How the brand's photos look: chips for lighting, mood, composition and colour treatment."},"spacing":{"type":"object","properties":{"notes":{"type":"string","maxLength":4000},"preset":{"anyOf":[{"enum":["compact","balanced","airy"],"type":"string"},{"type":"null"}],"description":"How dense its layouts are: `compact`, `balanced` or `airy`."}},"required":["notes","preset"],"description":"Spacing and layout."},"values":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160},"description":"The brand's values, as short phrases."},"colors":{"type":"array","maxItems":24,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#ff8800"]},"name":{"type":"string","maxLength":60,"examples":["Sunrise"]}},"required":["hex"],"description":"A palette colour."}},"fonts":{"type":"array","maxItems":6,"items":{"type":"object","properties":{"family":{"type":"string","minLength":1,"maxLength":100,"examples":["Inter"]},"role":{"enum":["display","heading","body","caption","accent"],"type":"string","description":"What it sets: `display`, `heading`, `body`, `caption` or `accent` text."}},"required":["family","role"],"description":"A typeface of the brand."}},"guidelines":{"type":"string","maxLength":8000,"description":"How to use the brand: do's and don'ts, layout, wording. Added to the prompt of nodes that use the kit."},"logos":{"type":"array","maxItems":10,"items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]}},"required":["key"],"description":"An image in your storage."},"description":"Replaces the logos (in order); left out, they're kept."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"references":{"type":"array","maxItems":24,"items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]}},"required":["key"],"description":"An image in your storage."},"description":"Replaces the references (in order); left out, they're kept."},"scope":{"enum":["private","team"],"type":"string","description":"Move it to the Team, or (its creator only) make it Private."},"tone":{"type":"string","maxLength":8000,"description":"The brand's tone of voice. Added to the prompt of nodes that use the kit."}}}}}},"responses":{"200":{"description":"The brand kit.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#ff8800"]},"name":{"type":"string","maxLength":60,"examples":["Sunrise"]}},"required":["hex"],"description":"A palette colour."}},"donts":{"type":"array","items":{"type":"string"}},"dos":{"type":"array","items":{"type":"string"}},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string","minLength":1,"maxLength":100,"examples":["Inter"]},"role":{"enum":["display","heading","body","caption","accent"],"type":"string","description":"What it sets: `display`, `heading`, `body`, `caption` or `accent` text."}},"required":["family","role"],"description":"A typeface of the brand."}},"guidelines":{"type":"string"},"logos":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"mission":{"type":"string"},"name":{"type":"string","examples":["Autumn campaign"]},"photography":{"type":"object","properties":{"colorTreatment":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"composition":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"lighting":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"mood":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}}},"required":["colorTreatment","composition","lighting","mood"],"description":"How the brand's photos look: chips for lighting, mood, composition and colour treatment."},"references":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"sourceUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The website it was made from, if any.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"spacing":{"type":"object","properties":{"notes":{"type":"string","maxLength":4000},"preset":{"anyOf":[{"enum":["compact","balanced","airy"],"type":"string"},{"type":"null"}],"description":"How dense its layouts are: `compact`, `balanced` or `airy`."}},"required":["notes","preset"],"description":"Spacing and layout."},"tone":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["createdAt","id","ownerUserId","scope","updatedAt","colors","donts","dos","fonts","guidelines","logos","mission","name","photography","references","sourceUrl","spacing","tone","values"],"description":"A brand kit."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:write"}},"/brand-kits/{brandKitId}/duplicate":{"post":{"operationId":"duplicateBrandKit","summary":"Duplicate a brand kit","description":"Copies a brand kit you can see into a new one you own, named “<name> copy” unless you name it.\n\nRequires scope `brand:write`.","tags":["Brand kits"],"parameters":[{"name":"brandKitId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["5b1f0c2e-8f0a-4c5b-9a3d-2e7b6c1d4f80"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"The copy's name; “<name> copy” when left out.","examples":["Autumn campaign"]},"scope":{"enum":["private","team"],"type":"string","description":"The copy's scope; the same by default."}}}}}},"responses":{"201":{"description":"The copy.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#ff8800"]},"name":{"type":"string","maxLength":60,"examples":["Sunrise"]}},"required":["hex"],"description":"A palette colour."}},"donts":{"type":"array","items":{"type":"string"}},"dos":{"type":"array","items":{"type":"string"}},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string","minLength":1,"maxLength":100,"examples":["Inter"]},"role":{"enum":["display","heading","body","caption","accent"],"type":"string","description":"What it sets: `display`, `heading`, `body`, `caption` or `accent` text."}},"required":["family","role"],"description":"A typeface of the brand."}},"guidelines":{"type":"string"},"logos":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"mission":{"type":"string"},"name":{"type":"string","examples":["Autumn campaign"]},"photography":{"type":"object","properties":{"colorTreatment":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"composition":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"lighting":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}},"mood":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":160}}},"required":["colorTreatment","composition","lighting","mood"],"description":"How the brand's photos look: chips for lighting, mood, composition and colour treatment."},"references":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"sourceUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The website it was made from, if any.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"spacing":{"type":"object","properties":{"notes":{"type":"string","maxLength":4000},"preset":{"anyOf":[{"enum":["compact","balanced","airy"],"type":"string"},{"type":"null"}],"description":"How dense its layouts are: `compact`, `balanced` or `airy`."}},"required":["notes","preset"],"description":"Spacing and layout."},"tone":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["createdAt","id","ownerUserId","scope","updatedAt","colors","donts","dos","fonts","guidelines","logos","mission","name","photography","references","sourceUrl","spacing","tone","values"],"description":"A brand kit."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:write"}},"/brand-kits/samples":{"get":{"operationId":"listSampleBrandKits","summary":"List sample brand kits","description":"Sample brand kits: made-up brands that show a full kit. Copy one with `POST /brand-kits/from-sample`.\n\nRequires scope `brand:read`.","tags":["Brand kits"],"responses":{"200":{"description":"The samples.","content":{"application/json":{"schema":{"type":"object","properties":{"samples":{"type":"array","items":{"type":"object","properties":{"colors":{"type":"array","items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#ff8800"]},"name":{"type":"string","maxLength":60,"examples":["Sunrise"]}},"required":["hex"],"description":"A palette colour."}},"fonts":{"type":"array","items":{"type":"object","properties":{"family":{"type":"string","minLength":1,"maxLength":100,"examples":["Inter"]},"role":{"enum":["display","heading","body","caption","accent"],"type":"string","description":"What it sets: `display`, `heading`, `body`, `caption` or `accent` text."}},"required":["family","role"],"description":"A typeface of the brand."}},"mission":{"type":"string"},"monogram":{"type":"string"},"name":{"type":"string","examples":["Autumn campaign"]},"slug":{"type":"string"},"tagline":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["colors","fonts","mission","monogram","name","slug","tagline","values"],"description":"A sample brand kit (a made-up brand)."}}},"required":["samples"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:read"}},"/clip-jobs":{"post":{"operationId":"createClipJob","summary":"Create a clip job","description":"Queues a job that turns one of your uploads into short vertical clips: it finds the strongest moments, reframes them to 9:16 and adds captions and a hook card.\n\nProcessing is asynchronous and takes minutes. The response is `202 Accepted` with the job id; poll `GET /clip-jobs/{jobId}` (every 5 seconds or so) until `status` is `completed` or `failed`, or stream `GET /clip-jobs/{jobId}/events`. `progress` says which stage the job is in and how far along it is.\n\nA job costs credits per minute of source it processes (see `GET /credits`). The upload's length is measured from the file itself when the job is created (a file whose length can't be read is refused with `400`), and credits for that length, cut to `maxMinutes`, are set aside then (`402` when the workspace can't cover it). The job processes no more of the source than that, is charged for the minutes it processed when it completes (never more than was set aside), and nothing if it fails.\n\nRequires scope `clips:submit`.","tags":["Clip jobs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClipJobRequest"}}}},"responses":{"202":{"description":"Accepted: the job is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string","description":"Id of the new job. Poll `GET /clip-jobs/{jobId}`.","examples":["5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40"]}},"required":["jobId"],"description":"The queued job."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["This Idempotency-Key was already used with a different request"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}},"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help."},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"clips:submit"},"get":{"operationId":"listClipJobs","summary":"List clip jobs","description":"Returns your 100 most recent jobs, newest first, each with its clip count and progress. Fetch one with `GET /clip-jobs/{jobId}` for its clips.\n\nRequires scope `clips:read`.","tags":["Clip jobs"],"responses":{"200":{"description":"Your jobs, newest first.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClipJobSummary"},"description":"Your 100 most recent jobs, newest first."}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"clips:read"}},"/clip-jobs/{jobId}":{"get":{"operationId":"getClipJob","summary":"Get a clip job","description":"Returns one of your jobs. `progress` says what it is doing (stage, percent, a short message, clips rendered so far and, while rendering, a rough ETA). Once `status` is `completed`, `clips` lists every clip with a `videoUrl` and `posterUrl` to download. While the job is `queued` or `processing`, poll every 5 seconds or so (progress changes at each stage and after each clip, every few seconds to a minute), or stream `GET /clip-jobs/{jobId}/events` instead.\n\nRequires scope `clips:read`.","tags":["Clip jobs"],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Id returned by `POST /clip-jobs`.","examples":["5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40"]}}],"responses":{"200":{"description":"The job with its clips.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClipJob"}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"clips:read"}},"/clips":{"get":{"operationId":"listClips","summary":"List clips","description":"Lists the clips of all your jobs, a page at a time: newest job first, each job's clips in order, with links to the poster and the video. Clips show up here as each one renders.\n\nRequires scope `clips:read`.","tags":["Clip jobs"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","maxLength":500,"description":"`nextCursor` from the previous page."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":30,"description":"How many clips to return (1-100)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"A page of clips.","content":{"application/json":{"schema":{"type":"object","properties":{"clips":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When the clip was stored.","examples":["2026-09-27T12:00:00.000Z"]},"durationSeconds":{"type":"number","minimum":0,"description":"Clip length in seconds.","examples":[42.5]},"id":{"type":"string","description":"Clip id.","examples":["9d2e7a61-3b0f-4c1e-b5a8-7f4d2c6e1a93"]},"index":{"type":"integer","minimum":0,"description":"Position in the job's clip list, starting at 0.","examples":[0]},"jobId":{"type":"string","description":"The job this clip belongs to.","examples":["5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40"]},"posterUrl":{"type":"string","format":"uri","description":"URL of the poster image (JPEG). Public when the deployment has a public storage domain, otherwise presigned and valid for 1 hour.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"score":{"type":"integer","description":"How strong the moment is, 0-100 (higher is better), as ranked by the selector.","examples":[87]},"title":{"type":"string","description":"Suggested title for the clip.","examples":["Why most startups underprice"]},"videoUrl":{"type":"string","format":"uri","description":"URL of the rendered vertical clip (MP4). Public when the deployment has a public storage domain, otherwise presigned and valid for 1 hour.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]},"aspectRatio":{"enum":["9:16","1:1","16:9","4:5"],"type":"string","description":"The clip's frame, its job's `aspectRatio`.","examples":["9:16"]}},"required":["createdAt","durationSeconds","id","index","jobId","posterUrl","score","title","videoUrl","aspectRatio"],"description":"A finished clip in a list, with its links."},"description":"Clips of your jobs, newest job first, each job's clips in order."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` for the next page; `null` on the last."}},"required":["clips","nextCursor"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"clips:read"}},"/clip-jobs/{jobId}/events":{"get":{"operationId":"watchClipJob","summary":"Stream a clip job's progress","description":"Streams one of your jobs' status and progress as server-sent events (`text/event-stream`): the current state at once, then a `message` event whenever the stage, percent, message or status changes. Each event's `data` is JSON (`id`, `status`, `error`, `progress`, as on `GET /clip-jobs/{jobId}`).\n\nOnce the job is `completed` or `failed`, its final state is sent as a `message`, then a `done` event (`{\"status\": \"completed\"}` or `\"failed\"`) ends the stream: close your `EventSource` on `done`, or it reconnects and gets the final state again. A stream closed without `done` (after 30 minutes at most, or a server restart) means the job is still running: reconnect to keep watching. The server checks the job every 2 seconds and sends a keep-alive comment every 15 seconds. An unknown job, or someone else's, is a `404` before the stream starts.\n\nRequires scope `clips:read`.","tags":["Clip jobs"],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Id returned by `POST /clip-jobs`.","examples":["5f0c2a4e-1d7b-4b9e-8a3c-2e6f9d1b7c40"]}}],"responses":{"200":{"description":"An event stream of the job's updates, ending when it completes or fails.","content":{"text/event-stream":{"schema":{"oneOf":[{"type":"object","properties":{"event":{"const":"message"},"data":{"$ref":"#/components/schemas/ClipJobUpdate"},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event","data"]},{"type":"object","properties":{"event":{"const":"done"},"data":{"type":"object","properties":{"status":{"enum":["completed","failed"],"type":"string","description":"How the job ended.","examples":["completed"]}},"required":["status"],"description":"Sent as the last (`done`) event once the job is completed or failed."},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event"]},{"type":"object","properties":{"event":{"const":"error"},"data":{},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event"]}]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"clips:read"}},"/clips/{clipId}/exports":{"post":{"operationId":"createClipExport","summary":"Re-export a clip","description":"Re-renders one of your clips with a new caption style, a changed hook (text, look, position or hidden) and/or edited words. Nothing is re-transcribed or re-cut: the worker burns the clip's clean picture again, so an export takes seconds.\n\nEverything in the body is optional; whatever is left out stays as the clip has it. The response is `202 Accepted` with the export id; poll `GET /clips/{clipId}/exports/{exportId}` until `status` is `completed` (then `videoUrl` is the new clip) or `failed`.\n\nClips made before re-exports existed have no `words.json` and answer `409 CONFLICT`.\n\nAn export costs credits for the clip's length (a base plus each minute), charged when it starts (`402` when the workspace can't cover it) and refunded if it fails.\n\nRequires scope `clips:submit`.","tags":["Clip exports"],"parameters":[{"name":"clipId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Id of one of your clips (`clips[].id` from `GET /clip-jobs/{jobId}`).","examples":["9d2e7a61-3b0f-4c1e-b5a8-7f4d2c6e1a93"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"captionStyle":{"type":"object","properties":{"animation":{"type":"object","properties":{"bgColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Box behind the spoken word (word-bg-highlight); null: none."},"highlightColor":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Text colour of the spoken word; null: the font colour."},"name":{"enum":["none","karaoke-fill-pop","pop","scale","box-highlight","word-bg-highlight","glitch-zoom","bounce","shake","blur-switch","focus","blur-in","words-pop","slide-down","hover","scale-in","breathe","glow","reveal"],"type":"string"}},"additionalProperties":false},"background":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean","description":"A box behind every line (replaces the outline and shadow)."},"opacity":{"type":"number","minimum":0,"maximum":1,"examples":[1]}},"additionalProperties":false},"font":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"family":{"enum":["Anton","Archivo","Bangers","Barlow Condensed","Bebas Neue","Courier Prime","Heebo","Kanit","Lemon","Lilita One","Montserrat","Noto Serif","Oswald","Poltawski Nowy","Poppins","Roboto","Spline Sans"],"type":"string"},"italic":{"type":"boolean"},"letterSpacing":{"type":"number","minimum":-10,"maximum":40,"description":"Extra space after every character, in reference units.","examples":[1]},"size":{"type":"number","maximum":200,"exclusiveMinimum":0,"description":"In reference units: 1 unit is the frame's short side / 540 px (a 40-unit font has an 80 px em at 1080×1920).","examples":[2457600]},"weight":{"type":"integer","minimum":100,"maximum":900,"description":"The closest bundled weight of the family is drawn.","examples":[1]}},"additionalProperties":false},"highlight":{"type":"object","properties":{"primary":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"secondary":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},{"type":"null"}],"description":"Colour already-spoken words keep (karaoke-fill-pop)."}},"additionalProperties":false},"layout":{"type":"object","properties":{"lines":{"enum":["single","multi"],"type":"string"},"maxCharsPerLine":{"type":"integer","minimum":4,"maximum":60,"examples":[1]},"maxLines":{"type":"integer","minimum":1,"maximum":4,"description":"Used when `lines` is `multi`.","examples":[1]},"maxSeconds":{"type":"number","minimum":0.3,"maximum":10,"description":"A page never spans more seconds of speech than this.","examples":[5]},"maxWordsPerLine":{"type":"integer","minimum":1,"maximum":12,"examples":[1]}},"additionalProperties":false},"position":{"type":"object","properties":{"anchor":{"enum":["auto","top","middle","bottom"],"type":"string","description":"`auto`: the bottom, clear of the platforms' UI."},"offset":{"type":"number","minimum":-0.5,"maximum":0.5,"description":"Shift as a share of the frame height, positive = down.","examples":[1]}},"additionalProperties":false},"shadow":{"type":"object","properties":{"blur":{"type":"number","minimum":0,"maximum":40,"examples":[1]},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"x":{"type":"number","minimum":-40,"maximum":40,"examples":[1]},"y":{"type":"number","minimum":-40,"maximum":40,"examples":[1]}},"additionalProperties":false},"stroke":{"type":"object","properties":{"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$","description":"#RRGGBB, or #RRGGBBAA with alpha (00 clear, FF solid)."},"enabled":{"type":"boolean"},"width":{"type":"number","minimum":0,"maximum":60,"description":"A centred outline in reference units: half shows outside.","examples":[1024]}},"additionalProperties":false},"uppercase":{"type":"boolean"},"preset":{"enum":["none","bold-pop","karaoke","deep-diver","youshaei","pod-p","simple","beasty","mozi","popline","think-media","soft-landing","baby-earthquake","breathe","seamless-bounce","focus","blur-switch","grow","glitch-infinite","highlighter-box","blur-in","with-backdrop","baby-steps","neon-glow","stream-pop","stream-box","one-word"],"type":"string"}},"additionalProperties":false,"description":"Caption look: `preset` (one of the ids below) plus optional overrides, each patching one field of the preset's style:\n`font` (`family`, `weight`, `italic`, `size`, `color`, `letterSpacing`), `stroke` (`enabled`, `color`, `width`),\n`shadow` (`enabled`, `color`, `x`, `y`, `blur`), `uppercase`, `animation` (`name`, `highlightColor`, `bgColor`),\n`highlight` (`primary`, `secondary`), `background` (`enabled`, `color`, `opacity`),\n`layout` (`lines`, `maxLines`, `maxWordsPerLine`, `maxCharsPerLine`, `maxSeconds`) and `position` (`anchor`, `offset`).\nSizes are reference units (1 unit = the frame's short side / 540 px); colours are `#RRGGBB` or `#RRGGBBAA`.\n\nPresets: `none`, `bold-pop`, `karaoke`, `deep-diver`, `youshaei`, `pod-p`, `simple`, `beasty`, `mozi`, `popline`, `think-media`, `soft-landing`, `baby-earthquake`, `breathe`, `seamless-bounce`, `focus`, `blur-switch`, `grow`, `glitch-infinite`, `highlighter-box`, `blur-in`, `with-backdrop`, `baby-steps`, `neon-glow`, `stream-pop`, `stream-box`, `one-word`. `none` burns no captions.\n\nOmit it to keep the clip's own style.","examples":[{"preset":"beasty"},{"font":{"size":60},"preset":"karaoke"}]},"captions":{"type":"boolean","description":"Burn the captions. Omit it to keep what the clip did (captions on unless the job turned them off).","examples":[true]},"hook":{"type":"object","properties":{"position":{"anyOf":[{"enum":["top","center","bottom"],"type":"string","description":"A named spot; the card is placed near it, off the faces."},{"type":"object","properties":{"scale":{"type":"number","minimum":0.5,"maximum":2,"description":"Card size relative to the style's (0.5-2); default 1.","examples":[1.2]},"x":{"type":"number","minimum":0,"maximum":1,"description":"Horizontal centre of the card, as a share of the frame width (0 = left edge, 1 = right edge).","examples":[0.5]},"y":{"type":"number","minimum":0,"maximum":1,"description":"Vertical centre of the card, as a share of the frame height (0 = top, 1 = bottom).","examples":[0.12]}},"required":["x","y"],"additionalProperties":false,"description":"An exact spot: the card's centre."}],"description":"Where the card goes. Either a named spot or an exact box:\n\n- `\"top\"`, `\"center\"`, `\"bottom\"`: placed near that spot, off the faces measured on the clip and clear of the captions.\n- `{ x, y, scale? }`: the card's **centre** as shares of the frame (0-1 each, `{ \"x\": 0.5, \"y\": 0.1 }` is centred near the top), as the editor dropped it. `scale` (0.5-2, default 1) resizes the card. The card is kept wholly inside the frame.\n\nOmit it to re-place the card at the clip's own spot, around the faces (useful when only the text or style changed).","examples":["top",{"x":0.5,"y":0.12}]},"style":{"enum":["pill","classic","dark","yellow","red","outline","outline_yellow","title_card","title_card_serif","headline","bubble"],"type":"string","description":"Look of the card: `pill`, `classic`, `dark`, `yellow`, `red`, `outline`, `outline_yellow`, `title_card`, `title_card_serif`, `headline`, `bubble`. Omit it to keep the clip's.","examples":["dark"]},"text":{"type":"string","maxLength":200,"description":"The card's headline (at most 200 characters). Omit it to keep the clip's.","examples":["Nobody tells you this about pricing"]},"visible":{"type":"boolean","description":"Burn the card into the export. `false` hides it (the export's words.json still records where it would go).","examples":[true]}},"required":["visible"],"additionalProperties":false,"description":"The hook card. Omit the whole object to keep the clip's hook as it is."},"words":{"type":"array","maxItems":3000,"items":{"type":"object","properties":{"end":{"type":"number","minimum":0,"examples":[1]},"speaker":{"anyOf":[{"type":"integer","minimum":0,"examples":[1]},{"type":"null"}],"examples":[1]},"start":{"type":"number","minimum":0,"examples":[1]},"word":{"type":"string","minLength":1,"maxLength":40}},"required":["end","start","word"],"additionalProperties":false,"description":"One word, in seconds from the clip's start. `word` is 1-40 characters with no line breaks; `end` is not before `start`.","examples":[{"end":0.48,"start":0.12,"word":"Nobody"}]},"description":"The clip's words, edited: fix a transcription typo or retime a word. At most 3000 words, sorted by `start`, all ending within the clip.\nStart from `words` in the clip's `words.json` (`wordsUrl`). Omit it to keep the clip's words.","examples":[[{"end":0.48,"start":0.12,"word":"Nobody"},{"end":0.8,"start":0.5,"word":"tells"}]]}},"description":"The clip to re-export (path) and what to change (body). An empty body re-renders the clip as it is."}}}},"responses":{"202":{"description":"Accepted: the export is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"exportId":{"type":"string","description":"Id of the new export. Poll `GET /clips/{clipId}/exports/{exportId}`.","examples":["3c7b1e90-52d4-4f8a-9e61-0b2d7a4c5f18"]}},"required":["exportId"],"description":"The queued export."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"clips:submit"},"get":{"operationId":"listClipExports","summary":"List a clip's exports","description":"Returns the 100 most recent exports of one of your clips, newest first, with download links for the finished ones.\n\nRequires scope `clips:read`.","tags":["Clip exports"],"parameters":[{"name":"clipId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Id of one of your clips (`clips[].id` from `GET /clip-jobs/{jobId}`).","examples":["9d2e7a61-3b0f-4c1e-b5a8-7f4d2c6e1a93"]}}],"responses":{"200":{"description":"The clip's exports, newest first.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClipExport"},"description":"The clip's 100 most recent exports, newest first."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"clips:read"}},"/clips/{clipId}/exports/{exportId}":{"get":{"operationId":"getClipExport","summary":"Get a clip export","description":"Returns one export of your clip. Once `status` is `completed`, `videoUrl` and `posterUrl` are the new clip and its poster. Poll every second or two while it is `queued` or `processing`.\n\nRequires scope `clips:read`.","tags":["Clip exports"],"parameters":[{"name":"clipId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Id of one of your clips (`clips[].id` from `GET /clip-jobs/{jobId}`).","examples":["9d2e7a61-3b0f-4c1e-b5a8-7f4d2c6e1a93"]}},{"name":"exportId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"Id returned by `POST /clips/{clipId}/exports`.","examples":["3c7b1e90-52d4-4f8a-9e61-0b2d7a4c5f18"]}}],"responses":{"200":{"description":"The export.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClipExport"}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"clips:read"}},"/asset-shares":{"get":{"operationId":"getAssetShare","summary":"Read a file's share link","description":"A file's share link: its token, public page and who it lets in. `null` when it was never shared.\n\nRequires scope `library:share`.","tags":["Library"],"parameters":[{"name":"mediaKey","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":1024,"description":"The file's storage key (an upload's, a generation's or a workflow output's). A node's result and the asset filed from it share one thread.","examples":["generations/org_1/2c9a7f10/image-0.png"]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The share, or null.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"path":{"type":"string"},"role":{"enum":["restricted","view","comment"],"type":"string","description":"`restricted` (the link is off), `view` (anyone with it sees the file) or `comment` (and, signed in, comments on it)."},"showPrompt":{"type":"boolean"},"token":{"type":"string"}},"required":["path","role","showPrompt","token"]},{"type":"null"}]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:share"},"put":{"operationId":"updateAssetShare","summary":"Share a file","description":"Turns a file's share link on (`view` or `comment`) or off (`restricted`), and sets what its public page shows. The link (`/a/<token>`) stays the same each time it's turned on.\n\nRequires scope `library:share`.","tags":["Library"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contentType":{"type":"string","maxLength":200,"examples":["image/png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"mediaKey":{"type":"string","minLength":1,"maxLength":1024,"description":"The file's storage key (an upload's, a generation's or a workflow output's). A node's result and the asset filed from it share one thread.","examples":["generations/org_1/2c9a7f10/image-0.png"]},"model":{"type":"string","maxLength":200,"examples":["google/nano-banana-pro"]},"prompt":{"type":"string","maxLength":20000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"role":{"enum":["restricted","view","comment"],"type":"string","description":"`restricted` (the link is off), `view` (anyone with it sees the file) or `comment` (and, signed in, comments on it)."},"showPrompt":{"type":"boolean","default":true},"title":{"type":"string","maxLength":200,"default":""}},"required":["kind","mediaKey","role"]}}}},"responses":{"200":{"description":"The share.","content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"role":{"enum":["restricted","view","comment"],"type":"string","description":"`restricted` (the link is off), `view` (anyone with it sees the file) or `comment` (and, signed in, comments on it)."},"showPrompt":{"type":"boolean"},"token":{"type":"string"}},"required":["path","role","showPrompt","token"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:share"}},"/credits":{"get":{"operationId":"getCredits","summary":"Get credits","description":"The workspace's credit balance (what it may spend now: its credits less any debt and what runs in progress set aside), its plan, credits expiring in the next 7 days, what you've spent this month and your credit limit if an admin set one. New workspaces start at 0: credits come from a paid plan, a credit pack or a code.\n\nRequires scope `usage:read`.","tags":["Usage"],"responses":{"200":{"description":"The balance.","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"type":"integer","description":"Credits the workspace may spend now: its unexpired credits less any debt and what runs in progress set aside.","examples":[12]},"canGrant":{"type":"boolean","description":"You may add credits by hand (Remagica staff only)."},"canManage":{"type":"boolean","description":"You may set members' credit limits (owners and admins)."},"debt":{"type":"integer","description":"Credits spent beyond what the workspace held (e.g. a refunded purchase); the next credits added pay it first.","examples":[12]},"expiringSoon":{"type":"integer","description":"Credits that expire in the next 7 days if not spent.","examples":[12]},"frozen":{"type":"boolean","description":"The workspace's credits are on hold (a payment is being looked into): runs and generations are refused."},"held":{"type":"integer","description":"Credits set aside for workflow runs in progress.","examples":[1]},"nextExpiry":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When the workspace's next credits expire, if any do.","examples":["2026-10-21T12:00:00.000Z"]},"personal":{"type":"boolean","description":"This is someone's personal workspace (made at sign-up)."},"plan":{"enum":["free","creator","pro","studio","agency","enterprise"],"type":"string","description":"The workspace's plan: which models it may use."},"trialAwaitsVerification":{"type":"boolean","description":"Verifying your email would give this workspace your free trial credits. Always false: new accounts no longer get a free trial."},"you":{"type":"object","properties":{"cap":{"anyOf":[{"type":"object","properties":{"creditMax":{"type":"integer","description":"Most the person may spend per period.","examples":[1]},"period":{"enum":["monthly","quarterly","yearly"],"type":"string","description":"How often the limit resets: on the 1st of each month, quarter or year (UTC)."},"resetsAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"spent":{"type":"integer","description":"Spent since the period began.","examples":[12]}},"required":["creditMax","period","resetsAt","spent"],"description":"A member's credit limit and what they've used of it."},{"type":"null"}]},"spentThisMonth":{"type":"integer","description":"What you've spent since the 1st (UTC).","examples":[12]}},"required":["cap","spentThisMonth"]}},"required":["balance","canGrant","canManage","debt","expiringSoon","frozen","held","nextExpiry","personal","plan","trialAwaitsVerification","you"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"usage:read"}},"/credits/api-keys":{"get":{"operationId":"listCreditApiKeys","summary":"List API keys that spent credits","description":"Every API key that has spent the workspace's credits, by name, including keys deleted since (by the name they last spent under): what `apiKeyId` on the history and usage filters by.\n\nRequires scope `usage:read`.","tags":["Usage"],"responses":{"200":{"description":"The keys.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"anyOf":[{"type":"string","examples":["Autumn campaign"]},{"type":"null"}],"description":"Its name now, or as it was when it spent (if it's been deleted).","examples":["Autumn campaign"]},"deleted":{"type":"boolean","description":"The key has been deleted."}},"required":["id","name","deleted"],"description":"An API key that has spent the workspace's credits."}}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"usage:read"}},"/credits/history":{"get":{"operationId":"listCreditHistory","summary":"List credit history","description":"The credit ledger, newest first: grants (with their `source`), each workflow run (its estimate and what it actually cost, refunds of failed or cancelled results taken off), each generation made outside a run, and credits that expired (`expire`), were clawed back (`reversal`) or adjusted by staff (`adjustment`). Each line says which API key spent it (`apiKey`, null for the app); `apiKeyId` shows only one key's.\n\nRequires scope `usage:read`.","tags":["Usage"],"parameters":[{"name":"apiKeyId","in":"query","schema":{"type":"string","minLength":1,"description":"Only what this API key spent (its id).","examples":["40f137ef-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"allowEmptyValue":true,"allowReserved":true},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"A page of the history.","content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"integer","description":"Net change to the balance: grants add, charges (less their refunds) take away.","examples":[12]},"apiKey":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"anyOf":[{"type":"string","examples":["Autumn campaign"]},{"type":"null"}],"description":"Its name now, or as it was when it spent (if it's been deleted).","examples":["Autumn campaign"]}},"required":["id","name"]},{"type":"null"}],"description":"The API key that spent it; null for spending in the app (and for grants)."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"estimated":{"anyOf":[{"type":"integer","examples":[12]},{"type":"null"}],"description":"For a workflow run: what it was estimated to cost before it started.","examples":[12]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"For a grant: when its credits expire, if they do.","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["grant","run","generation","clip_job","render","chat","brand","enhance","expire","reversal","adjustment"],"type":"string","description":"A grant, a workflow run, a generation outside a run, a clip job, a render (an editor export, a clip re-export or a transcription), an agent chat turn, a Brand Hub import or style capture, a prompt enhancement, credits that expired, credits clawed back (a refunded or disputed purchase), or a staff adjustment."},"model":{"anyOf":[{"type":"string","examples":["google/nano-banana-pro"]},{"type":"null"}],"examples":["google/nano-banana-pro"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","name"]},{"type":"null"}]},"refunded":{"type":"integer","description":"What came back from failed or cancelled work.","examples":[1]},"runStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"anyOf":[{"enum":["starting","manual","seed","trial","subscription","pack","gift","promo_code","migration","refund"],"type":"string"},{"type":"null"}],"description":"For a grant, where it came from (`trial`, `subscription`, `pack`, `gift`, `promo_code`, `manual`, `refund`…); for an expiry or a clawback, the lot's."},"user":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","name"]},{"type":"null"}],"description":"The person, when there is one."}},"required":["amount","apiKey","createdAt","estimated","expiresAt","id","kind","model","note","project","refunded","runStatus","source","user"],"description":"One line of the credit history: a grant, a run or a generation."}},"hasMore":{"type":"boolean"}},"required":["entries","hasMore"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"usage:read"}},"/generations/{generationId}/cancel":{"post":{"operationId":"cancelGeneration","summary":"Cancel a generation","description":"Cancels a generation that hasn't finished, as a workflow's Stop does. One still queued, here or at its provider (which then drops it), is `cancelled` and its credits come back. One its provider is already rendering (or may have started: a request on its way) can't be stopped without being billed, so it's kept: it finishes, is charged, and comes back with `stopRequested: true` and its `status` unchanged. Nothing more is sent for it either way.\n\nRequires scope `generations:cancel`.","tags":["Generations"],"parameters":[{"name":"generationId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"The generation: `cancelled` and refunded, or kept (`stopRequested`), to finish and be charged.","content":{"application/json":{"schema":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"generations:cancel"}},"/generations/background-removals":{"post":{"operationId":"createBackgroundRemovalGeneration","summary":"Remove an image's background","description":"Starts generating a cutout of `image`: its subject on a transparent background (a PNG). Pick the model from `GET /models`; the request is validated against what that model accepts, and files are referenced by storage key (an upload's `key` or an earlier generation's output `key`).\n\nThe response is `202 Accepted` with the generation. Poll `GET /generations/{generationId}` until `status` is `completed` (then `outputs` holds the files) or `failed`.\n\nRequires scope `generations:submit`.","tags":["Generations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"The image to cut out: an upload's `key` or a generation output's `key`."},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"description":"Makes the request safe to retry: a second request with the same key in this workspace returns the generation the first one started, and starts nothing (nor charges again). That holds when the first one failed too, even if it couldn't be queued (`status: failed`, `failure.providerCode: not_queued`, its credits refunded): to try again, send a new key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Background removal model id from `GET /models` (`kind: background_removal`).","examples":["bria/rmbg-2.0"]},"source":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$","description":"Where the request comes from, kept on the generation as `metadata.source` (e.g. `tool:image`), so you can tell your own surfaces apart.","examples":["tool:image"]}},"required":["image","model"],"description":"A background removal request."}}}},"responses":{"202":{"description":"Accepted: the generation is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"generations:submit"}},"/generations/images":{"post":{"operationId":"createImageGeneration","summary":"Generate images","description":"Starts generating images from a prompt, optionally editing or composing reference images. Pick the model from `GET /models`; the request is validated against what that model accepts, and files are referenced by storage key (an upload's `key` or an earlier generation's output `key`).\n\nMention Library items in the prompt with their `mention` token (`[@ id=\"lib:<itemId>\" label=\"ninja\"]`, or `lib:<itemId>@v2` for a version): their files are added after your references, the prompt points at them, and their locked descriptions are added. Point at references yourself as `@Image1`, `@Video1`, `@Audio1` (the n-th of that kind); each provider gets its own syntax.\n\nThe response is `202 Accepted` with the generation. Poll `GET /generations/{generationId}` until `status` is `completed` (then `outputs` holds the files) or `failed`.\n\nRequires scope `generations:submit`.","tags":["Generations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"aspectRatio":{"enum":["auto","21:9","16:9","3:2","4:3","5:4","1:1","4:5","3:4","2:3","9:16"],"type":"string","description":"Output aspect ratio. `auto` lets the model decide (with references, usually the first reference's)."},"background":{"enum":["auto","transparent","opaque"],"type":"string","description":"`transparent` for a cut-out PNG. Only models whose `params` list it (GPT Image 2)."},"count":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"How many images to make."},"imageSearch":{"type":"boolean","description":"Let the model look up pictures on Google Image Search. Only models whose `params` list it (Nano Banana 2)."},"prompt":{"type":"string","minLength":1,"maxLength":20000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"promptExpansion":{"type":"boolean","description":"Let the model expand the prompt itself (FLUX, Ideogram's Magic Prompt). Only models whose `params` list it."},"quality":{"enum":["auto","low","medium","high","xhigh","max"],"type":"string","description":"Rendering quality. Only models whose `params` list it."},"references":{"type":"array","maxItems":30,"items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["subject","product","layout","lighting","typography"],"type":"string","description":"What this reference is for: `subject` (a face or person), `product`, `layout`, `lighting` or `typography`. Recorded with the generation."}},"required":["key"],"description":"A reference image in your storage."},"default":[],"description":"Reference images. With any, the model edits or composes from them."},"resolution":{"enum":["1K","2K","4K"],"type":"string"},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"examples":[1]},"thinkingLevel":{"enum":["minimal","medium","high"],"type":"string","description":"Let the model think before drawing. Only models whose `params` list it (Nano Banana 2)."},"webSearch":{"type":"boolean","description":"Let the model search the web for current facts. Only models whose `params` list it (Nano Banana)."},"activeReferences":{"type":"object","properties":{"styles":{"type":"array","maxItems":1,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"colorPalettes":{"type":"array","maxItems":1,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"characters":{"type":"array","maxItems":3,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"elements":{"type":"array","maxItems":4,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"effects":{"type":"array","maxItems":3,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"cameraAngles":{"type":"array","maxItems":1,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"brandKits":{"type":"array","maxItems":1,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}}},"description":"References picked from the References catalogue (`GET /references`, the built-ins by slug, your own by id, Library Elements as `library:<itemId>`, a brand kit by id): each adds a line to the prompt and, for models that take reference images, one image after your own `references` while the model has room."},"app":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$","description":"The Image Studio app that made the request, kept on the generation as `metadata.app` so its card can name it.","examples":["paparazzi"]},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"description":"Makes the request safe to retry: a second request with the same key in this workspace returns the generation the first one started, and starts nothing (nor charges again). That holds when the first one failed too, even if it couldn't be queued (`status: failed`, `failure.providerCode: not_queued`, its credits refunded): to try again, send a new key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Model id from `GET /models`.","examples":["google/nano-banana-pro"]},"source":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$","description":"Where the request comes from, kept on the generation as `metadata.source` (e.g. `tool:image`), so you can tell your own surfaces apart.","examples":["tool:image"]},"thumbnail":{"type":"object","properties":{"assets":{"type":"array","maxItems":8,"items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":80},"role":{"enum":["subject","product","layout","lighting","typography"],"type":"string"}},"required":["key","role"]},"default":[]},"audience":{"type":"string","minLength":1,"maxLength":300},"concepts":{"type":"integer","minimum":1,"maximum":3,"default":2},"evidence":{"type":"string","minLength":1,"maxLength":1000},"format":{"type":"object","properties":{"height":{"type":"integer","minimum":256,"maximum":4096,"examples":[1280]},"id":{"enum":["youtube","youtube-2k","vertical-cover","instagram-portrait","instagram-square","story","link-post","x-post","linkedin-post","pinterest-pin","podcast-cover","stream","custom"],"type":"string"},"width":{"type":"integer","minimum":256,"maximum":4096,"examples":[1024]}},"required":["id"],"description":"A platform preset, or `custom` with a width and height (256–4096 px).","default":{"id":"youtube"}},"headline":{"type":"string","minLength":1,"maxLength":60},"job":{"enum":["device-review","product-comparison","gadget-build","science-curiosity","illustrated-science","math-intuition","experiment","engineering","investigation","business","podcast-episode","interview-clip","gaming","sports","lifestyle","entertainment"],"type":"string"},"layout":{"enum":["auto","collage"],"type":"string","default":"auto","description":"`collage` builds the thumbnail out of the supplied frames and photos (with fewer than two it's `auto`); `auto` lets the art director choose."},"notes":{"type":"string","minLength":1,"maxLength":2000},"promise":{"type":"string","minLength":1,"maxLength":500},"recipe":{"enum":["product-review-mkbhd","minimal-hardware-dave2d","product-comparison-mrwhosetheboss-mkbhd","gadget-curiosity-and-practical-builds","science-curiosity-veritasium","illustrated-science-kurzgesagt","math-and-diagrams-3blue1brown","experiment-spectacle-mark-rober","engineering-explainers-real-engineering","investigative-documentary-fern","editorial-business-and-geopolitics-bloomberg-originals","full-podcast-episode-three-distinct-choices","interview-clip-q-a-and-social-conversation","gaming-mechanics-progression-and-series-identity","sports-and-competitive-matchups","food-and-taste-tests","travel-luxury-and-experience","transformations-tutorials-and-practical-outcomes","horror-and-suspense","film-anime-and-story-commentary","meme-surreal-and-reaction-entertainment"],"type":"string"},"references":{"type":"array","maxItems":3,"items":{"type":"object","properties":{"id":{"type":"string","pattern":"^ref-\\d{4}$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"role":{"enum":["layout","lighting","typography"],"type":"string"}},"required":["id","role"]},"default":[]},"subject":{"type":"string","minLength":1,"maxLength":200},"textMode":{"enum":["auto","custom","none"],"type":"string","default":"auto","description":"`auto`: the art director writes a 2–4 word hook (with `headline` as a hint when given); `custom`: `headline` exactly; `none`: no text."},"title":{"type":"string","minLength":1,"maxLength":200,"examples":["Autumn campaign"]},"tone":{"type":"string","minLength":1,"maxLength":120},"variants":{"type":"integer","minimum":1,"maximum":4,"default":1},"videoFormat":{"enum":["review","experiment","explanation","episode","clip","documentary","tutorial","challenge","other"],"type":"string"},"concept":{"type":"object","properties":{"id":{"type":"string","maxLength":40,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string","maxLength":60},"mechanism":{"enum":["object-first","comparison","outcome"],"type":"string"},"recipe":{"enum":["product-review-mkbhd","minimal-hardware-dave2d","product-comparison-mrwhosetheboss-mkbhd","gadget-curiosity-and-practical-builds","science-curiosity-veritasium","illustrated-science-kurzgesagt","math-and-diagrams-3blue1brown","experiment-spectacle-mark-rober","engineering-explainers-real-engineering","investigative-documentary-fern","editorial-business-and-geopolitics-bloomberg-originals","full-podcast-episode-three-distinct-choices","interview-clip-q-a-and-social-conversation","gaming-mechanics-progression-and-series-identity","sports-and-competitive-matchups","food-and-taste-tests","travel-luxury-and-experience","transformations-tutorials-and-practical-outcomes","horror-and-suspense","film-anime-and-story-commentary","meme-surreal-and-reaction-entertainment"],"type":"string"},"references":{"type":"array","maxItems":3,"items":{"type":"object","properties":{"id":{"type":"string","pattern":"^ref-\\d{4}$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"role":{"enum":["layout","lighting","typography"],"type":"string"}},"required":["id","role"]},"default":[]}},"required":["id","mechanism","recipe"]},"subjectBox":{"type":"object","properties":{"h":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"w":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"x":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"y":{"type":"number","minimum":0,"maximum":1,"examples":[1]}},"required":["h","w","x","y"]}},"required":["promise"],"description":"Thumbnail Studio's brief, kept as `metadata.thumbnail`; with it, a finished image also gets an `export` output at the format's exact size."},"visibility":{"enum":["private","public"],"type":"string","description":"`private` (the default): your workspace only. `public`: also in Community, for every Remagica user, once it completes. Needs a signed-in person (not an API key)."}},"required":["prompt","model"],"description":"An image request."}}}},"responses":{"202":{"description":"Accepted: the generation is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"generations:submit"}},"/generations/music":{"post":{"operationId":"createMusicGeneration","summary":"Generate music","description":"Starts generating a song or instrumental from a description. Pick the model from `GET /models`; the request is validated against what that model accepts, and files are referenced by storage key (an upload's `key` or an earlier generation's output `key`).\n\nMention Library items in the prompt with their `mention` token (`[@ id=\"lib:<itemId>\" label=\"ninja\"]`, or `lib:<itemId>@v2` for a version): their files are added after your references, the prompt points at them, and their locked descriptions are added. Point at references yourself as `@Image1`, `@Video1`, `@Audio1` (the n-th of that kind); each provider gets its own syntax.\n\nThe response is `202 Accepted` with the generation. Poll `GET /generations/{generationId}` until `status` is `completed` (then `outputs` holds the files) or `failed`.\n\nRequires scope `generations:submit`.","tags":["Generations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"durationSeconds":{"type":"integer","minimum":3,"maximum":600,"examples":[5]},"instrumental":{"type":"boolean","default":false},"lyrics":{"type":"string","minLength":1,"maxLength":5000,"description":"Words to sing, with section tags such as `[verse]` and `[chorus]` on their own lines. Models without `capabilities.lyrics` write their own."},"negativePrompt":{"type":"string","maxLength":2000,"description":"What to keep out of the music. Only models whose `params` list it (Lyria)."},"prompt":{"type":"string","minLength":1,"maxLength":20000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"description":"Makes the request safe to retry: a second request with the same key in this workspace returns the generation the first one started, and starts nothing (nor charges again). That holds when the first one failed too, even if it couldn't be queued (`status: failed`, `failure.providerCode: not_queued`, its credits refunded): to try again, send a new key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Music model id from `GET /models`.","examples":["elevenlabs/music-v2.5"]},"source":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$","description":"Where the request comes from, kept on the generation as `metadata.source` (e.g. `tool:image`), so you can tell your own surfaces apart.","examples":["tool:image"]}},"required":["prompt","model"],"description":"A music request."}}}},"responses":{"202":{"description":"Accepted: the generation is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"generations:submit"}},"/generations/sound-effects":{"post":{"operationId":"createSoundEffectGeneration","summary":"Generate a sound effect","description":"Starts generating a sound effect from a description. Pick the model from `GET /models`; the request is validated against what that model accepts, and files are referenced by storage key (an upload's `key` or an earlier generation's output `key`).\n\nMention Library items in the prompt with their `mention` token (`[@ id=\"lib:<itemId>\" label=\"ninja\"]`, or `lib:<itemId>@v2` for a version): their files are added after your references, the prompt points at them, and their locked descriptions are added. Point at references yourself as `@Image1`, `@Video1`, `@Audio1` (the n-th of that kind); each provider gets its own syntax.\n\nThe response is `202 Accepted` with the generation. Poll `GET /generations/{generationId}` until `status` is `completed` (then `outputs` holds the files) or `failed`.\n\nRequires scope `generations:submit`.","tags":["Generations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"durationSeconds":{"type":"number","minimum":0.5,"maximum":22,"description":"Length in seconds. Left out, the model picks one.","examples":[5]},"loop":{"type":"boolean","default":false},"prompt":{"type":"string","minLength":1,"maxLength":20000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"promptInfluence":{"type":"number","minimum":0,"maximum":1,"description":"How literally to follow the prompt (0-1). Only models whose `params` list it.","examples":[1]},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"description":"Makes the request safe to retry: a second request with the same key in this workspace returns the generation the first one started, and starts nothing (nor charges again). That holds when the first one failed too, even if it couldn't be queued (`status: failed`, `failure.providerCode: not_queued`, its credits refunded): to try again, send a new key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Sound effect model id from `GET /models`.","examples":["elevenlabs/sound-effects-v2"]},"source":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$","description":"Where the request comes from, kept on the generation as `metadata.source` (e.g. `tool:image`), so you can tell your own surfaces apart.","examples":["tool:image"]}},"required":["prompt","model"],"description":"A sound effect request."}}}},"responses":{"202":{"description":"Accepted: the generation is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"generations:submit"}},"/generations/speech":{"post":{"operationId":"createSpeechGeneration","summary":"Generate speech","description":"Starts generating speech from text, with word timings in `metadata.timestamps`. Pick the model from `GET /models`; the request is validated against what that model accepts, and files are referenced by storage key (an upload's `key` or an earlier generation's output `key`).\n\nMention Library items in the prompt with their `mention` token (`[@ id=\"lib:<itemId>\" label=\"ninja\"]`, or `lib:<itemId>@v2` for a version): their files are added after your references, the prompt points at them, and their locked descriptions are added. Point at references yourself as `@Image1`, `@Video1`, `@Audio1` (the n-th of that kind); each provider gets its own syntax.\n\nThe response is `202 Accepted` with the generation. Poll `GET /generations/{generationId}` until `status` is `completed` (then `outputs` holds the files) or `failed`.\n\nRequires scope `generations:submit`.","tags":["Generations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"languageCode":{"type":"string","pattern":"^[a-z]{2,3}$","description":"ISO 639-1 language code, e.g. `en`."},"nextText":{"type":"string","maxLength":2000,"description":"The words read right after this clip, for continuity (not spoken). Only models whose `params` list it."},"previousText":{"type":"string","maxLength":2000,"description":"The words read right before this clip, for continuity (not spoken). Only models whose `params` list it."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Best-effort repeatable reads. Only models with `capabilities.seed`.","examples":[1]},"similarityBoost":{"type":"number","minimum":0,"maximum":1,"description":"How closely to keep to the voice (0-1). Only models whose `params` list it.","examples":[1]},"speakers":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40,"description":"What the speaker's lines start with: `Host:`.","examples":["Autumn campaign"]},"voice":{"type":"string","minLength":1,"maxLength":200}},"required":["name","voice"]},"description":"A two-voice dialogue (models with `capabilities.maxSpeakers` 2, Gemini): each line of `text` starts with a speaker's name, `Host: Welcome back.`; lines without one continue the last speaker. Replaces `voice`."},"speed":{"type":"number","minimum":0.7,"maximum":1.2,"description":"Reading speed (0.7-1.2, 1 normal). Only models whose `params` list it.","examples":[1]},"stability":{"type":"number","minimum":0,"maximum":1,"description":"ElevenLabs only. Voice stability (0-1); lower is more expressive and follows audio tags more. Eleven v3's settings: 0 Creative, 0.5 Natural, 1 Robust.","examples":[1]},"style":{"type":"string","maxLength":120,"description":"Delivery direction, e.g. `excited` or `calm and warm`. ElevenLabs gets it as an audio tag opening each paragraph; Gemini as its style instructions."},"styleExaggeration":{"type":"number","minimum":0,"maximum":1,"description":"Exaggerates the voice's own style (0-1, default 0). Only models whose `params` list it.","examples":[1]},"text":{"type":"string","minLength":1,"maxLength":5000,"description":"The words to say. ElevenLabs audio tags such as `[laughs]` or `[whispers]` may go inline; on Gemini, `[laughs]` and `[sighs]` become its vocal events and other tags are dropped."},"textNormalization":{"enum":["auto","on","off"],"type":"string","description":"Spell out numbers, dates and units. Only models whose `params` list it."},"voice":{"type":"string","minLength":1,"maxLength":200,"description":"A voice the model lists (`capabilities.voices`; the model's `defaultVoice` when unset), or an ElevenLabs voice id on ElevenLabs models."},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"description":"Makes the request safe to retry: a second request with the same key in this workspace returns the generation the first one started, and starts nothing (nor charges again). That holds when the first one failed too, even if it couldn't be queued (`status: failed`, `failure.providerCode: not_queued`, its credits refunded): to try again, send a new key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Speech model id from `GET /models`.","examples":["elevenlabs/eleven-v3"]},"source":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$","description":"Where the request comes from, kept on the generation as `metadata.source` (e.g. `tool:image`), so you can tell your own surfaces apart.","examples":["tool:image"]}},"required":["text","model"],"description":"A text-to-speech request."}}}},"responses":{"202":{"description":"Accepted: the generation is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"generations:submit"}},"/generations/videos":{"post":{"operationId":"createVideoGeneration","summary":"Generate a video","description":"Starts generating a video from a prompt, a first (and last) frame, or reference images, videos and audio. Pick the model from `GET /models`; the request is validated against what that model accepts, and files are referenced by storage key (an upload's `key` or an earlier generation's output `key`).\n\nMention Library items in the prompt with their `mention` token (`[@ id=\"lib:<itemId>\" label=\"ninja\"]`, or `lib:<itemId>@v2` for a version): their files are added after your references, the prompt points at them, and their locked descriptions are added. Point at references yourself as `@Image1`, `@Video1`, `@Audio1` (the n-th of that kind); each provider gets its own syntax.\n\nThe response is `202 Accepted` with the generation. Poll `GET /generations/{generationId}` until `status` is `completed` (then `outputs` holds the files) or `failed`.\n\nRequires scope `generations:submit`.","tags":["Generations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"aspectRatio":{"enum":["auto","21:9","16:9","4:3","1:1","3:4","9:16"],"type":"string","description":"Output aspect ratio. `auto` lets the model decide; some models always keep the first frame's."},"cfgScale":{"type":"number","minimum":0,"maximum":1,"description":"How closely to follow the prompt (0-1). Only models with `capabilities.cfgScale` take it (Kling).","examples":[1]},"draft":{"type":"boolean","description":"Make a cheap 480p draft to preview the shot, billed as a normal 480p video. Render the final from it with `fromDraft`. Only models with `capabilities.draft` take it (Seedance 2.5)."},"duration":{"anyOf":[{"type":"integer","minimum":1,"maximum":60,"examples":[5]},{"const":"auto"}],"description":"Length in seconds, or `auto` to let the model choose."},"firstFrame":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"A file in your storage."},{"type":"object","properties":{"asset":{"type":"string","format":"uuid","description":"Id of a character from `GET /characters`."}},"required":["asset"],"description":"A registered character."}]},"fromDraft":{"type":"object","properties":{"generation":{"type":"string","minLength":1,"maxLength":128,"description":"Id of a completed draft generation of the same model."}},"required":["generation"],"description":"Render the final video of a draft (at `capabilities.draft.finalResolution`): the draft's prompt, files, length, ratio and sound are reused as they were, and the final is billed in full on its own. Drafts can be rendered for 7 days."},"generateAudio":{"type":"boolean","default":true,"description":"Generate sound (voices, effects, music) with the video. Off gives a silent video."},"lastFrame":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"A file in your storage."},{"type":"object","properties":{"asset":{"type":"string","format":"uuid","description":"Id of a character from `GET /characters`."}},"required":["asset"],"description":"A registered character."}]},"mode":{"enum":["text","first_frame","first_last_frame","reference"],"type":"string","default":"text","description":"`text`: prompt only. `first_frame`: animate `firstFrame`. `first_last_frame`: go from `firstFrame` to `lastFrame`. `reference`: use `referenceImages`, `referenceVideos` and `referenceAudios` as references."},"negativePrompt":{"type":"string","maxLength":2000,"description":"What to keep out of the video. Only models with `capabilities.negativePrompt` take it (Kling, Veo)."},"prompt":{"type":"string","minLength":1,"maxLength":20000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"promptExpansionMode":{"enum":["disabled","balanced","quality"],"type":"string","description":"How much the model rewrites the prompt first: `disabled`, `balanced` (about a second) or `quality` (up to ~30 s). Only models whose `params` list it (H3 Max)."},"referenceAudios":{"type":"array","maxItems":30,"items":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"A file in your storage."},{"type":"object","properties":{"asset":{"type":"string","format":"uuid","description":"Id of a character from `GET /characters`."}},"required":["asset"],"description":"A registered character."}]},"default":[]},"referenceImages":{"type":"array","maxItems":30,"items":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"A file in your storage."},{"type":"object","properties":{"asset":{"type":"string","format":"uuid","description":"Id of a character from `GET /characters`."}},"required":["asset"],"description":"A registered character."}]},"default":[]},"referenceRoles":{"type":"array","maxItems":90,"items":{"type":"object","properties":{"frame":{"enum":["first","last"],"type":"string","description":"This image is the video's first or last frame (Seedance takes frames among references this way)."},"kind":{"enum":["image","video","audio"],"type":"string"},"n":{"type":"integer","minimum":1,"maximum":30,"examples":[1]},"name":{"type":"string","maxLength":80,"description":"What the file is, e.g. `Mara's identity sheet`.","examples":["Autumn campaign"]},"role":{"type":"string","maxLength":200,"description":"What to take from it and what not, e.g. `face and outfit only; do not copy the pose`."}},"required":["kind","n"]},"description":"A name and role for reference files, by kind and number. Models whose `capabilities.referenceRoles` is set (Seedance) get them as a 【Reference Asset Roles】 block at the top of the prompt, unless the prompt has one of its own."},"referenceVideos":{"type":"array","maxItems":30,"items":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"A file in your storage."},{"type":"object","properties":{"asset":{"type":"string","format":"uuid","description":"Id of a character from `GET /characters`."}},"required":["asset"],"description":"A registered character."}]},"default":[]},"resolution":{"enum":["480p","720p","768p","1080p","4k"],"type":"string"},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"examples":[1]},"shots":{"type":"array","minItems":2,"maxItems":6,"items":{"type":"object","properties":{"duration":{"type":"integer","minimum":1,"maximum":15,"description":"The shot's length in seconds.","examples":[5]},"prompt":{"type":"string","minLength":1,"maxLength":2500,"examples":["A lighthouse on a cliff at dusk, cinematic"]}},"required":["duration","prompt"]},"description":"Multi-shot: the video as shots, each with its prompt and length (adding up to `duration`). Only models with `capabilities.multiShot` take it; `prompt` then describes the whole."},"shotType":{"enum":["customize","intelligent"],"type":"string","description":"`intelligent`: the model plans its own shots. Only models whose `params` list it (Kling)."},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"description":"Makes the request safe to retry: a second request with the same key in this workspace returns the generation the first one started, and starts nothing (nor charges again). That holds when the first one failed too, even if it couldn't be queued (`status: failed`, `failure.providerCode: not_queued`, its credits refunded): to try again, send a new key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Video model id from `GET /models`.","examples":["bytedance/seedance-2.0"]},"source":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$","description":"Where the request comes from, kept on the generation as `metadata.source` (e.g. `tool:image`), so you can tell your own surfaces apart.","examples":["tool:image"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private` (the default): your workspace only. `public`: also in Community, for every Remagica user, once it completes. Needs a signed-in person (not an API key)."}},"required":["prompt","model"],"description":"A video request."}}}},"responses":{"202":{"description":"Accepted: the generation is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"generations:submit"}},"/generations/estimate":{"post":{"operationId":"estimateGeneration","summary":"Estimate a generation's cost","description":"What a generation would cost, in credits, if you sent it now: send the body you'd send to `POST /generations/images` (or `/videos`, `/music`, `/speech`, `/sound-effects`, `/background-removals`) with `kind` saying which. It's priced exactly as that request is charged, from today's price book, and validated against the model the same way. Nothing is started or charged.\n\nRequires scope `models:list`.","tags":["Generations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"aspectRatio":{"enum":["auto","21:9","16:9","3:2","4:3","5:4","1:1","4:5","3:4","2:3","9:16"],"type":"string","description":"Output aspect ratio. `auto` lets the model decide (with references, usually the first reference's)."},"background":{"enum":["auto","transparent","opaque"],"type":"string","description":"`transparent` for a cut-out PNG. Only models whose `params` list it (GPT Image 2)."},"count":{"type":"integer","minimum":1,"maximum":4,"default":1,"description":"How many images to make."},"imageSearch":{"type":"boolean","description":"Let the model look up pictures on Google Image Search. Only models whose `params` list it (Nano Banana 2)."},"prompt":{"type":"string","minLength":1,"maxLength":20000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"promptExpansion":{"type":"boolean","description":"Let the model expand the prompt itself (FLUX, Ideogram's Magic Prompt). Only models whose `params` list it."},"quality":{"enum":["auto","low","medium","high","xhigh","max"],"type":"string","description":"Rendering quality. Only models whose `params` list it."},"references":{"type":"array","maxItems":30,"items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["subject","product","layout","lighting","typography"],"type":"string","description":"What this reference is for: `subject` (a face or person), `product`, `layout`, `lighting` or `typography`. Recorded with the generation."}},"required":["key"],"description":"A reference image in your storage."},"default":[],"description":"Reference images. With any, the model edits or composes from them."},"resolution":{"enum":["1K","2K","4K"],"type":"string"},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"examples":[1]},"thinkingLevel":{"enum":["minimal","medium","high"],"type":"string","description":"Let the model think before drawing. Only models whose `params` list it (Nano Banana 2)."},"webSearch":{"type":"boolean","description":"Let the model search the web for current facts. Only models whose `params` list it (Nano Banana)."},"activeReferences":{"type":"object","properties":{"styles":{"type":"array","maxItems":1,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"colorPalettes":{"type":"array","maxItems":1,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"characters":{"type":"array","maxItems":3,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"elements":{"type":"array","maxItems":4,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"effects":{"type":"array","maxItems":3,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"cameraAngles":{"type":"array","maxItems":1,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}},"brandKits":{"type":"array","maxItems":1,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["id"]}}},"description":"References picked from the References catalogue (`GET /references`, the built-ins by slug, your own by id, Library Elements as `library:<itemId>`, a brand kit by id): each adds a line to the prompt and, for models that take reference images, one image after your own `references` while the model has room."},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Model id from `GET /models`.","examples":["google/nano-banana-pro"]},"thumbnail":{"type":"object","properties":{"assets":{"type":"array","maxItems":8,"items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":80},"role":{"enum":["subject","product","layout","lighting","typography"],"type":"string"}},"required":["key","role"]},"default":[]},"audience":{"type":"string","minLength":1,"maxLength":300},"concepts":{"type":"integer","minimum":1,"maximum":3,"default":2},"evidence":{"type":"string","minLength":1,"maxLength":1000},"format":{"type":"object","properties":{"height":{"type":"integer","minimum":256,"maximum":4096,"examples":[1280]},"id":{"enum":["youtube","youtube-2k","vertical-cover","instagram-portrait","instagram-square","story","link-post","x-post","linkedin-post","pinterest-pin","podcast-cover","stream","custom"],"type":"string"},"width":{"type":"integer","minimum":256,"maximum":4096,"examples":[1024]}},"required":["id"],"description":"A platform preset, or `custom` with a width and height (256–4096 px).","default":{"id":"youtube"}},"headline":{"type":"string","minLength":1,"maxLength":60},"job":{"enum":["device-review","product-comparison","gadget-build","science-curiosity","illustrated-science","math-intuition","experiment","engineering","investigation","business","podcast-episode","interview-clip","gaming","sports","lifestyle","entertainment"],"type":"string"},"layout":{"enum":["auto","collage"],"type":"string","default":"auto","description":"`collage` builds the thumbnail out of the supplied frames and photos (with fewer than two it's `auto`); `auto` lets the art director choose."},"notes":{"type":"string","minLength":1,"maxLength":2000},"promise":{"type":"string","minLength":1,"maxLength":500},"recipe":{"enum":["product-review-mkbhd","minimal-hardware-dave2d","product-comparison-mrwhosetheboss-mkbhd","gadget-curiosity-and-practical-builds","science-curiosity-veritasium","illustrated-science-kurzgesagt","math-and-diagrams-3blue1brown","experiment-spectacle-mark-rober","engineering-explainers-real-engineering","investigative-documentary-fern","editorial-business-and-geopolitics-bloomberg-originals","full-podcast-episode-three-distinct-choices","interview-clip-q-a-and-social-conversation","gaming-mechanics-progression-and-series-identity","sports-and-competitive-matchups","food-and-taste-tests","travel-luxury-and-experience","transformations-tutorials-and-practical-outcomes","horror-and-suspense","film-anime-and-story-commentary","meme-surreal-and-reaction-entertainment"],"type":"string"},"references":{"type":"array","maxItems":3,"items":{"type":"object","properties":{"id":{"type":"string","pattern":"^ref-\\d{4}$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"role":{"enum":["layout","lighting","typography"],"type":"string"}},"required":["id","role"]},"default":[]},"subject":{"type":"string","minLength":1,"maxLength":200},"textMode":{"enum":["auto","custom","none"],"type":"string","default":"auto","description":"`auto`: the art director writes a 2–4 word hook (with `headline` as a hint when given); `custom`: `headline` exactly; `none`: no text."},"title":{"type":"string","minLength":1,"maxLength":200,"examples":["Autumn campaign"]},"tone":{"type":"string","minLength":1,"maxLength":120},"variants":{"type":"integer","minimum":1,"maximum":4,"default":1},"videoFormat":{"enum":["review","experiment","explanation","episode","clip","documentary","tutorial","challenge","other"],"type":"string"},"concept":{"type":"object","properties":{"id":{"type":"string","maxLength":40,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string","maxLength":60},"mechanism":{"enum":["object-first","comparison","outcome"],"type":"string"},"recipe":{"enum":["product-review-mkbhd","minimal-hardware-dave2d","product-comparison-mrwhosetheboss-mkbhd","gadget-curiosity-and-practical-builds","science-curiosity-veritasium","illustrated-science-kurzgesagt","math-and-diagrams-3blue1brown","experiment-spectacle-mark-rober","engineering-explainers-real-engineering","investigative-documentary-fern","editorial-business-and-geopolitics-bloomberg-originals","full-podcast-episode-three-distinct-choices","interview-clip-q-a-and-social-conversation","gaming-mechanics-progression-and-series-identity","sports-and-competitive-matchups","food-and-taste-tests","travel-luxury-and-experience","transformations-tutorials-and-practical-outcomes","horror-and-suspense","film-anime-and-story-commentary","meme-surreal-and-reaction-entertainment"],"type":"string"},"references":{"type":"array","maxItems":3,"items":{"type":"object","properties":{"id":{"type":"string","pattern":"^ref-\\d{4}$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"role":{"enum":["layout","lighting","typography"],"type":"string"}},"required":["id","role"]},"default":[]}},"required":["id","mechanism","recipe"]},"subjectBox":{"type":"object","properties":{"h":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"w":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"x":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"y":{"type":"number","minimum":0,"maximum":1,"examples":[1]}},"required":["h","w","x","y"]}},"required":["promise"],"description":"Thumbnail Studio's brief, kept as `metadata.thumbnail`; with it, a finished image also gets an `export` output at the format's exact size."},"visibility":{"enum":["private","public"],"type":"string","description":"`private` (the default): your workspace only. `public`: also in Community, for every Remagica user, once it completes. Needs a signed-in person (not an API key)."},"kind":{"const":"image"}},"required":["prompt","model","kind"],"description":"An image request."},{"type":"object","properties":{"aspectRatio":{"enum":["auto","21:9","16:9","4:3","1:1","3:4","9:16"],"type":"string","description":"Output aspect ratio. `auto` lets the model decide; some models always keep the first frame's."},"cfgScale":{"type":"number","minimum":0,"maximum":1,"description":"How closely to follow the prompt (0-1). Only models with `capabilities.cfgScale` take it (Kling).","examples":[1]},"draft":{"type":"boolean","description":"Make a cheap 480p draft to preview the shot, billed as a normal 480p video. Render the final from it with `fromDraft`. Only models with `capabilities.draft` take it (Seedance 2.5)."},"duration":{"anyOf":[{"type":"integer","minimum":1,"maximum":60,"examples":[5]},{"const":"auto"}],"description":"Length in seconds, or `auto` to let the model choose."},"firstFrame":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"A file in your storage."},{"type":"object","properties":{"asset":{"type":"string","format":"uuid","description":"Id of a character from `GET /characters`."}},"required":["asset"],"description":"A registered character."}]},"fromDraft":{"type":"object","properties":{"generation":{"type":"string","minLength":1,"maxLength":128,"description":"Id of a completed draft generation of the same model."}},"required":["generation"],"description":"Render the final video of a draft (at `capabilities.draft.finalResolution`): the draft's prompt, files, length, ratio and sound are reused as they were, and the final is billed in full on its own. Drafts can be rendered for 7 days."},"generateAudio":{"type":"boolean","default":true,"description":"Generate sound (voices, effects, music) with the video. Off gives a silent video."},"lastFrame":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"A file in your storage."},{"type":"object","properties":{"asset":{"type":"string","format":"uuid","description":"Id of a character from `GET /characters`."}},"required":["asset"],"description":"A registered character."}]},"mode":{"enum":["text","first_frame","first_last_frame","reference"],"type":"string","default":"text","description":"`text`: prompt only. `first_frame`: animate `firstFrame`. `first_last_frame`: go from `firstFrame` to `lastFrame`. `reference`: use `referenceImages`, `referenceVideos` and `referenceAudios` as references."},"negativePrompt":{"type":"string","maxLength":2000,"description":"What to keep out of the video. Only models with `capabilities.negativePrompt` take it (Kling, Veo)."},"prompt":{"type":"string","minLength":1,"maxLength":20000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"promptExpansionMode":{"enum":["disabled","balanced","quality"],"type":"string","description":"How much the model rewrites the prompt first: `disabled`, `balanced` (about a second) or `quality` (up to ~30 s). Only models whose `params` list it (H3 Max)."},"referenceAudios":{"type":"array","maxItems":30,"items":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"A file in your storage."},{"type":"object","properties":{"asset":{"type":"string","format":"uuid","description":"Id of a character from `GET /characters`."}},"required":["asset"],"description":"A registered character."}]},"default":[]},"referenceImages":{"type":"array","maxItems":30,"items":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"A file in your storage."},{"type":"object","properties":{"asset":{"type":"string","format":"uuid","description":"Id of a character from `GET /characters`."}},"required":["asset"],"description":"A registered character."}]},"default":[]},"referenceRoles":{"type":"array","maxItems":90,"items":{"type":"object","properties":{"frame":{"enum":["first","last"],"type":"string","description":"This image is the video's first or last frame (Seedance takes frames among references this way)."},"kind":{"enum":["image","video","audio"],"type":"string"},"n":{"type":"integer","minimum":1,"maximum":30,"examples":[1]},"name":{"type":"string","maxLength":80,"description":"What the file is, e.g. `Mara's identity sheet`.","examples":["Autumn campaign"]},"role":{"type":"string","maxLength":200,"description":"What to take from it and what not, e.g. `face and outfit only; do not copy the pose`."}},"required":["kind","n"]},"description":"A name and role for reference files, by kind and number. Models whose `capabilities.referenceRoles` is set (Seedance) get them as a 【Reference Asset Roles】 block at the top of the prompt, unless the prompt has one of its own."},"referenceVideos":{"type":"array","maxItems":30,"items":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"A file in your storage."},{"type":"object","properties":{"asset":{"type":"string","format":"uuid","description":"Id of a character from `GET /characters`."}},"required":["asset"],"description":"A registered character."}]},"default":[]},"resolution":{"enum":["480p","720p","768p","1080p","4k"],"type":"string"},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"examples":[1]},"shots":{"type":"array","minItems":2,"maxItems":6,"items":{"type":"object","properties":{"duration":{"type":"integer","minimum":1,"maximum":15,"description":"The shot's length in seconds.","examples":[5]},"prompt":{"type":"string","minLength":1,"maxLength":2500,"examples":["A lighthouse on a cliff at dusk, cinematic"]}},"required":["duration","prompt"]},"description":"Multi-shot: the video as shots, each with its prompt and length (adding up to `duration`). Only models with `capabilities.multiShot` take it; `prompt` then describes the whole."},"shotType":{"enum":["customize","intelligent"],"type":"string","description":"`intelligent`: the model plans its own shots. Only models whose `params` list it (Kling)."},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Video model id from `GET /models`.","examples":["bytedance/seedance-2.0"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private` (the default): your workspace only. `public`: also in Community, for every Remagica user, once it completes. Needs a signed-in person (not an API key)."},"kind":{"const":"video"}},"required":["prompt","model","kind"],"description":"A video request."},{"type":"object","properties":{"durationSeconds":{"type":"integer","minimum":3,"maximum":600,"examples":[5]},"instrumental":{"type":"boolean","default":false},"lyrics":{"type":"string","minLength":1,"maxLength":5000,"description":"Words to sing, with section tags such as `[verse]` and `[chorus]` on their own lines. Models without `capabilities.lyrics` write their own."},"negativePrompt":{"type":"string","maxLength":2000,"description":"What to keep out of the music. Only models whose `params` list it (Lyria)."},"prompt":{"type":"string","minLength":1,"maxLength":20000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Music model id from `GET /models`.","examples":["elevenlabs/music-v2.5"]},"kind":{"const":"music"}},"required":["prompt","model","kind"],"description":"A music request."},{"type":"object","properties":{"languageCode":{"type":"string","pattern":"^[a-z]{2,3}$","description":"ISO 639-1 language code, e.g. `en`."},"nextText":{"type":"string","maxLength":2000,"description":"The words read right after this clip, for continuity (not spoken). Only models whose `params` list it."},"previousText":{"type":"string","maxLength":2000,"description":"The words read right before this clip, for continuity (not spoken). Only models whose `params` list it."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Best-effort repeatable reads. Only models with `capabilities.seed`.","examples":[1]},"similarityBoost":{"type":"number","minimum":0,"maximum":1,"description":"How closely to keep to the voice (0-1). Only models whose `params` list it.","examples":[1]},"speakers":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40,"description":"What the speaker's lines start with: `Host:`.","examples":["Autumn campaign"]},"voice":{"type":"string","minLength":1,"maxLength":200}},"required":["name","voice"]},"description":"A two-voice dialogue (models with `capabilities.maxSpeakers` 2, Gemini): each line of `text` starts with a speaker's name, `Host: Welcome back.`; lines without one continue the last speaker. Replaces `voice`."},"speed":{"type":"number","minimum":0.7,"maximum":1.2,"description":"Reading speed (0.7-1.2, 1 normal). Only models whose `params` list it.","examples":[1]},"stability":{"type":"number","minimum":0,"maximum":1,"description":"ElevenLabs only. Voice stability (0-1); lower is more expressive and follows audio tags more. Eleven v3's settings: 0 Creative, 0.5 Natural, 1 Robust.","examples":[1]},"style":{"type":"string","maxLength":120,"description":"Delivery direction, e.g. `excited` or `calm and warm`. ElevenLabs gets it as an audio tag opening each paragraph; Gemini as its style instructions."},"styleExaggeration":{"type":"number","minimum":0,"maximum":1,"description":"Exaggerates the voice's own style (0-1, default 0). Only models whose `params` list it.","examples":[1]},"text":{"type":"string","minLength":1,"maxLength":5000,"description":"The words to say. ElevenLabs audio tags such as `[laughs]` or `[whispers]` may go inline; on Gemini, `[laughs]` and `[sighs]` become its vocal events and other tags are dropped."},"textNormalization":{"enum":["auto","on","off"],"type":"string","description":"Spell out numbers, dates and units. Only models whose `params` list it."},"voice":{"type":"string","minLength":1,"maxLength":200,"description":"A voice the model lists (`capabilities.voices`; the model's `defaultVoice` when unset), or an ElevenLabs voice id on ElevenLabs models."},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Speech model id from `GET /models`.","examples":["elevenlabs/eleven-v3"]},"kind":{"const":"speech"}},"required":["text","model","kind"],"description":"A speech request."},{"type":"object","properties":{"durationSeconds":{"type":"number","minimum":0.5,"maximum":22,"description":"Length in seconds. Left out, the model picks one.","examples":[5]},"loop":{"type":"boolean","default":false},"prompt":{"type":"string","minLength":1,"maxLength":20000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"promptInfluence":{"type":"number","minimum":0,"maximum":1,"description":"How literally to follow the prompt (0-1). Only models whose `params` list it.","examples":[1]},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Sound effect model id from `GET /models`.","examples":["elevenlabs/sound-effects-v2"]},"kind":{"const":"sound-effect"}},"required":["prompt","model","kind"],"description":"A sound effect request."},{"type":"object","properties":{"image":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of the file: an upload's `key`, a generation output's `key`, or a thumbnail reference library `key` (`GET /thumbnail-references`).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"],"description":"The image to cut out: an upload's `key` or a generation output's `key`."},"from":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":64,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tool":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},"required":["generationId"],"description":"The generation this request carries on from (its file was sent here as a reference, frame or source), kept as `metadata.from` so the result can show what it was made from."},"model":{"type":"string","minLength":1,"maxLength":200,"description":"Background removal model id from `GET /models` (`kind: background_removal`).","examples":["bria/rmbg-2.0"]},"kind":{"const":"background-removal"}},"required":["image","model","kind"],"description":"A background removal request."}],"description":"The body you'd send to `POST /generations/{kind}`, with `kind` saying which: `image`, `video`, `music`, `speech`, `sound-effect` or `background-removal`."}}}},"responses":{"200":{"description":"What the request would cost.","content":{"application/json":{"schema":{"type":"object","properties":{"breakdown":{"type":"object","properties":{"meters":{"type":"array","items":{"type":"object","properties":{"credits":{"type":"number","minimum":0,"description":"What this part costs, in credits (fractional: the total is rounded up once).","examples":[12]},"rate":{"type":"string","description":"The price book rate it's priced at."},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The rate's tier (a resolution, say), or null for its only one."},"unit":{"type":"string","description":"What `units` counts (`image`, `second`, `request`, ...)."},"units":{"type":"number","minimum":0,"examples":[1]}},"required":["credits","rate","tier","unit","units"],"description":"One part of what a request costs."}},"model":{"type":"string","description":"The model it was priced for.","examples":["google/nano-banana-pro"]},"priceVersion":{"type":"integer","description":"The price book version it was priced with.","examples":[3]}},"required":["meters","model","priceVersion"]},"credits":{"type":"integer","minimum":0,"description":"Credits the request would be charged if it were sent now: exactly what `POST /generations/{kind}` sets aside.","examples":[12]}},"required":["breakdown","credits"],"description":"What a generation would cost."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"models:list"}},"/generations/{generationId}":{"get":{"operationId":"getGeneration","summary":"Get a generation","description":"Returns one of your generations. Poll every couple of seconds (images, audio) or every 10 seconds or so (video) while it is `queued` or `running`.\n\nRequires scope `generations:read`.","tags":["Generations"],"parameters":[{"name":"generationId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"The generation.","content":{"application/json":{"schema":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"generations:read"}},"/generations":{"get":{"operationId":"listGenerations","summary":"List generations","description":"Lists your workspace's generations, newest first, a page at a time: filter by kind, status, where they were requested from (`sources`, or leave some out with `excludeSources`) and whether you asked for them (`mine`). Each output carries the Library item it was filed as.\n\nRequires scope `generations:read`.","tags":["Generations"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","maxLength":500,"description":"`nextCursor` from the previous page."},"allowEmptyValue":true,"allowReserved":true},{"name":"excludeSources","in":"query","schema":{"anyOf":[{"type":"array","maxItems":20,"items":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},{"type":"string","pattern":"^([a-z0-9][a-z0-9:_-]{0,63})(,([a-z0-9][a-z0-9:_-]{0,63})){0,19}$"}],"description":"Leave out the ones requested with one of these `source`s (comma-separated, `metadata.source`), e.g. `tool:sprites`. Those with no `source` stay."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"kind","in":"query","schema":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"allowEmptyValue":true,"allowReserved":true},{"name":"kinds","in":"query","schema":{"anyOf":[{"type":"array","maxItems":100,"items":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string"}},{"type":"string","pattern":"^(image|video|speech|sound_effect|music|background_removal)(,(image|video|speech|sound_effect|music|background_removal)){0,99}$"}],"description":"Only these kinds (comma-separated), e.g. `speech,music,sound_effect`."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"How many to return, newest first (1-100)."},"allowEmptyValue":true,"allowReserved":true},{"name":"mine","in":"query","schema":{"anyOf":[{"type":"boolean"},{"enum":["true","false"],"type":"string"}],"description":"Only the ones you asked for (not teammates')."},"allowEmptyValue":true,"allowReserved":true},{"name":"sources","in":"query","schema":{"anyOf":[{"type":"array","maxItems":20,"items":{"type":"string","pattern":"^[a-z0-9][a-z0-9:_-]{0,63}$"}},{"type":"string","pattern":"^([a-z0-9][a-z0-9:_-]{0,63})(,([a-z0-9][a-z0-9:_-]{0,63})){0,19}$"}],"description":"Only the ones requested with one of these `source`s (comma-separated, `metadata.source`), e.g. `tool:thumbnail`."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"statuses","in":"query","schema":{"anyOf":[{"type":"array","maxItems":100,"items":{"enum":["queued","running","completed","failed","cancelled"],"type":"string"}},{"type":"string","pattern":"^(queued|running|completed|failed|cancelled)(,(queued|running|completed|failed|cancelled)){0,99}$"}],"description":"Only these statuses (comma-separated), e.g. `queued,running`."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"A page of generations.","content":{"application/json":{"schema":{"type":"object","properties":{"generations":{"type":"array","items":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]},"deleted":{"type":"boolean","description":"Filed in the Library and deleted there since (it's in Recently Deleted, or gone)."},"libraryItemId":{"anyOf":[{"type":"string","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The Library item it was filed as (favorite, move or delete it there); `null` until it's filed.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url","deleted","libraryItemId"]}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."},"libraryItemId":{"anyOf":[{"type":"string","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The Library item its first output was filed as; `null` until it's filed (completed generations are filed right after).","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt","libraryItemId"],"description":"A generation, with the Library items it was filed as."}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` for the next page; `null` on the last."}},"required":["generations","nextCursor"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"generations:read"}},"/capabilities":{"get":{"operationId":"listCapabilities","summary":"List capabilities","description":"Everything a workflow node can do (make an image, upscale a video, dub, relight, ...) with every model that does it: the node it backs, its default model, and per model the plans that may use it and what a run costs with default settings.","tags":["Generations"],"responses":{"200":{"description":"The capabilities.","content":{"application/json":{"schema":{"type":"object","properties":{"capabilities":{"type":"array","items":{"type":"object","properties":{"defaultModel":{"type":"string"},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"id":{"type":"string","examples":["upscale_image"]},"models":{"type":"array","items":{"type":"object","properties":{"allowedPlans":{"type":"array","items":{"enum":["free","creator","pro","studio","agency","enterprise"],"type":"string"},"description":"The plans that may use it."},"credits":{"type":"number","description":"What one run costs with default settings, in credits.","examples":[12]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"id":{"type":"string","examples":["bytedance/seedvr2"]},"name":{"type":"string","examples":["Autumn campaign"]},"pricing":{"type":"object","properties":{"by":{"type":"string"},"rates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number","examples":[1]},"examples":[{}]},"unit":{"type":"string"}},"required":["rates","unit"],"description":"Credits per unit (may be fractional; a run's total is rounded up); `by` names the setting picking the rate."},"unavailable":{"type":"string","description":"Why no provider can serve it, when none can."},"vendor":{"type":"string"}},"required":["allowedPlans","credits","description","id","name","vendor"]}},"name":{"type":"string","examples":["Upscale Image"]},"node":{"type":"string","description":"The workflow node type it backs.","examples":["upscale-image"]},"output":{"enum":["text","image","video","audio"],"type":"string"}},"required":["defaultModel","description","id","models","name","node","output"],"description":"Something a workflow node does (make an image, upscale a video, ...) and the models that do it."}}},"required":["capabilities"]}}}}}}},"/models":{"get":{"operationId":"listModels","summary":"List models","description":"Every model you can generate with: what it makes, what it accepts (`capabilities`) and what it costs (`pricing`). Models are named by what they are (e.g. `google/nano-banana-pro`); which provider serves them is ours to choose and may change without notice.\n\nRequires scope `models:list`.","tags":["Generations"],"responses":{"200":{"description":"The models.","content":{"application/json":{"schema":{"type":"object","properties":{"models":{"type":"array","items":{"type":"object","properties":{"available":{"type":"boolean","description":"A provider for it is configured, so requests can run right now."},"capabilities":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"What the model accepts: aspect ratios, resolutions, durations, reference limits, modes, ...","examples":[{"aspectRatios":["1:1","16:9","9:16"],"maxReferences":8}]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"id":{"type":"string","examples":["google/nano-banana-pro"]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"name":{"type":"string","examples":["Nano Banana Pro"]},"pricing":{"type":"object","properties":{"rates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number","examples":[1]},"description":"Credits per unit, by resolution (or `default` when it doesn't vary). A rate may be fractional; a request's total is rounded up to whole credits.","examples":[{}]},"unit":{"enum":["image","second","request","100_characters","200_characters","1000_characters","30_seconds"],"type":"string"}},"required":["rates","unit"],"description":"What a request costs in credits."},"vendor":{"type":"string","examples":["Google"]}},"required":["available","capabilities","description","id","kind","name","pricing","vendor"],"description":"A model you can generate with."}}},"required":["models"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"models:list"}},"/generations/events":{"get":{"operationId":"watchGenerations","summary":"Follow your generations","description":"Streams your generations as they change, as server-sent events: each one (as `GET /generations` lists it) when it's queued, starts, ends and is filed in the Library. Only yours, not teammates'; `kinds` narrows it further. Nothing is replayed: list your generations when you connect and again whenever you reconnect. The stream ends after 15 minutes; reconnect to keep following.\n\nRequires scope `generations:read`.","tags":["Generations"],"parameters":[{"name":"kinds","in":"query","schema":{"anyOf":[{"type":"array","maxItems":100,"items":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string"}},{"type":"string","pattern":"^(image|video|speech|sound_effect|music|background_removal)(,(image|video|speech|sound_effect|music|background_removal)){0,99}$"}],"description":"Only these kinds (comma-separated)."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"An event stream of your generations' changes.","content":{"text/event-stream":{"schema":{"oneOf":[{"type":"object","properties":{"event":{"const":"message"},"data":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]},"deleted":{"type":"boolean","description":"Filed in the Library and deleted there since (it's in Recently Deleted, or gone)."},"libraryItemId":{"anyOf":[{"type":"string","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The Library item it was filed as (favorite, move or delete it there); `null` until it's filed.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url","deleted","libraryItemId"]}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."},"libraryItemId":{"anyOf":[{"type":"string","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The Library item its first output was filed as; `null` until it's filed (completed generations are filed right after).","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt","libraryItemId"],"description":"A generation, with the Library items it was filed as."},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event","data"]},{"type":"object","properties":{"event":{"const":"done"},"data":{"type":"object","properties":{"reason":{"enum":["closed","timeout"],"type":"string"}},"required":["reason"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event","data"]},{"type":"object","properties":{"event":{"const":"error"},"data":{},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event"]}]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"generations:read"}},"/characters":{"post":{"operationId":"createCharacter","summary":"Register a character","description":"Registers a character the provider already holds (ModelArk: a preset digital character or an authorised real person), for one workspace or, with `shared`, for every workspace. Platform admins only.\n\nRequires scope `generations:submit`.","tags":["Generations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"enum":["image","video","audio"],"type":"string","description":"What the provider holds for the character: an `image`, a `video` or an `audio` (voice) reference. Put it in the matching video input."},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"organizationId":{"type":"string","minLength":1,"description":"Workspace that may use it; defaults to yours. Ignored when `shared`.","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"provider":{"enum":["modelark"],"type":"string","default":"modelark"},"providerAssetId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$","description":"The character's asset id, without `asset://` (from the digital character library or your authorised assets).","examples":["83763754-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"shared":{"type":"boolean","default":false}},"required":["kind","name","providerAssetId"]}}}},"responses":{"201":{"description":"The registered character.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","description":"Pass it as `{ asset: id }` in a video's frames or references.","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["image","video","audio"],"type":"string","description":"What the provider holds for the character: an `image`, a `video` or an `audio` (voice) reference. Put it in the matching video input."},"name":{"type":"string","examples":["Zac"]},"provider":{"type":"string","description":"Where it's held; only the models served there can use it (`modelark`: Seedance).","examples":["modelark"]},"shared":{"type":"boolean","description":"Available to every workspace (e.g. the provider's preset library) rather than only yours."}},"required":["createdAt","id","kind","name","provider","shared"],"description":"A character registered with a provider: a preset digital character, or a real person who verified and authorised their likeness. Seedance only accepts realistic people this way (or when ByteDance's own models made them)."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["This Idempotency-Key was already used with a different request"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}},"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help."}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"generations:submit"},"get":{"operationId":"listCharacters","summary":"List characters","description":"The characters your workspace can put in a video (`{ asset: id }` in its frames or references): its own and the shared ones.\n\nRequires scope `generations:read`.","tags":["Generations"],"responses":{"200":{"description":"The characters.","content":{"application/json":{"schema":{"type":"object","properties":{"characters":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","description":"Pass it as `{ asset: id }` in a video's frames or references.","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["image","video","audio"],"type":"string","description":"What the provider holds for the character: an `image`, a `video` or an `audio` (voice) reference. Put it in the matching video input."},"name":{"type":"string","examples":["Zac"]},"provider":{"type":"string","description":"Where it's held; only the models served there can use it (`modelark`: Seedance).","examples":["modelark"]},"shared":{"type":"boolean","description":"Available to every workspace (e.g. the provider's preset library) rather than only yours."}},"required":["createdAt","id","kind","name","provider","shared"],"description":"A character registered with a provider: a preset digital character, or a real person who verified and authorised their likeness. Seedance only accepts realistic people this way (or when ByteDance's own models made them)."}}},"required":["characters"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"generations:read"}},"/library/folders":{"post":{"operationId":"createLibraryFolder","summary":"Create a folder","description":"Adds a folder to the Team or your Private Library, optionally inside another folder of the same scope.\n\nRequires scope `library:write`.","tags":["Library"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`.","default":"other"},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"parentId":{"type":"string","minLength":1,"maxLength":128,"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only.","default":"team"}},"required":["name"]}}}},"responses":{"201":{"description":"The folder.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"isDefault":{"type":"boolean","description":"One of the starting folders (can't be deleted)."},"itemCount":{"type":"integer","examples":[1]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"name":{"type":"string","examples":["Autumn campaign"]},"parentId":{"anyOf":[{"type":"string","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"sort":{"type":"integer","examples":[1]}},"required":["id","isDefault","itemCount","kind","name","parentId","scope","sort"],"description":"A Library folder."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"},"get":{"operationId":"listLibraryFolders","summary":"List folders","description":"The folders of the Team or your Private Library, with how many items each holds. Every Library starts with Character, Scene, Item, Style, Sound Effect and Others.\n\nRequires scope `library:read`.","tags":["Library"],"parameters":[{"name":"scope","in":"query","schema":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only.","default":"team"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The folders, in order.","content":{"application/json":{"schema":{"type":"object","properties":{"folders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"isDefault":{"type":"boolean","description":"One of the starting folders (can't be deleted)."},"itemCount":{"type":"integer","examples":[1]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"name":{"type":"string","examples":["Autumn campaign"]},"parentId":{"anyOf":[{"type":"string","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"sort":{"type":"integer","examples":[1]}},"required":["id","isDefault","itemCount","kind","name","parentId","scope","sort"],"description":"A Library folder."}}},"required":["folders"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:read"}},"/library/folders/{folderId}":{"delete":{"operationId":"deleteLibraryFolder","summary":"Delete a folder","description":"Deletes a folder you added. Its items move to the starting folder of its kind; the starting folders can't be deleted.\n\nRequires scope `library:delete`.","tags":["Library"],"parameters":[{"name":"folderId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:delete"},"patch":{"operationId":"updateLibraryFolder","summary":"Update a folder","description":"Renames or reorders a folder.\n\nRequires scope `library:write`.","tags":["Library"],"parameters":[{"name":"folderId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"sort":{"type":"integer","minimum":0,"maximum":10000,"examples":[1]}}}}}},"responses":{"200":{"description":"The folder.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"isDefault":{"type":"boolean","description":"One of the starting folders (can't be deleted)."},"itemCount":{"type":"integer","examples":[1]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"name":{"type":"string","examples":["Autumn campaign"]},"parentId":{"anyOf":[{"type":"string","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"sort":{"type":"integer","examples":[1]}},"required":["id","isDefault","itemCount","kind","name","parentId","scope","sort"],"description":"A Library folder."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"}},"/library/items/{itemId}/versions":{"post":{"operationId":"addLibraryVersion","summary":"Add a version","description":"Saves a new version of an item (a changed description, references, sheet or voice) and makes it current. Versions never change, so canvases pinned to an older one keep it until they're updated. `basedOn` alone makes an older version (an older sheet) the default again.\n\nRequires scope `library:write`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"basedOn":{"type":"integer","minimum":1,"description":"Start from this version instead of the current one: sending only `basedOn` makes an old version (an older sheet) the default again, as a new version.","examples":[1]},"characterId":{"anyOf":[{"type":"string","format":"uuid","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"description":{"type":"string","maxLength":4000,"description":"The locked description: added to every prompt that mentions the item, verbatim.","examples":["A masked ninja in a red hooded jacket, amber eyes, lean build, twin short swords on the back."]},"files":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"durationSeconds":{"type":"number","maximum":86400,"exclusiveMinimum":0,"description":"Length of a video or audio file, if you know it (checked against models' combined reference limits).","examples":[5]},"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's files: an upload's `key`, a generation output's `key` or a workflow node output's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]}},"required":["key"]},"description":"Replaces the references (in order); left out, they're kept."},"sheetKey":{"anyOf":[{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A new sheet image (storage key); `null` drops the sheet; left out, it's kept.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"voice":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}}}}}},"responses":{"201":{"description":"The item with its versions.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"deleted":{"type":"boolean","description":"Deleted (listed when asked for by `ids`, or in Recently Deleted)."},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was deleted; purged 30 days later.","examples":[null]},"description":{"type":"string","description":"The current version's locked description.","examples":["Product shots for the autumn campaign."]},"faces":{"anyOf":[{"enum":["trusted","untrusted","unknown"],"type":"string"},{"type":"null"}],"description":"Characters only: whether Seedance takes its face, from the generation that made its current version (`trusted`: Seedream or Seedance on ModelArk in the last 30 days). Other video models take any. Null for other items."},"favorite":{"type":"boolean"},"fileCount":{"type":"integer","examples":[1]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"generationId":{"anyOf":[{"type":"string","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The generation it was filed from, for a generated asset.","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"labels":{"type":"array","items":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["color","id","name"],"description":"A label on an item."},"description":"Its labels, in name order."},"latestVersion":{"type":"integer","description":"Number of the newest version.","examples":[3]},"mention":{"type":"string","description":"The token that mentions the current version in a prompt, e.g. `[@ id=\"lib:<id>@v2\" label=\"ninja\"]`."},"model":{"anyOf":[{"type":"string","examples":["google/nano-banana-pro"]},{"type":"null"}],"description":"The model that made it (generated assets).","examples":["google/nano-banana-pro"]},"name":{"type":"string","examples":["Autumn campaign"]},"origin":{"enum":["upload","generation"],"type":"string","description":"`upload`: uploaded or made by hand. `generation`: filed from a generation (a workflow step's, the agent's or the API's)."},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"pendingSheets":{"type":"integer","description":"AI Character sheets still generating.","examples":[1]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was pinned (for everyone who sees it); `null`: not pinned.","examples":["2026-10-21T12:00:00.000Z"]},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"slug":{"type":"string"},"sprite":{"anyOf":[{"type":"object","properties":{"characterId":{"type":"string","description":"Its Sprite Studio character.","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The version whose master is approved; `null` until one is.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"sizeClass":{"enum":["small","medium","large"],"type":"string","description":"How tall it stands next to the game's other sprites."}},"required":["characterId","masterVersionId","sizeClass"]},{"type":"null"}],"description":"Sprites (kind `sprite`) made in Sprite Studio: its character there. Null for other items."},"thumbnail":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}],"description":"The sheet, else the first reference. A character's portrait; a sprite's largest master."},"type":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The project (workflow) it came from.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"provenance":{"anyOf":[{"type":"object","properties":{"modelName":{"anyOf":[{"type":"string"},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","name"]},{"type":"null"}]},"prompt":{"anyOf":[{"type":"string","examples":["A lighthouse on a cliff at dusk, cinematic"]},{"type":"null"}],"examples":["A lighthouse on a cliff at dusk, cinematic"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The generation's other inputs (aspect ratio, resolution, duration, ...).","examples":[{}]}},"required":["modelName","project","prompt","settings"]},{"type":"null"}],"description":"How a generated asset was made; `null` for uploads."},"sheetErrors":{"type":"array","items":{"type":"string"},"description":"Why AI Character sheets that just finished failed."},"versions":{"type":"array","items":{"type":"object","properties":{"characterId":{"anyOf":[{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"files":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},"description":"The sheet first (if any), then the references in order."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"n":{"type":"integer","description":"Version number: 1, 2, 3, ...","examples":[1]},"sheet":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}]},"source":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{}]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["characterId","createdAt","createdByUserId","description","files","id","n","sheet","source","voice"],"description":"One immutable version of an item."},"description":"Every version, newest first: the sheet history."}},"required":["createdAt","deleted","deletedAt","description","faces","favorite","fileCount","folderId","id","kind","labels","latestVersion","mention","model","name","origin","ownerUserId","pendingSheets","pinnedAt","reviewStatus","scope","slug","thumbnail","type","updatedAt","workflowId","provenance","sheetErrors","versions"],"description":"A Library item with its versions."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"}},"/library/items":{"post":{"operationId":"createLibraryItem","summary":"Create an item","description":"Adds an asset (one file) or an element (a locked description plus ordered reference files) to the Library, from files the workspace already has: uploads, generation outputs, workflow node outputs.\n\nRequires scope `library:write`.","tags":["Library"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"characterId":{"type":"string","format":"uuid","description":"A registered character from `GET /characters` this element is (an `asset://` reference). Video models that hold it get it as a reference.","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"description":{"type":"string","maxLength":4000,"description":"The locked description: added to every prompt that mentions the item, verbatim.","examples":["A masked ninja in a red hooded jacket, amber eyes, lean build, twin short swords on the back."]},"files":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"durationSeconds":{"type":"number","maximum":86400,"exclusiveMinimum":0,"description":"Length of a video or audio file, if you know it (checked against models' combined reference limits).","examples":[5]},"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's files: an upload's `key`, a generation output's `key` or a workflow node output's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["ref","sheet"],"type":"string","default":"ref","description":"`ref`: a reference, in the order given. `sheet`: the element's generated sheet (an image; at most one)."},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]}},"required":["key"],"description":"A file in your storage."},"default":[],"description":"The files, references in order. An asset has exactly one; an element needs files or a description."},"folderId":{"type":"string","minLength":1,"maxLength":128,"description":"Folder of the same scope; the starting folder of `kind` when left out.","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`.","default":"other"},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only.","default":"team"},"slug":{"type":"string","minLength":1,"maxLength":48,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"What `@` completes, unique per workspace and scope (per person for Private). Made from the name when left out.","examples":["ninja"]},"source":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":128,"examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"nodeId":{"type":"string","minLength":1,"maxLength":128,"examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"workflowId":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"description":"Where the files came from, for its history."},"type":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet.","default":"asset"},"voice":{"type":"string","minLength":1,"maxLength":200,"description":"A voice (name or id) speech models use when the item is mentioned and the request sets none."}},"required":["name"],"description":"A new Library item."}}}},"responses":{"201":{"description":"The item.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"deleted":{"type":"boolean","description":"Deleted (listed when asked for by `ids`, or in Recently Deleted)."},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was deleted; purged 30 days later.","examples":[null]},"description":{"type":"string","description":"The current version's locked description.","examples":["Product shots for the autumn campaign."]},"faces":{"anyOf":[{"enum":["trusted","untrusted","unknown"],"type":"string"},{"type":"null"}],"description":"Characters only: whether Seedance takes its face, from the generation that made its current version (`trusted`: Seedream or Seedance on ModelArk in the last 30 days). Other video models take any. Null for other items."},"favorite":{"type":"boolean"},"fileCount":{"type":"integer","examples":[1]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"generationId":{"anyOf":[{"type":"string","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The generation it was filed from, for a generated asset.","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"labels":{"type":"array","items":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["color","id","name"],"description":"A label on an item."},"description":"Its labels, in name order."},"latestVersion":{"type":"integer","description":"Number of the newest version.","examples":[3]},"mention":{"type":"string","description":"The token that mentions the current version in a prompt, e.g. `[@ id=\"lib:<id>@v2\" label=\"ninja\"]`."},"model":{"anyOf":[{"type":"string","examples":["google/nano-banana-pro"]},{"type":"null"}],"description":"The model that made it (generated assets).","examples":["google/nano-banana-pro"]},"name":{"type":"string","examples":["Autumn campaign"]},"origin":{"enum":["upload","generation"],"type":"string","description":"`upload`: uploaded or made by hand. `generation`: filed from a generation (a workflow step's, the agent's or the API's)."},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"pendingSheets":{"type":"integer","description":"AI Character sheets still generating.","examples":[1]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was pinned (for everyone who sees it); `null`: not pinned.","examples":["2026-10-21T12:00:00.000Z"]},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"slug":{"type":"string"},"sprite":{"anyOf":[{"type":"object","properties":{"characterId":{"type":"string","description":"Its Sprite Studio character.","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The version whose master is approved; `null` until one is.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"sizeClass":{"enum":["small","medium","large"],"type":"string","description":"How tall it stands next to the game's other sprites."}},"required":["characterId","masterVersionId","sizeClass"]},{"type":"null"}],"description":"Sprites (kind `sprite`) made in Sprite Studio: its character there. Null for other items."},"thumbnail":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}],"description":"The sheet, else the first reference. A character's portrait; a sprite's largest master."},"type":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The project (workflow) it came from.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"provenance":{"anyOf":[{"type":"object","properties":{"modelName":{"anyOf":[{"type":"string"},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","name"]},{"type":"null"}]},"prompt":{"anyOf":[{"type":"string","examples":["A lighthouse on a cliff at dusk, cinematic"]},{"type":"null"}],"examples":["A lighthouse on a cliff at dusk, cinematic"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The generation's other inputs (aspect ratio, resolution, duration, ...).","examples":[{}]}},"required":["modelName","project","prompt","settings"]},{"type":"null"}],"description":"How a generated asset was made; `null` for uploads."},"sheetErrors":{"type":"array","items":{"type":"string"},"description":"Why AI Character sheets that just finished failed."},"versions":{"type":"array","items":{"type":"object","properties":{"characterId":{"anyOf":[{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"files":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},"description":"The sheet first (if any), then the references in order."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"n":{"type":"integer","description":"Version number: 1, 2, 3, ...","examples":[1]},"sheet":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}]},"source":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{}]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["characterId","createdAt","createdByUserId","description","files","id","n","sheet","source","voice"],"description":"One immutable version of an item."},"description":"Every version, newest first: the sheet history."}},"required":["createdAt","deleted","deletedAt","description","faces","favorite","fileCount","folderId","id","kind","labels","latestVersion","mention","model","name","origin","ownerUserId","pendingSheets","pinnedAt","reviewStatus","scope","slug","thumbnail","type","updatedAt","workflowId","provenance","sheetErrors","versions"],"description":"A Library item with its versions."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"},"get":{"operationId":"listLibraryItems","summary":"List items","description":"Lists and searches the Library, most recently changed first, a page at a time: filter by scope, folder, kind, type and your favorites. Each item carries its `mention` token for prompts.\n\nRequires scope `library:read`.","tags":["Library"],"parameters":[{"name":"aspect","in":"query","schema":{"enum":["square","landscape","portrait"],"type":"string","description":"Only items whose files are `square`, `landscape` or `portrait` (within 5%)."},"allowEmptyValue":true,"allowReserved":true},{"name":"createdAfter","in":"query","schema":{"type":"string","format":"date-time","x-native-type":"date","description":"Only items made at or after this time.","examples":["2026-10-21T12:00:00.000Z"]},"allowEmptyValue":true,"allowReserved":true},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":500,"description":"`nextCursor` from the previous page."},"allowEmptyValue":true,"allowReserved":true},{"name":"deleted","in":"query","schema":{"anyOf":[{"type":"boolean"},{"enum":["true","false"],"type":"string"}],"description":"Recently Deleted instead: deleted items, purged 30 days after deletion (listing them purges the expired ones)."},"allowEmptyValue":true,"allowReserved":true},{"name":"favorite","in":"query","schema":{"anyOf":[{"type":"boolean"},{"enum":["true","false"],"type":"string"}],"description":"Only your favorites."},"allowEmptyValue":true,"allowReserved":true},{"name":"folderId","in":"query","schema":{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"allowEmptyValue":true,"allowReserved":true},{"name":"ids","in":"query","schema":{"anyOf":[{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":128}},{"type":"string","maxLength":4000}],"description":"Exactly these items (comma-separated), including deleted ones, e.g. to check the versions a canvas pins."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"kind","in":"query","schema":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"allowEmptyValue":true,"allowReserved":true},{"name":"labelId","in":"query","schema":{"type":"string","minLength":1,"maxLength":128,"description":"Only items with this label.","examples":["e5b488e2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"allowEmptyValue":true,"allowReserved":true},{"name":"media","in":"query","schema":{"enum":["image","video","audio","text"],"type":"string","description":"Items with a file of this kind; `text`: items with no files (description-only elements)."},"allowEmptyValue":true,"allowReserved":true},{"name":"model","in":"query","schema":{"type":"string","maxLength":200,"description":"Generated by this model (canonical id).","examples":["google/nano-banana-pro"]},"allowEmptyValue":true,"allowReserved":true},{"name":"origin","in":"query","schema":{"enum":["upload","generation"],"type":"string","description":"`upload`: uploaded or made by hand. `generation`: filed from a generation (a workflow step's, the agent's or the API's)."},"allowEmptyValue":true,"allowReserved":true},{"name":"pinned","in":"query","schema":{"anyOf":[{"type":"boolean"},{"enum":["true","false"],"type":"string"}],"description":"Only pinned items."},"allowEmptyValue":true,"allowReserved":true},{"name":"q","in":"query","schema":{"type":"string","maxLength":200,"description":"Search names, slugs and descriptions.","examples":["ninja"]},"allowEmptyValue":true,"allowReserved":true},{"name":"reviewStatus","in":"query","schema":{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},"allowEmptyValue":true,"allowReserved":true},{"name":"scope","in":"query","schema":{"enum":["private","team","all"],"type":"string","default":"all","description":"`team`, `private`, or `all` (both)."},"allowEmptyValue":true,"allowReserved":true},{"name":"type","in":"query","schema":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet."},"allowEmptyValue":true,"allowReserved":true},{"name":"workflowId","in":"query","schema":{"type":"string","minLength":1,"maxLength":128,"description":"Came from this project (workflow).","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"A page of items.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"deleted":{"type":"boolean","description":"Deleted (listed when asked for by `ids`, or in Recently Deleted)."},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was deleted; purged 30 days later.","examples":[null]},"description":{"type":"string","description":"The current version's locked description.","examples":["Product shots for the autumn campaign."]},"faces":{"anyOf":[{"enum":["trusted","untrusted","unknown"],"type":"string"},{"type":"null"}],"description":"Characters only: whether Seedance takes its face, from the generation that made its current version (`trusted`: Seedream or Seedance on ModelArk in the last 30 days). Other video models take any. Null for other items."},"favorite":{"type":"boolean"},"fileCount":{"type":"integer","examples":[1]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"generationId":{"anyOf":[{"type":"string","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The generation it was filed from, for a generated asset.","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"labels":{"type":"array","items":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["color","id","name"],"description":"A label on an item."},"description":"Its labels, in name order."},"latestVersion":{"type":"integer","description":"Number of the newest version.","examples":[3]},"mention":{"type":"string","description":"The token that mentions the current version in a prompt, e.g. `[@ id=\"lib:<id>@v2\" label=\"ninja\"]`."},"model":{"anyOf":[{"type":"string","examples":["google/nano-banana-pro"]},{"type":"null"}],"description":"The model that made it (generated assets).","examples":["google/nano-banana-pro"]},"name":{"type":"string","examples":["Autumn campaign"]},"origin":{"enum":["upload","generation"],"type":"string","description":"`upload`: uploaded or made by hand. `generation`: filed from a generation (a workflow step's, the agent's or the API's)."},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"pendingSheets":{"type":"integer","description":"AI Character sheets still generating.","examples":[1]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was pinned (for everyone who sees it); `null`: not pinned.","examples":["2026-10-21T12:00:00.000Z"]},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"slug":{"type":"string"},"sprite":{"anyOf":[{"type":"object","properties":{"characterId":{"type":"string","description":"Its Sprite Studio character.","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The version whose master is approved; `null` until one is.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"sizeClass":{"enum":["small","medium","large"],"type":"string","description":"How tall it stands next to the game's other sprites."}},"required":["characterId","masterVersionId","sizeClass"]},{"type":"null"}],"description":"Sprites (kind `sprite`) made in Sprite Studio: its character there. Null for other items."},"thumbnail":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}],"description":"The sheet, else the first reference. A character's portrait; a sprite's largest master."},"type":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The project (workflow) it came from.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["createdAt","deleted","deletedAt","description","faces","favorite","fileCount","folderId","id","kind","labels","latestVersion","mention","model","name","origin","ownerUserId","pendingSheets","pinnedAt","reviewStatus","scope","slug","thumbnail","type","updatedAt","workflowId"],"description":"A Library item."}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` for the next page; `null` on the last."}},"required":["items","nextCursor"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:read"}},"/library/items/{itemId}":{"delete":{"operationId":"deleteLibraryItem","summary":"Delete an item","description":"Removes an item from the Library. Prompts that still mention it fail with a message saying it was deleted.\n\nRequires scope `library:delete`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:delete"},"get":{"operationId":"getLibraryItem","summary":"Get an item","description":"Returns an item with every version (newest first) and download URLs. Sheets that finished generating are added as versions first.\n\nRequires scope `library:read`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"responses":{"200":{"description":"The item.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"deleted":{"type":"boolean","description":"Deleted (listed when asked for by `ids`, or in Recently Deleted)."},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was deleted; purged 30 days later.","examples":[null]},"description":{"type":"string","description":"The current version's locked description.","examples":["Product shots for the autumn campaign."]},"faces":{"anyOf":[{"enum":["trusted","untrusted","unknown"],"type":"string"},{"type":"null"}],"description":"Characters only: whether Seedance takes its face, from the generation that made its current version (`trusted`: Seedream or Seedance on ModelArk in the last 30 days). Other video models take any. Null for other items."},"favorite":{"type":"boolean"},"fileCount":{"type":"integer","examples":[1]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"generationId":{"anyOf":[{"type":"string","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The generation it was filed from, for a generated asset.","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"labels":{"type":"array","items":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["color","id","name"],"description":"A label on an item."},"description":"Its labels, in name order."},"latestVersion":{"type":"integer","description":"Number of the newest version.","examples":[3]},"mention":{"type":"string","description":"The token that mentions the current version in a prompt, e.g. `[@ id=\"lib:<id>@v2\" label=\"ninja\"]`."},"model":{"anyOf":[{"type":"string","examples":["google/nano-banana-pro"]},{"type":"null"}],"description":"The model that made it (generated assets).","examples":["google/nano-banana-pro"]},"name":{"type":"string","examples":["Autumn campaign"]},"origin":{"enum":["upload","generation"],"type":"string","description":"`upload`: uploaded or made by hand. `generation`: filed from a generation (a workflow step's, the agent's or the API's)."},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"pendingSheets":{"type":"integer","description":"AI Character sheets still generating.","examples":[1]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was pinned (for everyone who sees it); `null`: not pinned.","examples":["2026-10-21T12:00:00.000Z"]},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"slug":{"type":"string"},"sprite":{"anyOf":[{"type":"object","properties":{"characterId":{"type":"string","description":"Its Sprite Studio character.","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The version whose master is approved; `null` until one is.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"sizeClass":{"enum":["small","medium","large"],"type":"string","description":"How tall it stands next to the game's other sprites."}},"required":["characterId","masterVersionId","sizeClass"]},{"type":"null"}],"description":"Sprites (kind `sprite`) made in Sprite Studio: its character there. Null for other items."},"thumbnail":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}],"description":"The sheet, else the first reference. A character's portrait; a sprite's largest master."},"type":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The project (workflow) it came from.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"provenance":{"anyOf":[{"type":"object","properties":{"modelName":{"anyOf":[{"type":"string"},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","name"]},{"type":"null"}]},"prompt":{"anyOf":[{"type":"string","examples":["A lighthouse on a cliff at dusk, cinematic"]},{"type":"null"}],"examples":["A lighthouse on a cliff at dusk, cinematic"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The generation's other inputs (aspect ratio, resolution, duration, ...).","examples":[{}]}},"required":["modelName","project","prompt","settings"]},{"type":"null"}],"description":"How a generated asset was made; `null` for uploads."},"sheetErrors":{"type":"array","items":{"type":"string"},"description":"Why AI Character sheets that just finished failed."},"versions":{"type":"array","items":{"type":"object","properties":{"characterId":{"anyOf":[{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"files":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},"description":"The sheet first (if any), then the references in order."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"n":{"type":"integer","description":"Version number: 1, 2, 3, ...","examples":[1]},"sheet":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}]},"source":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{}]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["characterId","createdAt","createdByUserId","description","files","id","n","sheet","source","voice"],"description":"One immutable version of an item."},"description":"Every version, newest first: the sheet history."}},"required":["createdAt","deleted","deletedAt","description","faces","favorite","fileCount","folderId","id","kind","labels","latestVersion","mention","model","name","origin","ownerUserId","pendingSheets","pinnedAt","reviewStatus","scope","slug","thumbnail","type","updatedAt","workflowId","provenance","sheetErrors","versions"],"description":"A Library item with its versions."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:read"},"patch":{"operationId":"updateLibraryItem","summary":"Update an item","description":"Renames an item, changes its slug or kind, or moves it to another folder of its scope. Mentions resolve by id, so prompts keep working.\n\nRequires scope `library:write`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"folderId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Another folder of the same scope; `null` for none.","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}],"description":"The review status; `null` clears it."},"slug":{"type":"string","minLength":1,"maxLength":48,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","description":"What `@` completes, unique per workspace and scope (per person for Private). Made from the name when left out.","examples":["ninja"]}}}}}},"responses":{"200":{"description":"The item.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"deleted":{"type":"boolean","description":"Deleted (listed when asked for by `ids`, or in Recently Deleted)."},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was deleted; purged 30 days later.","examples":[null]},"description":{"type":"string","description":"The current version's locked description.","examples":["Product shots for the autumn campaign."]},"faces":{"anyOf":[{"enum":["trusted","untrusted","unknown"],"type":"string"},{"type":"null"}],"description":"Characters only: whether Seedance takes its face, from the generation that made its current version (`trusted`: Seedream or Seedance on ModelArk in the last 30 days). Other video models take any. Null for other items."},"favorite":{"type":"boolean"},"fileCount":{"type":"integer","examples":[1]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"generationId":{"anyOf":[{"type":"string","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The generation it was filed from, for a generated asset.","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"labels":{"type":"array","items":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["color","id","name"],"description":"A label on an item."},"description":"Its labels, in name order."},"latestVersion":{"type":"integer","description":"Number of the newest version.","examples":[3]},"mention":{"type":"string","description":"The token that mentions the current version in a prompt, e.g. `[@ id=\"lib:<id>@v2\" label=\"ninja\"]`."},"model":{"anyOf":[{"type":"string","examples":["google/nano-banana-pro"]},{"type":"null"}],"description":"The model that made it (generated assets).","examples":["google/nano-banana-pro"]},"name":{"type":"string","examples":["Autumn campaign"]},"origin":{"enum":["upload","generation"],"type":"string","description":"`upload`: uploaded or made by hand. `generation`: filed from a generation (a workflow step's, the agent's or the API's)."},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"pendingSheets":{"type":"integer","description":"AI Character sheets still generating.","examples":[1]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was pinned (for everyone who sees it); `null`: not pinned.","examples":["2026-10-21T12:00:00.000Z"]},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"slug":{"type":"string"},"sprite":{"anyOf":[{"type":"object","properties":{"characterId":{"type":"string","description":"Its Sprite Studio character.","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The version whose master is approved; `null` until one is.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"sizeClass":{"enum":["small","medium","large"],"type":"string","description":"How tall it stands next to the game's other sprites."}},"required":["characterId","masterVersionId","sizeClass"]},{"type":"null"}],"description":"Sprites (kind `sprite`) made in Sprite Studio: its character there. Null for other items."},"thumbnail":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}],"description":"The sheet, else the first reference. A character's portrait; a sprite's largest master."},"type":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The project (workflow) it came from.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["createdAt","deleted","deletedAt","description","faces","favorite","fileCount","folderId","id","kind","labels","latestVersion","mention","model","name","origin","ownerUserId","pendingSheets","pinnedAt","reviewStatus","scope","slug","thumbnail","type","updatedAt","workflowId"],"description":"A Library item."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"}},"/library/items/{itemId}/favorite":{"put":{"operationId":"favoriteLibraryItem","summary":"Favorite an item","description":"Adds an item to your favorites.\n\nRequires scope `library:write`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"responses":{"200":{"description":"Favorited.","content":{"application/json":{"schema":{"type":"object","properties":{"favorite":{"type":"boolean"},"itemId":{"type":"string","minLength":1,"maxLength":128,"examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["favorite","itemId"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"},"delete":{"operationId":"unfavoriteLibraryItem","summary":"Unfavorite an item","description":"Removes an item from your favorites.\n\nRequires scope `library:write`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"responses":{"200":{"description":"Not a favorite any more.","content":{"application/json":{"schema":{"type":"object","properties":{"favorite":{"type":"boolean"},"itemId":{"type":"string","minLength":1,"maxLength":128,"examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["favorite","itemId"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"}},"/library/items/{itemId}/sheets":{"post":{"operationId":"generateLibrarySheet","summary":"Generate a character sheet","description":"AI Character: generates a turnaround sheet for an element (four views, full body over portrait) from its reference images and its description, as one image. It's a normal generation and costs its credits.\n\n`realistic` and `stylized` are drawn with Nano Banana Pro, which keeps the reference face best across views; Seedance refuses those real-looking faces. `seedance` is drawn with Seedream 5.0 Pro on ModelArk, whose faces Seedance accepts. When the generation completes, reading the item adds the sheet as a new version (the sheet history).\n\nRequires scope `library:write`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"style":{"enum":["realistic","stylized","seedance"],"type":"string","default":"realistic","description":"The look: `realistic` for real people and `stylized` for illustrated and anime characters, both drawn with Nano Banana Pro (Seedance refuses those faces); `seedance` for real people drawn with Seedream 5.0 Pro on ModelArk, whose faces Seedance accepts."}}}}}},"responses":{"202":{"description":"Accepted: the sheet generation is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"generation":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."},"item":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"deleted":{"type":"boolean","description":"Deleted (listed when asked for by `ids`, or in Recently Deleted)."},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was deleted; purged 30 days later.","examples":[null]},"description":{"type":"string","description":"The current version's locked description.","examples":["Product shots for the autumn campaign."]},"faces":{"anyOf":[{"enum":["trusted","untrusted","unknown"],"type":"string"},{"type":"null"}],"description":"Characters only: whether Seedance takes its face, from the generation that made its current version (`trusted`: Seedream or Seedance on ModelArk in the last 30 days). Other video models take any. Null for other items."},"favorite":{"type":"boolean"},"fileCount":{"type":"integer","examples":[1]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"generationId":{"anyOf":[{"type":"string","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The generation it was filed from, for a generated asset.","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"labels":{"type":"array","items":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["color","id","name"],"description":"A label on an item."},"description":"Its labels, in name order."},"latestVersion":{"type":"integer","description":"Number of the newest version.","examples":[3]},"mention":{"type":"string","description":"The token that mentions the current version in a prompt, e.g. `[@ id=\"lib:<id>@v2\" label=\"ninja\"]`."},"model":{"anyOf":[{"type":"string","examples":["google/nano-banana-pro"]},{"type":"null"}],"description":"The model that made it (generated assets).","examples":["google/nano-banana-pro"]},"name":{"type":"string","examples":["Autumn campaign"]},"origin":{"enum":["upload","generation"],"type":"string","description":"`upload`: uploaded or made by hand. `generation`: filed from a generation (a workflow step's, the agent's or the API's)."},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"pendingSheets":{"type":"integer","description":"AI Character sheets still generating.","examples":[1]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was pinned (for everyone who sees it); `null`: not pinned.","examples":["2026-10-21T12:00:00.000Z"]},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"slug":{"type":"string"},"sprite":{"anyOf":[{"type":"object","properties":{"characterId":{"type":"string","description":"Its Sprite Studio character.","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The version whose master is approved; `null` until one is.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"sizeClass":{"enum":["small","medium","large"],"type":"string","description":"How tall it stands next to the game's other sprites."}},"required":["characterId","masterVersionId","sizeClass"]},{"type":"null"}],"description":"Sprites (kind `sprite`) made in Sprite Studio: its character there. Null for other items."},"thumbnail":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}],"description":"The sheet, else the first reference. A character's portrait; a sprite's largest master."},"type":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The project (workflow) it came from.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["createdAt","deleted","deletedAt","description","faces","favorite","fileCount","folderId","id","kind","labels","latestVersion","mention","model","name","origin","ownerUserId","pendingSheets","pinnedAt","reviewStatus","scope","slug","thumbnail","type","updatedAt","workflowId"],"description":"A Library item."}},"required":["generation","item"],"description":"The sheet generation; when it completes, reading the item adds it as a new version."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"}},"/library/items/{itemId}/move":{"post":{"operationId":"moveLibraryItem","summary":"Copy to the other scope","description":"Puts a copy of an item in the other scope (Private → Team shares it; Team → Private keeps a copy for you). The original stays where it is; the copy starts at version 1 with the current files.\n\nRequires scope `library:write`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"folderId":{"type":"string","minLength":1,"maxLength":128,"description":"A folder in the target scope; its starting folder when left out.","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."}},"required":["scope"]}}}},"responses":{"201":{"description":"The copy.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"deleted":{"type":"boolean","description":"Deleted (listed when asked for by `ids`, or in Recently Deleted)."},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was deleted; purged 30 days later.","examples":[null]},"description":{"type":"string","description":"The current version's locked description.","examples":["Product shots for the autumn campaign."]},"faces":{"anyOf":[{"enum":["trusted","untrusted","unknown"],"type":"string"},{"type":"null"}],"description":"Characters only: whether Seedance takes its face, from the generation that made its current version (`trusted`: Seedream or Seedance on ModelArk in the last 30 days). Other video models take any. Null for other items."},"favorite":{"type":"boolean"},"fileCount":{"type":"integer","examples":[1]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"generationId":{"anyOf":[{"type":"string","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The generation it was filed from, for a generated asset.","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"labels":{"type":"array","items":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["color","id","name"],"description":"A label on an item."},"description":"Its labels, in name order."},"latestVersion":{"type":"integer","description":"Number of the newest version.","examples":[3]},"mention":{"type":"string","description":"The token that mentions the current version in a prompt, e.g. `[@ id=\"lib:<id>@v2\" label=\"ninja\"]`."},"model":{"anyOf":[{"type":"string","examples":["google/nano-banana-pro"]},{"type":"null"}],"description":"The model that made it (generated assets).","examples":["google/nano-banana-pro"]},"name":{"type":"string","examples":["Autumn campaign"]},"origin":{"enum":["upload","generation"],"type":"string","description":"`upload`: uploaded or made by hand. `generation`: filed from a generation (a workflow step's, the agent's or the API's)."},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"pendingSheets":{"type":"integer","description":"AI Character sheets still generating.","examples":[1]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was pinned (for everyone who sees it); `null`: not pinned.","examples":["2026-10-21T12:00:00.000Z"]},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"slug":{"type":"string"},"sprite":{"anyOf":[{"type":"object","properties":{"characterId":{"type":"string","description":"Its Sprite Studio character.","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The version whose master is approved; `null` until one is.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"sizeClass":{"enum":["small","medium","large"],"type":"string","description":"How tall it stands next to the game's other sprites."}},"required":["characterId","masterVersionId","sizeClass"]},{"type":"null"}],"description":"Sprites (kind `sprite`) made in Sprite Studio: its character there. Null for other items."},"thumbnail":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}],"description":"The sheet, else the first reference. A character's portrait; a sprite's largest master."},"type":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The project (workflow) it came from.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"provenance":{"anyOf":[{"type":"object","properties":{"modelName":{"anyOf":[{"type":"string"},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","name"]},{"type":"null"}]},"prompt":{"anyOf":[{"type":"string","examples":["A lighthouse on a cliff at dusk, cinematic"]},{"type":"null"}],"examples":["A lighthouse on a cliff at dusk, cinematic"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The generation's other inputs (aspect ratio, resolution, duration, ...).","examples":[{}]}},"required":["modelName","project","prompt","settings"]},{"type":"null"}],"description":"How a generated asset was made; `null` for uploads."},"sheetErrors":{"type":"array","items":{"type":"string"},"description":"Why AI Character sheets that just finished failed."},"versions":{"type":"array","items":{"type":"object","properties":{"characterId":{"anyOf":[{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"files":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},"description":"The sheet first (if any), then the references in order."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"n":{"type":"integer","description":"Version number: 1, 2, 3, ...","examples":[1]},"sheet":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}]},"source":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{}]},"voice":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["characterId","createdAt","createdByUserId","description","files","id","n","sheet","source","voice"],"description":"One immutable version of an item."},"description":"Every version, newest first: the sheet history."}},"required":["createdAt","deleted","deletedAt","description","faces","favorite","fileCount","folderId","id","kind","labels","latestVersion","mention","model","name","origin","ownerUserId","pendingSheets","pinnedAt","reviewStatus","scope","slug","thumbnail","type","updatedAt","workflowId","provenance","sheetErrors","versions"],"description":"A Library item with its versions."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"}},"/library/facets":{"get":{"operationId":"listAssetFacets","summary":"List filter choices","description":"The models and projects your assets came from: the choices of the Assets page's filters.\n\nRequires scope `library:read`.","tags":["Library"],"responses":{"200":{"description":"The filter choices.","content":{"application/json":{"schema":{"type":"object","properties":{"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","name"]}},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","name"]}}},"required":["models","projects"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:read"}},"/library/items/{itemId}/permanent":{"delete":{"operationId":"purgeLibraryItem","summary":"Delete an item for good","description":"Deletes an item in Recently Deleted for good: it can't be restored. Items are purged 30 days after deletion anyway.\n\nRequires scope `library:delete`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"responses":{"200":{"description":"Deleted for good.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:delete"}},"/library/items/{itemId}/restore":{"post":{"operationId":"restoreLibraryItem","summary":"Restore an item","description":"Brings a deleted item back from Recently Deleted. Its slug gets a number if another item took it meanwhile.\n\nRequires scope `library:delete`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"responses":{"200":{"description":"The item.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"deleted":{"type":"boolean","description":"Deleted (listed when asked for by `ids`, or in Recently Deleted)."},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was deleted; purged 30 days later.","examples":[null]},"description":{"type":"string","description":"The current version's locked description.","examples":["Product shots for the autumn campaign."]},"faces":{"anyOf":[{"enum":["trusted","untrusted","unknown"],"type":"string"},{"type":"null"}],"description":"Characters only: whether Seedance takes its face, from the generation that made its current version (`trusted`: Seedream or Seedance on ModelArk in the last 30 days). Other video models take any. Null for other items."},"favorite":{"type":"boolean"},"fileCount":{"type":"integer","examples":[1]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"generationId":{"anyOf":[{"type":"string","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The generation it was filed from, for a generated asset.","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"labels":{"type":"array","items":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["color","id","name"],"description":"A label on an item."},"description":"Its labels, in name order."},"latestVersion":{"type":"integer","description":"Number of the newest version.","examples":[3]},"mention":{"type":"string","description":"The token that mentions the current version in a prompt, e.g. `[@ id=\"lib:<id>@v2\" label=\"ninja\"]`."},"model":{"anyOf":[{"type":"string","examples":["google/nano-banana-pro"]},{"type":"null"}],"description":"The model that made it (generated assets).","examples":["google/nano-banana-pro"]},"name":{"type":"string","examples":["Autumn campaign"]},"origin":{"enum":["upload","generation"],"type":"string","description":"`upload`: uploaded or made by hand. `generation`: filed from a generation (a workflow step's, the agent's or the API's)."},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"pendingSheets":{"type":"integer","description":"AI Character sheets still generating.","examples":[1]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was pinned (for everyone who sees it); `null`: not pinned.","examples":["2026-10-21T12:00:00.000Z"]},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"slug":{"type":"string"},"sprite":{"anyOf":[{"type":"object","properties":{"characterId":{"type":"string","description":"Its Sprite Studio character.","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The version whose master is approved; `null` until one is.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"sizeClass":{"enum":["small","medium","large"],"type":"string","description":"How tall it stands next to the game's other sprites."}},"required":["characterId","masterVersionId","sizeClass"]},{"type":"null"}],"description":"Sprites (kind `sprite`) made in Sprite Studio: its character there. Null for other items."},"thumbnail":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}],"description":"The sheet, else the first reference. A character's portrait; a sprite's largest master."},"type":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The project (workflow) it came from.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["createdAt","deleted","deletedAt","description","faces","favorite","fileCount","folderId","id","kind","labels","latestVersion","mention","model","name","origin","ownerUserId","pendingSheets","pinnedAt","reviewStatus","scope","slug","thumbnail","type","updatedAt","workflowId"],"description":"A Library item."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:delete"}},"/library/items/review-status":{"post":{"operationId":"setLibraryReviewStatus","summary":"Set review status","description":"Sets (or, with `null`, clears) the review status of several items at once: To do, In progress, Under review or Done.\n\nRequires scope `library:write`.","tags":["Library"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"itemIds":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"string","minLength":1,"maxLength":128}},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}],"description":"The review status; `null` clears it."}},"required":["itemIds","reviewStatus"]}}}},"responses":{"200":{"description":"How many items changed.","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer","description":"Items changed.","examples":[1]}},"required":["updated"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"}},"/library/generations/sync":{"post":{"operationId":"syncLibraryGenerations","summary":"File generations as assets","description":"Files the workspace's completed generations that aren't assets yet (newest first, up to 100). Finished generations are filed as they complete; this catches older ones.\n\nRequires scope `library:write`.","tags":["Library"],"responses":{"200":{"description":"How many assets were added.","content":{"application/json":{"schema":{"type":"object","properties":{"filed":{"type":"integer","description":"Assets added.","examples":[1]}},"required":["filed"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"}},"/library/labels":{"post":{"operationId":"createLibraryLabel","summary":"Create a label","description":"Adds an asset label to the workspace (names are unique, any case).\n\nRequires scope `library:write`.","tags":["Library"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour.","default":"gray"},"name":{"type":"string","minLength":1,"maxLength":40,"examples":["Approved"]}},"required":["name"]}}}},"responses":{"201":{"description":"The label.","content":{"application/json":{"schema":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"itemCount":{"type":"integer","description":"How many assets (not deleted) have it.","examples":[1]}},"required":["color","id","name","itemCount"],"description":"One of the workspace's asset labels."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"},"get":{"operationId":"listLibraryLabels","summary":"List labels","description":"The workspace's asset labels, by name, with how many assets have each.\n\nRequires scope `library:read`.","tags":["Library"],"responses":{"200":{"description":"The labels.","content":{"application/json":{"schema":{"type":"object","properties":{"labels":{"type":"array","items":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"itemCount":{"type":"integer","description":"How many assets (not deleted) have it.","examples":[1]}},"required":["color","id","name","itemCount"],"description":"One of the workspace's asset labels."}}},"required":["labels"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:read"}},"/library/labels/{labelId}":{"delete":{"operationId":"deleteLibraryLabel","summary":"Delete a label","description":"Deletes a label; the assets that had it keep the rest.\n\nRequires scope `library:delete`.","tags":["Library"],"parameters":[{"name":"labelId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["e5b488e2-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:delete"},"patch":{"operationId":"updateLibraryLabel","summary":"Update a label","description":"Renames a label or changes its colour.\n\nRequires scope `library:write`.","tags":["Library"],"parameters":[{"name":"labelId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["e5b488e2-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"name":{"type":"string","minLength":1,"maxLength":40,"examples":["Autumn campaign"]}}}}}},"responses":{"200":{"description":"The label.","content":{"application/json":{"schema":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"itemCount":{"type":"integer","description":"How many assets (not deleted) have it.","examples":[1]}},"required":["color","id","name","itemCount"],"description":"One of the workspace's asset labels."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"}},"/library/items/{itemId}/pin":{"put":{"operationId":"pinLibraryItem","summary":"Pin an item","description":"Pins an asset for everyone who sees it (the Assets page's Pinned view). It keeps its place in other lists.\n\nRequires scope `library:write`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"responses":{"200":{"description":"The item.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"deleted":{"type":"boolean","description":"Deleted (listed when asked for by `ids`, or in Recently Deleted)."},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was deleted; purged 30 days later.","examples":[null]},"description":{"type":"string","description":"The current version's locked description.","examples":["Product shots for the autumn campaign."]},"faces":{"anyOf":[{"enum":["trusted","untrusted","unknown"],"type":"string"},{"type":"null"}],"description":"Characters only: whether Seedance takes its face, from the generation that made its current version (`trusted`: Seedream or Seedance on ModelArk in the last 30 days). Other video models take any. Null for other items."},"favorite":{"type":"boolean"},"fileCount":{"type":"integer","examples":[1]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"generationId":{"anyOf":[{"type":"string","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The generation it was filed from, for a generated asset.","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"labels":{"type":"array","items":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["color","id","name"],"description":"A label on an item."},"description":"Its labels, in name order."},"latestVersion":{"type":"integer","description":"Number of the newest version.","examples":[3]},"mention":{"type":"string","description":"The token that mentions the current version in a prompt, e.g. `[@ id=\"lib:<id>@v2\" label=\"ninja\"]`."},"model":{"anyOf":[{"type":"string","examples":["google/nano-banana-pro"]},{"type":"null"}],"description":"The model that made it (generated assets).","examples":["google/nano-banana-pro"]},"name":{"type":"string","examples":["Autumn campaign"]},"origin":{"enum":["upload","generation"],"type":"string","description":"`upload`: uploaded or made by hand. `generation`: filed from a generation (a workflow step's, the agent's or the API's)."},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"pendingSheets":{"type":"integer","description":"AI Character sheets still generating.","examples":[1]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was pinned (for everyone who sees it); `null`: not pinned.","examples":["2026-10-21T12:00:00.000Z"]},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"slug":{"type":"string"},"sprite":{"anyOf":[{"type":"object","properties":{"characterId":{"type":"string","description":"Its Sprite Studio character.","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The version whose master is approved; `null` until one is.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"sizeClass":{"enum":["small","medium","large"],"type":"string","description":"How tall it stands next to the game's other sprites."}},"required":["characterId","masterVersionId","sizeClass"]},{"type":"null"}],"description":"Sprites (kind `sprite`) made in Sprite Studio: its character there. Null for other items."},"thumbnail":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}],"description":"The sheet, else the first reference. A character's portrait; a sprite's largest master."},"type":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The project (workflow) it came from.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["createdAt","deleted","deletedAt","description","faces","favorite","fileCount","folderId","id","kind","labels","latestVersion","mention","model","name","origin","ownerUserId","pendingSheets","pinnedAt","reviewStatus","scope","slug","thumbnail","type","updatedAt","workflowId"],"description":"A Library item."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"},"delete":{"operationId":"unpinLibraryItem","summary":"Unpin an item","description":"Requires scope `library:write`.","tags":["Library"],"parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21"]}}],"responses":{"200":{"description":"The item.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"deleted":{"type":"boolean","description":"Deleted (listed when asked for by `ids`, or in Recently Deleted)."},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was deleted; purged 30 days later.","examples":[null]},"description":{"type":"string","description":"The current version's locked description.","examples":["Product shots for the autumn campaign."]},"faces":{"anyOf":[{"enum":["trusted","untrusted","unknown"],"type":"string"},{"type":"null"}],"description":"Characters only: whether Seedance takes its face, from the generation that made its current version (`trusted`: Seedream or Seedance on ModelArk in the last 30 days). Other video models take any. Null for other items."},"favorite":{"type":"boolean"},"fileCount":{"type":"integer","examples":[1]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"generationId":{"anyOf":[{"type":"string","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The generation it was filed from, for a generated asset.","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["character","sprite","scene","item","style","sound_effect","other"],"type":"string","description":"What it is, as the starting folders sort it: `character`, `sprite` (a Sprite Studio character), `scene`, `item`, `style`, `sound_effect` or `other`."},"labels":{"type":"array","items":{"type":"object","properties":{"color":{"enum":["gray","red","orange","yellow","green","teal","blue","purple","pink"],"type":"string","description":"The label's colour."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["color","id","name"],"description":"A label on an item."},"description":"Its labels, in name order."},"latestVersion":{"type":"integer","description":"Number of the newest version.","examples":[3]},"mention":{"type":"string","description":"The token that mentions the current version in a prompt, e.g. `[@ id=\"lib:<id>@v2\" label=\"ninja\"]`."},"model":{"anyOf":[{"type":"string","examples":["google/nano-banana-pro"]},{"type":"null"}],"description":"The model that made it (generated assets).","examples":["google/nano-banana-pro"]},"name":{"type":"string","examples":["Autumn campaign"]},"origin":{"enum":["upload","generation"],"type":"string","description":"`upload`: uploaded or made by hand. `generation`: filed from a generation (a workflow step's, the agent's or the API's)."},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"pendingSheets":{"type":"integer","description":"AI Character sheets still generating.","examples":[1]},"pinnedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was pinned (for everyone who sees it); `null`: not pinned.","examples":["2026-10-21T12:00:00.000Z"]},"reviewStatus":{"anyOf":[{"enum":["todo","in_progress","under_review","done"],"type":"string","description":"Where the asset's review stands: `todo`, `in_progress`, `under_review` or `done`."},{"type":"null"}]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"slug":{"type":"string"},"sprite":{"anyOf":[{"type":"object","properties":{"characterId":{"type":"string","description":"Its Sprite Studio character.","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The version whose master is approved; `null` until one is.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"sizeClass":{"enum":["small","medium","large"],"type":"string","description":"How tall it stands next to the game's other sprites."}},"required":["characterId","masterVersionId","sizeClass"]},{"type":"null"}],"description":"Sprites (kind `sprite`) made in Sprite Studio: its character there. Null for other items."},"thumbnail":{"anyOf":[{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"position":{"type":"integer","examples":[1]},"role":{"enum":["sheet","ref","master","turnaround"],"type":"string"},"url":{"type":"string","description":"Download URL (expires).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]}},"required":["contentType","durationSeconds","height","id","key","kind","position","role","url","width"],"description":"A file of an item's version."},{"type":"null"}],"description":"The sheet, else the first reference. A character's portrait; a sprite's largest master."},"type":{"enum":["asset","element"],"type":"string","description":"`asset`: one file. `element`: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The project (workflow) it came from.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["createdAt","deleted","deletedAt","description","faces","favorite","fileCount","folderId","id","kind","labels","latestVersion","mention","model","name","origin","ownerUserId","pendingSheets","pinnedAt","reviewStatus","scope","slug","thumbnail","type","updatedAt","workflowId"],"description":"A Library item."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"}},"/library/items/labels":{"post":{"operationId":"setLibraryItemLabels","summary":"Label items","description":"Puts labels on items and takes others off, for many items at once. An item has at most 10 labels.\n\nRequires scope `library:write`.","tags":["Library"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"add":{"type":"array","maxItems":10,"items":{"type":"string","minLength":1,"maxLength":128},"default":[],"description":"Labels to put on every item."},"itemIds":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1,"maxLength":128}},"remove":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":128},"default":[],"description":"Labels to take off every item."}},"required":["itemIds"]}}}},"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer","examples":[1]}},"required":["updated"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"library:write"}},"/moodboards/{moodboardId}/images/from-link":{"post":{"operationId":"addMoodboardImageFromLink","summary":"Add an image from a link","description":"Adds a picture from a link to the end of a moodboard: an image address, or a page with a share image. It's fetched from our servers (public addresses only) and kept in your workspace's storage.\n\nRequires scope `brand:write`.","tags":["Moodboards"],"parameters":[{"name":"moodboardId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["a7d93c10-4e2b-4f6a-8c1d-0b5e9f2a3c47"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2048,"description":"An image's address, or a page with a share image (Pinterest, Unsplash, ...). It's fetched from our servers: public addresses only, up to 8 MB.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["url"]}}}},"responses":{"200":{"description":"The moodboard.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"images":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"notes":{"type":"string"},"styleDescription":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]}},"required":["createdAt","id","ownerUserId","scope","updatedAt","images","notes","styleDescription","title"],"description":"A moodboard."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:write"}},"/moodboards/{moodboardId}/capture-style":{"post":{"operationId":"captureMoodboardStyle","summary":"Capture a moodboard's style","description":"Describes the board's shared look (palette, light, mood, composition, textures) from its images with a vision model, and saves it as the board's `styleDescription`. Needs at least 3 images; reads the first 8.\n\nRequires scope `brand:write`.","tags":["Moodboards"],"parameters":[{"name":"moodboardId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["a7d93c10-4e2b-4f6a-8c1d-0b5e9f2a3c47"]}}],"responses":{"200":{"description":"The moodboard, with its style.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"images":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"notes":{"type":"string"},"styleDescription":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]}},"required":["createdAt","id","ownerUserId","scope","updatedAt","images","notes","styleDescription","title"],"description":"A moodboard."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:write"}},"/moodboards":{"post":{"operationId":"createMoodboard","summary":"Create a moodboard","description":"Adds a moodboard to the Team or your Private scope. Images are storage keys of the workspace's own images (uploads, generations, Library files).\n\nRequires scope `brand:write`.","tags":["Moodboards"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"images":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]}},"required":["key"],"description":"An image in your storage."}},"notes":{"type":"string","maxLength":8000},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only.","default":"private"},"title":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]}},"required":["title"],"description":"A new moodboard."}}}},"responses":{"201":{"description":"The moodboard.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"images":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"notes":{"type":"string"},"styleDescription":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]}},"required":["createdAt","id","ownerUserId","scope","updatedAt","images","notes","styleDescription","title"],"description":"A moodboard."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:write"},"get":{"operationId":"listMoodboards","summary":"List moodboards","description":"The workspace's Team moodboards and your Private ones, last edited first.\n\nRequires scope `brand:read`.","tags":["Moodboards"],"parameters":[{"name":"q","in":"query","schema":{"type":"string","maxLength":120,"description":"Only those whose name contains this (any case)."},"allowEmptyValue":true,"allowReserved":true},{"name":"scope","in":"query","schema":{"enum":["all","private","team"],"type":"string","default":"all","description":"`all` (default): Team and your Private ones."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The moodboards.","content":{"application/json":{"schema":{"type":"object","properties":{"moodboards":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"images":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"notes":{"type":"string"},"styleDescription":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]}},"required":["createdAt","id","ownerUserId","scope","updatedAt","images","notes","styleDescription","title"],"description":"A moodboard."}}},"required":["moodboards"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:read"}},"/moodboards/{moodboardId}":{"delete":{"operationId":"deleteMoodboard","summary":"Delete a moodboard","description":"Deletes a moodboard. Its images stay in storage.\n\nRequires scope `brand:delete`.","tags":["Moodboards"],"parameters":[{"name":"moodboardId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["a7d93c10-4e2b-4f6a-8c1d-0b5e9f2a3c47"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:delete"},"get":{"operationId":"getMoodboard","summary":"Get a moodboard","description":"Requires scope `brand:read`.","tags":["Moodboards"],"parameters":[{"name":"moodboardId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["a7d93c10-4e2b-4f6a-8c1d-0b5e9f2a3c47"]}}],"responses":{"200":{"description":"The moodboard.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"images":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"notes":{"type":"string"},"styleDescription":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]}},"required":["createdAt","id","ownerUserId","scope","updatedAt","images","notes","styleDescription","title"],"description":"A moodboard."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:read"},"patch":{"operationId":"updateMoodboard","summary":"Update a moodboard","description":"Changes a moodboard: the fields you send replace theirs (images whole, in order); the rest stay.\n\nRequires scope `brand:write`.","tags":["Moodboards"],"parameters":[{"name":"moodboardId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["a7d93c10-4e2b-4f6a-8c1d-0b5e9f2a3c47"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"images":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]}},"required":["key"],"description":"An image in your storage."},"description":"Replaces the images (in order); left out, they're kept."},"notes":{"type":"string","maxLength":8000},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"styleDescription":{"type":"string","maxLength":8000,"description":"The board's look in words (what Capture style wrote, or your own). Added to the prompt of nodes that use the board."},"title":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]}}}}}},"responses":{"200":{"description":"The moodboard.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"images":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"notes":{"type":"string"},"styleDescription":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]}},"required":["createdAt","id","ownerUserId","scope","updatedAt","images","notes","styleDescription","title"],"description":"A moodboard."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"brand:write"}},"/pricing":{"get":{"operationId":"getPriceBook","summary":"Get prices","description":"The current price book: what one credit sells for and every rate in microcredits (1,000,000 to a credit) per unit, by tier. Rates may be fractional credits; a request sums its meters and rounds up once, to at least 1 credit. Needs no session.","tags":["Pricing"],"responses":{"200":{"description":"The current prices.","content":{"application/json":{"schema":{"type":"object","properties":{"creditPriceMicros":{"type":"integer","exclusiveMinimum":0,"description":"What one credit sells for, in micro-USD (25000 = $0.025).","examples":[1]},"rates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"disabled":{"const":true,"description":"Nobody may run it for now."},"tiers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":0,"examples":[1]},"description":"Microcredits (1,000,000 to a credit) per unit, by tier: a resolution, a scale or a thinking level; `default` otherwise. `<tier>:audio` is the price with sound where sound costs more.","examples":[{}]},"unit":{"enum":["image","second","minute","request","100_characters","200_characters","1000_characters","30_seconds","usd"],"type":"string"}},"required":["tiers","unit"]},"description":"By rate: a model id, `llm:<provider>/<model>` for a Copilot model, or `service:<id>`.","examples":[{}]},"version":{"type":"integer","description":"The price book's version: it goes up each time prices are published.","examples":[3]}},"required":["creditPriceMicros","rates","version"],"description":"The current prices."}}}}}}},"/shared-projects/{workflowId}/copies":{"post":{"operationId":"copySharedProject","summary":"Copy a shared project","description":"Makes a copy of a shared project (`public`, or one in your workspace) in your workspace's top level: its canvas and settings, with files it imports copied over. Results and run history stay with the original.\n\nRequires scope `projects:share`.","tags":["Projects"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"201":{"description":"The copy.","content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"visibility":{"enum":["personal","team","public"],"type":"string","description":"`personal`: only its creator lists it. `team`: the whole workspace. `public`: the workspace, and anyone with its share link can view it read-only and make a copy."}},"required":["description","folderId","id","name","visibility"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:share"}},"/project-folders":{"post":{"operationId":"createProjectFolder","summary":"Create a folder","description":"Adds a project folder: a team one, a personal one (`scope: personal`), or one inside another folder, which takes that folder's scope.\n\nRequires scope `projects:write`.","tags":["Projects"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"examples":["Autumn campaign"]},"parentId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Inside this folder (and in its scope); top level otherwise.","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["team","personal"],"type":"string","description":"`team`: the workspace's projects and team folders. `personal`: the projects you made and your personal folders, which only you see. API keys act for the workspace: their `personal` is empty.","default":"team"}},"required":["name"]}}}},"responses":{"201":{"description":"The folder.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"isPersonal":{"type":"boolean"},"name":{"type":"string","examples":["Autumn campaign"]},"parentId":{"anyOf":[{"type":"string","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"projectCount":{"type":"integer","examples":[1]}},"required":["id","isPersonal","name","parentId","projectCount"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:write"},"get":{"operationId":"listProjectFolders","summary":"List folders","description":"A scope's top-level folders, or a folder's subfolders, with breadcrumbs to it.\n\nRequires scope `projects:read`.","tags":["Projects"],"parameters":[{"name":"parentId","in":"query","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The folder whose subfolders to list; the scope's top level when left out.","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"allowEmptyValue":true,"allowReserved":true},{"name":"scope","in":"query","schema":{"enum":["team","personal"],"type":"string","description":"`team`: the workspace's projects and team folders. `personal`: the projects you made and your personal folders, which only you see. API keys act for the workspace: their `personal` is empty.","default":"team"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The folders.","content":{"application/json":{"schema":{"type":"object","properties":{"folders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"isPersonal":{"type":"boolean"},"name":{"type":"string","examples":["Autumn campaign"]},"parentId":{"anyOf":[{"type":"string","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"projectCount":{"type":"integer","examples":[1]}},"required":["id","isPersonal","name","parentId","projectCount"]}},"path":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","name"]},"description":"Breadcrumbs to `parentId`, top level first."},"scope":{"enum":["team","personal"],"type":"string","description":"The scope listed: `parentId`'s when given."}},"required":["folders","path","scope"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:read"}},"/projects":{"post":{"operationId":"createProject","summary":"Create a project","description":"Starts a project (workflow) in a scope or folder, empty or from a template (`templateId`): personal ones are listed only for you.\n\nRequires scope `projects:write`.","tags":["Projects"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"folderId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The folder to put it in; its scope wins over `scope` (a personal folder makes the project personal).","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Its name; the template's title, or `Untitled workflow`, when left out.","examples":["Autumn campaign"]},"scope":{"enum":["team","personal"],"type":"string","description":"`team`: the workspace's projects and team folders. `personal`: the projects you made and your personal folders, which only you see. API keys act for the workspace: their `personal` is empty.","default":"team"},"templateId":{"type":"string","minLength":1,"maxLength":80,"description":"Start from this template (its `slug`): its canvas, with its example results as the project's first results.","examples":["9238906e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}}}}},"responses":{"201":{"description":"The new project.","content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"visibility":{"enum":["personal","team","public"],"type":"string","description":"`personal`: only its creator lists it. `team`: the whole workspace. `public`: the workspace, and anyone with its share link can view it read-only and make a copy."}},"required":["description","folderId","id","name","visibility"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:write"},"get":{"operationId":"listProjects","summary":"List projects","description":"Lists projects (workflows) a page at a time (50 at most): a scope's top level or a folder, or, with `search`, the whole scope by name. Each comes with a canvas preview, its asset and credit counts and its author. Pass `nextCursor` as `cursor` for the next page.\n\nRequires scope `projects:read`.","tags":["Projects"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","maxLength":400,"description":"`nextCursor` of the page before; leave out for the first."},"allowEmptyValue":true,"allowReserved":true},{"name":"folderId","in":"query","schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The folder to list; the top level when left out. Ignored while searching, which looks through the whole scope.","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":50},"allowEmptyValue":true,"allowReserved":true},{"name":"order","in":"query","schema":{"enum":["desc","asc"],"type":"string","default":"desc","description":"`desc`: newest first. `asc`: oldest first."},"allowEmptyValue":true,"allowReserved":true},{"name":"orderBy","in":"query","schema":{"enum":["updated","created"],"type":"string","default":"updated","description":"Sort by the last edit (`updated`) or by creation."},"allowEmptyValue":true,"allowReserved":true},{"name":"scope","in":"query","schema":{"enum":["team","personal"],"type":"string","description":"`team`: the workspace's projects and team folders. `personal`: the projects you made and your personal folders, which only you see. API keys act for the workspace: their `personal` is empty.","default":"team"},"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string","maxLength":200,"description":"Only projects whose name contains this (any case)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"A page of projects.","content":{"application/json":{"schema":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` for the next page; null on the last."},"projects":{"type":"array","items":{"type":"object","properties":{"assetCount":{"type":"integer","description":"Takes its generate steps have kept.","examples":[1]},"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","image","name"]},{"type":"null"}],"description":"Who made it; null for API keys."},"cover":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A short-lived download URL of the image chosen as its cover (Set as Cover); null: show `preview`."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsSpent":{"type":"integer","examples":[12]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"preview":{"type":"object","properties":{"bounds":{"type":"object","properties":{"h":{"type":"number","examples":[1]},"w":{"type":"number","examples":[1]},"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["h","w","x","y"]},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"type":"string"},"target":{"type":"string"}},"required":["id","source","target"]}},"nodes":{"type":"array","items":{"type":"object","properties":{"h":{"type":"number","examples":[1]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"image":{"type":"string","description":"The newest image the node made (download URL)."},"label":{"type":"string"},"parentId":{"type":"string","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"text":{"type":"string"},"type":{"type":"string"},"w":{"type":"number","examples":[1]},"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["h","id","label","type","w","x","y"]}}},"required":["bounds","edges","nodes"],"description":"The canvas as boxes, for a preview: each node's absolute rectangle, title and short text, and the edges between them. Nodes carry no `image` here."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["personal","team","public"],"type":"string","description":"`personal`: only its creator lists it. `team`: the whole workspace. `public`: the workspace, and anyone with its share link can view it read-only and make a copy."}},"required":["assetCount","author","cover","createdAt","creditsSpent","description","folderId","id","name","preview","updatedAt","visibility"]}}},"required":["nextCursor","projects"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:read"}},"/project-folders/{folderId}":{"delete":{"operationId":"deleteProjectFolder","summary":"Delete a folder","description":"Deletes a folder and its subfolders. The projects in them stay, at the top level.\n\nRequires scope `projects:delete`.","tags":["Projects"],"parameters":[{"name":"folderId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:delete"},"patch":{"operationId":"renameProjectFolder","summary":"Rename a folder","description":"Renames a folder.\n\nRequires scope `projects:write`.","tags":["Projects"],"parameters":[{"name":"folderId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"examples":["Autumn campaign"]}},"required":["name"]}}}},"responses":{"200":{"description":"The folder.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","name"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:write"}},"/projects/{workflowId}/duplicate":{"post":{"operationId":"duplicateProject","summary":"Duplicate a project","description":"Copies a project next to the original (same folder; a public one's copy is team-wide): its canvas and settings. Results and run history stay with the original.\n\nRequires scope `projects:write`.","tags":["Projects"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"201":{"description":"The copy.","content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"visibility":{"enum":["personal","team","public"],"type":"string","description":"`personal`: only its creator lists it. `team`: the whole workspace. `public`: the workspace, and anyone with its share link can view it read-only and make a copy."}},"required":["description","folderId","id","name","visibility"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:write"}},"/credit-usage":{"get":{"operationId":"getCreditUsage","summary":"Get credit usage","description":"Credits your workspace's generations have used this month (failed ones cost nothing).\n\nRequires scope `usage:read`.","tags":["Projects"],"responses":{"200":{"description":"This month's usage.","content":{"application/json":{"schema":{"type":"object","properties":{"creditsThisMonth":{"type":"integer","description":"Credits the workspace's generations used since the 1st (UTC).","examples":[12]}},"required":["creditsThisMonth"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"usage:read"}},"/project-folders/all":{"get":{"operationId":"listAllProjectFolders","summary":"List every folder","description":"Every folder you can put a project in: the team's and your personal ones, by name (for a move dialog).\n\nRequires scope `projects:read`.","tags":["Projects"],"responses":{"200":{"description":"The folders.","content":{"application/json":{"schema":{"type":"object","properties":{"folders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"isPersonal":{"type":"boolean"},"name":{"type":"string","examples":["Autumn campaign"]},"parentId":{"anyOf":[{"type":"string","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"projectCount":{"type":"integer","examples":[1]}},"required":["id","isPersonal","name","parentId","projectCount"]}}},"required":["folders"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:read"}},"/projects/{workflowId}/folder":{"put":{"operationId":"moveProject","summary":"Move a project","description":"Moves a project into a folder, or to the top level (`folderId: null`). The folder's scope decides who sees it: a team folder shares it with the workspace, a personal one keeps it yours (a public project stays public).\n\nRequires scope `projects:write`.","tags":["Projects"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"folderId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The folder; `null` for the top level. Moving into a team folder shares a personal project with the workspace; into a personal folder makes a team project personal (a public one stays public).","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["folderId"]}}}},"responses":{"200":{"description":"The project, moved.","content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"visibility":{"enum":["personal","team","public"],"type":"string","description":"`personal`: only its creator lists it. `team`: the whole workspace. `public`: the workspace, and anyone with its share link can view it read-only and make a copy."}},"required":["description","folderId","id","name","visibility"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:write"}},"/projects/{workflowId}":{"patch":{"operationId":"renameProject","summary":"Rename or describe a project","description":"Renames a project or changes its description. Its document and `version` stay as they are, so an open canvas keeps saving.\n\nRequires scope `projects:write`.","tags":["Projects"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","maxLength":1000,"description":"What the project is for, shown on its card.","examples":["Product shots for the autumn campaign."]},"name":{"type":"string","minLength":1,"maxLength":200,"examples":["Autumn campaign"]}}}}}},"responses":{"200":{"description":"The project.","content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"visibility":{"enum":["personal","team","public"],"type":"string","description":"`personal`: only its creator lists it. `team`: the whole workspace. `public`: the workspace, and anyone with its share link can view it read-only and make a copy."}},"required":["description","folderId","id","name","visibility"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:write"}},"/projects/{workflowId}/template":{"post":{"operationId":"saveProjectAsTemplate","summary":"Save a project as a template","description":"Saves a project as a template of your workspace's: its canvas, with each node's newest result kept as the template's example. `team` templates show for everyone in the workspace, `personal` ones for you only. Later edits to the project don't change it.\n\nRequires scope `templates:write`.","tags":["Projects"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","maxItems":4,"items":{"enum":["cinematic","advertising","fashion","branding","fmcg","fastfood","editing","campaigns"],"type":"string"},"default":[],"description":"Its categories on the Templates page."},"description":{"type":"string","maxLength":1000,"description":"What it makes; the project's description when left out.","examples":["Product shots for the autumn campaign."]},"title":{"type":"string","minLength":1,"maxLength":200,"description":"Its name; the project's when left out.","examples":["Autumn campaign"]},"visibility":{"enum":["personal","team"],"type":"string","default":"team","description":"`team`: everyone in the workspace sees it (the Templates page's Team chip). `personal`: only you (My templates)."}}}}}},"responses":{"201":{"description":"The template.","content":{"application/json":{"schema":{"type":"object","properties":{"coverThumbnailUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"A small WebP of the cover (download URL) for cards and tiles; null where none was made, so show `coverUrl`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"coverUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"The card's image at full size (download URL), once previews are made.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"outputKind":{"enum":["image","video","audio"],"type":"string","description":"What it mainly makes."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A short clip the card plays on hover (video templates).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"canDelete":{"type":"boolean","description":"You saved it, so you can delete it."},"categories":{"type":"array","items":{"enum":["cinematic","advertising","fashion","branding","fmcg","fastfood","editing","campaigns"],"type":"string"}},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"ownerName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Who saved it (a workspace's own); null for ours."},"slug":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]},"visibility":{"anyOf":[{"enum":["personal","team"],"type":"string"},{"type":"null"}],"description":"A workspace's own: `personal` (its maker only) or `team`. Null for ours, which everyone sees."}},"required":["coverThumbnailUrl","coverUrl","outputKind","previewUrl","canDelete","categories","description","ownerName","slug","title","visibility"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"templates:write"}},"/projects/{workflowId}/visibility":{"put":{"operationId":"setProjectVisibility","summary":"Set a project's visibility","description":"Sets who sees a project: `personal`, `team` or `public` (anyone with its share link, read-only, who can make a copy). Copying the share link in the app makes it `public`.\n\nRequires scope `projects:share`.","tags":["Projects"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"enum":["personal","team","public"],"type":"string","description":"`personal`: only its creator lists it. `team`: the whole workspace. `public`: the workspace, and anyone with its share link can view it read-only and make a copy."}},"required":["visibility"]}}}},"responses":{"200":{"description":"The project.","content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"folderId":{"anyOf":[{"type":"string","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"visibility":{"enum":["personal","team","public"],"type":"string","description":"`personal`: only its creator lists it. `team`: the whole workspace. `public`: the workspace, and anyone with its share link can view it read-only and make a copy."}},"required":["description","folderId","id","name","visibility"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"projects:share"}},"/references":{"post":{"operationId":"createReference","summary":"Create a reference","description":"Adds a style, colour palette, character or element of your own, in the Team or your Private scope. Images are storage keys of the workspace's own images.\n\nRequires scope `references:write`.","tags":["References"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"enum":["styles","colorPalettes","characters","elements"],"type":"string","description":"Where your own references go: `styles`, `colorPalettes`, `characters` or `elements`."},"colors":{"type":"array","maxItems":8,"items":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"description":"A palette's colours, in order."},"description":{"type":"string","maxLength":4000,"description":"What it is or looks like. Added to the prompt of nodes that use it.","examples":["Product shots for the autumn campaign."]},"images":{"type":"array","maxItems":10,"items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]}},"required":["key"],"description":"An image in your storage."},"description":"Reference images, in order. Sent with the request."},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only.","default":"team"},"title":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]}},"required":["category","title"],"description":"A new reference of your own."}}}},"responses":{"201":{"description":"The reference.","content":{"application/json":{"schema":{"type":"object","properties":{"category":{"enum":["styles","colorPalettes","characters","elements"],"type":"string","description":"Where your own references go: `styles`, `colorPalettes`, `characters` or `elements`."},"colors":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"images":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"title":{"type":"string","examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["category","colors","createdAt","description","id","images","ownerUserId","scope","title","updatedAt"],"description":"A reference of your workspace's own."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"references:write"},"get":{"operationId":"listReferences","summary":"List references","description":"The workspace's Team references and your Private ones, last edited first.\n\nRequires scope `references:read`.","tags":["References"],"parameters":[{"name":"category","in":"query","schema":{"enum":["styles","colorPalettes","characters","elements"],"type":"string","description":"Where your own references go: `styles`, `colorPalettes`, `characters` or `elements`."},"allowEmptyValue":true,"allowReserved":true},{"name":"q","in":"query","schema":{"type":"string","maxLength":120,"description":"Only those whose title contains this (any case)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The references.","content":{"application/json":{"schema":{"type":"object","properties":{"references":{"type":"array","items":{"type":"object","properties":{"category":{"enum":["styles","colorPalettes","characters","elements"],"type":"string","description":"Where your own references go: `styles`, `colorPalettes`, `characters` or `elements`."},"colors":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"images":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","exclusiveMinimum":0,"examples":[1280]},"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of the workspace's images: an upload's `key`, a generation output's `key` or a Library file's `key`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"The Library item it was picked from, if any.","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"width":{"type":"integer","exclusiveMinimum":0,"examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","contentType","url"],"description":"An image of a brand kit or moodboard."}},"ownerUserId":{"anyOf":[{"type":"string","examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"scope":{"enum":["private","team"],"type":"string","description":"`team`: every member of the workspace sees and uses it. `private`: only you (in this workspace). API keys act for the workspace, so they use `team` only."},"title":{"type":"string","examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["category","colors","createdAt","description","id","images","ownerUserId","scope","title","updatedAt"],"description":"A reference of your workspace's own."}}},"required":["references"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"references:read"}},"/references/{referenceId}":{"delete":{"operationId":"deleteReference","summary":"Delete a reference","description":"Deletes a reference of your own. Nodes that use it fail until it's removed from them.\n\nRequires scope `references:delete`.","tags":["References"],"parameters":[{"name":"referenceId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3c2b1a90-7d6e-4f5a-8b9c-0d1e2f3a4b5c"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"references:delete"}},"/references/bookmarks":{"get":{"operationId":"listReferenceBookmarks","summary":"List saved references","description":"The references the workspace saved, newest first.\n\nRequires scope `references:read`.","tags":["References"],"responses":{"200":{"description":"The saved references.","content":{"application/json":{"schema":{"type":"object","properties":{"bookmarks":{"type":"array","items":{"type":"object","properties":{"category":{"enum":["brandKits","moodboards","styles","colorPalettes","characters","elements","effects","cameraAngles","assets"],"type":"string","description":"A References modal tab: `brandKits`, `moodboards`, `styles`, `colorPalettes`, `characters`, `elements`, `effects` (image looks) or `cameraAngles`."},"referenceId":{"type":"string","minLength":1,"maxLength":200,"description":"A built-in's id, your own reference's id, `library:<itemId>`, or a brand kit's or moodboard's id.","examples":["9f22853f-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["category","referenceId"]}}},"required":["bookmarks"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"references:read"},"put":{"operationId":"setReferenceBookmark","summary":"Save a reference","description":"Saves a reference for the workspace, or unsaves it.\n\nRequires scope `references:write`.","tags":["References"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category":{"enum":["brandKits","moodboards","styles","colorPalettes","characters","elements","effects","cameraAngles","assets"],"type":"string","description":"A References modal tab: `brandKits`, `moodboards`, `styles`, `colorPalettes`, `characters`, `elements`, `effects` (image looks) or `cameraAngles`."},"referenceId":{"type":"string","minLength":1,"maxLength":200,"description":"A built-in's id, your own reference's id, `library:<itemId>`, or a brand kit's or moodboard's id.","examples":["9f22853f-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"saved":{"type":"boolean","description":"Save (true) or unsave (false)."}},"required":["category","referenceId","saved"]}}}},"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object","properties":{"category":{"enum":["brandKits","moodboards","styles","colorPalettes","characters","elements","effects","cameraAngles","assets"],"type":"string","description":"A References modal tab: `brandKits`, `moodboards`, `styles`, `colorPalettes`, `characters`, `elements`, `effects` (image looks) or `cameraAngles`."},"referenceId":{"type":"string","minLength":1,"maxLength":200,"description":"A built-in's id, your own reference's id, `library:<itemId>`, or a brand kit's or moodboard's id.","examples":["9f22853f-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"saved":{"type":"boolean","description":"Save (true) or unsave (false)."}},"required":["category","referenceId","saved"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"references:write"}},"/references/previews/{catalog}":{"get":{"operationId":"listReferencePreviews","summary":"List built-in previews","description":"Preview images of a catalogue's built-ins (a reference category, or the video Effects).\n\nRequires scope `references:read`.","tags":["References"],"parameters":[{"name":"catalog","in":"path","required":true,"schema":{"enum":["brandKits","moodboards","styles","colorPalettes","characters","elements","effects","cameraAngles","assets","videoEffects"],"type":"string","description":"A reference category, or `videoEffects` for the video Effects."}}],"responses":{"200":{"description":"Preview URLs by id.","content":{"application/json":{"schema":{"type":"object","properties":{"previews":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Preview image URLs (short-lived) by built-in id.","examples":[{}]}},"required":["previews"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"references:read"}},"/sprites/actions/{actionId}/sketches/{slot}":{"delete":{"operationId":"clearSpriteActionSketch","summary":"Remove a storyboard sketch","description":"Takes the sketch off a storyboard slot and deletes it; the slot's pinned frame stays.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"actionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f"]}},{"name":"slot","in":"path","required":true,"schema":{"enum":["open","beat","impact","end"],"type":"string","description":"The storyboard slot: `open`, `beat`, `impact` or `end`."}}],"responses":{"200":{"description":"The action.","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"object","properties":{"beats":{"type":"array","maxItems":64,"items":{"type":"string","maxLength":300},"description":"The beats of the motion, one per frame."},"cancelWindow":{"anyOf":[{"type":"object","properties":{"from":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"to":{"type":"integer","minimum":0,"maximum":63,"examples":[1]}},"required":["from","to"],"description":"Frames (inclusive) in which another action can cut in."},{"type":"null"}]},"clipSeconds":{"anyOf":[{"type":"integer","minimum":1,"maximum":15,"examples":[5]},{"type":"null"}],"description":"Length of a clip take, in seconds (`source` `clip`).","examples":[5]},"fps":{"type":"integer","minimum":1,"maximum":60,"examples":[1]},"frames":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"loopIn":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"loopOut":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"sort":{"type":"integer","minimum":0,"maximum":10000,"examples":[1]},"source":{"enum":["sheet","clip"],"type":"string","description":"`sheet`: one generated sheet, sliced. `clip`: frames taken from a video."},"storyboard":{"type":"object","properties":{"beat":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"end":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"impact":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"open":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]}},"description":"The action's pinned poses, by frame."},"characterId":{"type":"string","minLength":1,"maxLength":128,"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Unique per character; what exports name it.","examples":["attack"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["beats","cancelWindow","clipSeconds","fps","frames","loopIn","loopOut","playback","prompt","sort","source","storyboard","characterId","createdAt","id","key","name","updatedAt"],"description":"An action a character performs, with its timing."},"sketch":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The slot's sketch; `null` once cleared."}},"required":["action","sketch"],"description":"The action with the slot's sketch."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"},"put":{"operationId":"setSpriteActionSketch","summary":"Set a storyboard sketch","description":"Pins a sketch of the pose to a storyboard slot (at the slot's frame, its default when it isn't pinned yet). Sheet takes send it to the model as a pose reference for that frame; clip takes don't use sketches. Upload the image first (`POST /uploads`). Sending another replaces it.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"actionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f"]}},{"name":"slot","in":"path","required":true,"schema":{"enum":["open","beat","impact","end"],"type":"string","description":"The storyboard slot: `open`, `beat`, `impact` or `end`."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"The storage key of a PNG you uploaded (`POST /uploads`, then `PUT` it to the returned URL).","examples":["uploads/org_123/5d1c…/frame.png"]}},"required":["key"],"description":"A rough sketch of the pose, as a PNG or JPEG."}},"required":["image"]}}}},"responses":{"200":{"description":"The action with the sketch.","content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"object","properties":{"beats":{"type":"array","maxItems":64,"items":{"type":"string","maxLength":300},"description":"The beats of the motion, one per frame."},"cancelWindow":{"anyOf":[{"type":"object","properties":{"from":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"to":{"type":"integer","minimum":0,"maximum":63,"examples":[1]}},"required":["from","to"],"description":"Frames (inclusive) in which another action can cut in."},{"type":"null"}]},"clipSeconds":{"anyOf":[{"type":"integer","minimum":1,"maximum":15,"examples":[5]},{"type":"null"}],"description":"Length of a clip take, in seconds (`source` `clip`).","examples":[5]},"fps":{"type":"integer","minimum":1,"maximum":60,"examples":[1]},"frames":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"loopIn":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"loopOut":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"sort":{"type":"integer","minimum":0,"maximum":10000,"examples":[1]},"source":{"enum":["sheet","clip"],"type":"string","description":"`sheet`: one generated sheet, sliced. `clip`: frames taken from a video."},"storyboard":{"type":"object","properties":{"beat":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"end":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"impact":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"open":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]}},"description":"The action's pinned poses, by frame."},"characterId":{"type":"string","minLength":1,"maxLength":128,"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Unique per character; what exports name it.","examples":["attack"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["beats","cancelWindow","clipSeconds","fps","frames","loopIn","loopOut","playback","prompt","sort","source","storyboard","characterId","createdAt","id","key","name","updatedAt"],"description":"An action a character performs, with its timing."},"sketch":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The slot's sketch; `null` once cleared."}},"required":["action","sketch"],"description":"The action with the slot's sketch."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/characters/{characterId}/actions":{"post":{"operationId":"createSpriteAction","summary":"Create an action","description":"Adds an action to a character, after its others. Its key is made from the name unless you send one; a key the character already uses is refused.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"beats":{"type":"array","maxItems":64,"items":{"type":"string","maxLength":300},"description":"The beats of the motion, one per frame."},"cancelWindow":{"anyOf":[{"type":"object","properties":{"from":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"to":{"type":"integer","minimum":0,"maximum":63,"examples":[1]}},"required":["from","to"],"description":"Frames (inclusive) in which another action can cut in."},{"type":"null"}]},"clipSeconds":{"anyOf":[{"type":"integer","minimum":1,"maximum":15,"examples":[5]},{"type":"null"}],"description":"Length of a clip take, in seconds (`source` `clip`).","examples":[5]},"fps":{"type":"integer","minimum":1,"maximum":60,"examples":[1]},"frames":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"loopIn":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"loopOut":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"sort":{"type":"integer","minimum":0,"maximum":10000,"examples":[1]},"source":{"enum":["sheet","clip"],"type":"string","description":"`sheet`: one generated sheet, sliced. `clip`: frames taken from a video."},"storyboard":{"type":"object","properties":{"beat":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"end":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"impact":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"open":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]}},"description":"The action's pinned poses, by frame."},"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:[-_][a-z0-9]+)*$","description":"Lowercase letters and digits, joined by `-` or `_`. Left out: made from the name.","examples":["attack"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Attack"]}},"required":["name"]}}}},"responses":{"201":{"description":"The action.","content":{"application/json":{"schema":{"type":"object","properties":{"beats":{"type":"array","maxItems":64,"items":{"type":"string","maxLength":300},"description":"The beats of the motion, one per frame."},"cancelWindow":{"anyOf":[{"type":"object","properties":{"from":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"to":{"type":"integer","minimum":0,"maximum":63,"examples":[1]}},"required":["from","to"],"description":"Frames (inclusive) in which another action can cut in."},{"type":"null"}]},"clipSeconds":{"anyOf":[{"type":"integer","minimum":1,"maximum":15,"examples":[5]},{"type":"null"}],"description":"Length of a clip take, in seconds (`source` `clip`).","examples":[5]},"fps":{"type":"integer","minimum":1,"maximum":60,"examples":[1]},"frames":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"loopIn":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"loopOut":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"sort":{"type":"integer","minimum":0,"maximum":10000,"examples":[1]},"source":{"enum":["sheet","clip"],"type":"string","description":"`sheet`: one generated sheet, sliced. `clip`: frames taken from a video."},"storyboard":{"type":"object","properties":{"beat":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"end":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"impact":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"open":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]}},"description":"The action's pinned poses, by frame."},"characterId":{"type":"string","minLength":1,"maxLength":128,"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Unique per character; what exports name it.","examples":["attack"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["beats","cancelWindow","clipSeconds","fps","frames","loopIn","loopOut","playback","prompt","sort","source","storyboard","characterId","createdAt","id","key","name","updatedAt"],"description":"An action a character performs, with its timing."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"},"get":{"operationId":"listSpriteActions","summary":"List a character's actions","description":"A character's actions, in their order.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"responses":{"200":{"description":"The actions.","content":{"application/json":{"schema":{"type":"object","properties":{"actions":{"type":"array","items":{"type":"object","properties":{"beats":{"type":"array","maxItems":64,"items":{"type":"string","maxLength":300},"description":"The beats of the motion, one per frame."},"cancelWindow":{"anyOf":[{"type":"object","properties":{"from":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"to":{"type":"integer","minimum":0,"maximum":63,"examples":[1]}},"required":["from","to"],"description":"Frames (inclusive) in which another action can cut in."},{"type":"null"}]},"clipSeconds":{"anyOf":[{"type":"integer","minimum":1,"maximum":15,"examples":[5]},{"type":"null"}],"description":"Length of a clip take, in seconds (`source` `clip`).","examples":[5]},"fps":{"type":"integer","minimum":1,"maximum":60,"examples":[1]},"frames":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"loopIn":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"loopOut":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"sort":{"type":"integer","minimum":0,"maximum":10000,"examples":[1]},"source":{"enum":["sheet","clip"],"type":"string","description":"`sheet`: one generated sheet, sliced. `clip`: frames taken from a video."},"storyboard":{"type":"object","properties":{"beat":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"end":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"impact":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"open":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]}},"description":"The action's pinned poses, by frame."},"characterId":{"type":"string","minLength":1,"maxLength":128,"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Unique per character; what exports name it.","examples":["attack"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["beats","cancelWindow","clipSeconds","fps","frames","loopIn","loopOut","playback","prompt","sort","source","storyboard","characterId","createdAt","id","key","name","updatedAt"],"description":"An action a character performs, with its timing."}}},"required":["actions"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/actions/{actionId}":{"delete":{"operationId":"deleteSpriteAction","summary":"Remove an action","description":"Removes an action and hides its takes. Its key is free again for a new action.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"actionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f"]}}],"responses":{"200":{"description":"Removed.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"},"patch":{"operationId":"updateSpriteAction","summary":"Update an action","description":"Changes an action's name, key, prompt, timing, beats, storyboard or source: the fields you send replace theirs; the rest stay. Loop points, storyboard keys and the cancel window have to fall inside its frames.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"actionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"beats":{"type":"array","maxItems":64,"items":{"type":"string","maxLength":300},"description":"The beats of the motion, one per frame."},"cancelWindow":{"anyOf":[{"type":"object","properties":{"from":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"to":{"type":"integer","minimum":0,"maximum":63,"examples":[1]}},"required":["from","to"],"description":"Frames (inclusive) in which another action can cut in."},{"type":"null"}]},"clipSeconds":{"anyOf":[{"type":"integer","minimum":1,"maximum":15,"examples":[5]},{"type":"null"}],"description":"Length of a clip take, in seconds (`source` `clip`).","examples":[5]},"fps":{"type":"integer","minimum":1,"maximum":60,"examples":[1]},"frames":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"loopIn":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"loopOut":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"sort":{"type":"integer","minimum":0,"maximum":10000,"examples":[1]},"source":{"enum":["sheet","clip"],"type":"string","description":"`sheet`: one generated sheet, sliced. `clip`: frames taken from a video."},"storyboard":{"type":"object","properties":{"beat":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"end":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"impact":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"open":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]}},"description":"The action's pinned poses, by frame."},"key":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9]+(?:[-_][a-z0-9]+)*$","description":"Lowercase letters and digits, joined by `-` or `_`. Left out: made from the name.","examples":["attack"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]}}}}}},"responses":{"200":{"description":"The action.","content":{"application/json":{"schema":{"type":"object","properties":{"beats":{"type":"array","maxItems":64,"items":{"type":"string","maxLength":300},"description":"The beats of the motion, one per frame."},"cancelWindow":{"anyOf":[{"type":"object","properties":{"from":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"to":{"type":"integer","minimum":0,"maximum":63,"examples":[1]}},"required":["from","to"],"description":"Frames (inclusive) in which another action can cut in."},{"type":"null"}]},"clipSeconds":{"anyOf":[{"type":"integer","minimum":1,"maximum":15,"examples":[5]},{"type":"null"}],"description":"Length of a clip take, in seconds (`source` `clip`).","examples":[5]},"fps":{"type":"integer","minimum":1,"maximum":60,"examples":[1]},"frames":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"loopIn":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"loopOut":{"anyOf":[{"type":"integer","minimum":0,"maximum":63,"examples":[1]},{"type":"null"}],"examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"sort":{"type":"integer","minimum":0,"maximum":10000,"examples":[1]},"source":{"enum":["sheet","clip"],"type":"string","description":"`sheet`: one generated sheet, sliced. `clip`: frames taken from a video."},"storyboard":{"type":"object","properties":{"beat":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"end":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"impact":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]},"open":{"type":"object","properties":{"frame":{"type":"integer","minimum":0,"maximum":63,"examples":[1]},"sketchKey":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["frame"]}},"description":"The action's pinned poses, by frame."},"characterId":{"type":"string","minLength":1,"maxLength":128,"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Unique per character; what exports name it.","examples":["attack"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["beats","cancelWindow","clipSeconds","fps","frames","loopIn","loopOut","playback","prompt","sort","source","storyboard","characterId","createdAt","id","key","name","updatedAt"],"description":"An action a character performs, with its timing."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/games/{gameId}/characters":{"post":{"operationId":"createSpriteCharacter","summary":"Create a character","description":"Adds a character to a game's cast. It's also a Library item (kind `sprite`) in the Team Library's Sprites folder, and starts with the standard actions (idle, walk, run, attack, jump, hurt and death) and no master. `convertedFromItemId` names a Library character it's made from.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"gameId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3c6f2a51-9d0e-4b7a-8f12-6e4d0c9b7a21"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"palette":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]},"role":{"type":"string","minLength":1,"maxLength":40,"examples":["skin"]}},"required":["hex","role"],"description":"A colour of the palette and what it's for."}},"prompt":{"type":"string","maxLength":4000,"description":"What the character looks like, for its master.","examples":["A lighthouse on a cliff at dusk, cinematic"]},"role":{"type":"string","maxLength":60},"rules":{"type":"string","maxLength":2000},"sizeClass":{"enum":["small","medium","large"],"type":"string"},"convertedFromItemId":{"type":"string","minLength":1,"maxLength":128,"description":"A Library character (kind `character`) the sprite is made from.","examples":["a7447df4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"folderId":{"type":"string","minLength":1,"maxLength":128,"description":"The folder to keep it in; left out: the top level.","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Ember knight"]}},"required":["name"]}}}},"responses":{"201":{"description":"The character.","content":{"application/json":{"schema":{"type":"object","properties":{"convertedFromItemId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["a7447df4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The Library item it was converted from, if any.","examples":["a7447df4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"counts":{"type":"object","properties":{"actions":{"type":"integer","examples":[1]},"approved":{"type":"integer","description":"Approved takes.","examples":[1]},"takes":{"type":"integer","description":"Takes in all.","examples":[1]}},"required":["actions","approved","takes"],"description":"How far its animation has come."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"currentOutfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["581b2a39-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The outfit it's shown in; `null`: the base outfit.","examples":["581b2a39-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"folderId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The folder it's kept in; `null`: the top level.","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"gameId":{"type":"string","minLength":1,"maxLength":128,"examples":["86c3e75d-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"imported":{"anyOf":[{"type":"object","properties":{"action":{"type":"string","description":"The action it was imported as."},"cell":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"description":"Cell size, `[width, height]` in px."},"file":{"type":"string","description":"The file's name, as uploaded."},"grid":{"type":"object","properties":{"cellH":{"type":"number","examples":[1]},"cellW":{"type":"number","examples":[1]},"cols":{"type":"number","examples":[1]},"gapX":{"type":"number","examples":[1]},"gapY":{"type":"number","examples":[1]},"offsetX":{"type":"number","examples":[1]},"offsetY":{"type":"number","examples":[1]},"rows":{"type":"number","examples":[1]}},"required":["cellH","cellW","cols","gapX","gapY","offsetX","offsetY","rows"],"description":"The grid it was sliced with, in sheet px."},"height":{"type":"number","description":"Height of the figure, in px.","examples":[1280]},"importId":{"type":"string","description":"The import that brought it in (`GET /sprites/imports/{importId}`).","examples":["1b0c94d4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"palette":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","properties":{"actionKey":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"actionName":{"type":"string"},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"fps":{"type":"number","examples":[1]},"frames":{"type":"number","examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"row":{"type":"number","examples":[1]}},"required":["direction","frames","row"]},"description":"How its rows were mapped to actions and directions."},"sourceKey":{"type":"string","description":"The sheet, as kept for the character.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["action","cell","file","height","palette"],"description":"The sheet it was imported from."},{"type":"null"}]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"Its Library item (kind `sprite`, type `element`).","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"master":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The approved master's largest image; `null` until one."},"masterVersionId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The approved master (a Library version); `null` until one.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"palette":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]},"role":{"type":"string","minLength":1,"maxLength":40,"examples":["skin"]}},"required":["hex","role"],"description":"A colour of the palette and what it's for."}},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"role":{"type":"string","examples":["Hero"]},"rules":{"type":"string","description":"Identity rules every frame keeps, one per sentence.","examples":["Hood always up."]},"sizeClass":{"enum":["small","medium","large"],"type":"string"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["convertedFromItemId","counts","createdAt","currentOutfitId","folderId","gameId","id","imported","libraryItemId","master","masterVersionId","name","palette","prompt","role","rules","sizeClass","updatedAt"],"description":"A character of a game's cast."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"},"get":{"operationId":"listSpriteCharacters","summary":"List a game's characters","description":"A game's cast, oldest first, each with its master's image, size class, role and how many of its takes are approved.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"gameId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3c6f2a51-9d0e-4b7a-8f12-6e4d0c9b7a21"]}}],"responses":{"200":{"description":"The characters.","content":{"application/json":{"schema":{"type":"object","properties":{"characters":{"type":"array","items":{"type":"object","properties":{"convertedFromItemId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["a7447df4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The Library item it was converted from, if any.","examples":["a7447df4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"counts":{"type":"object","properties":{"actions":{"type":"integer","examples":[1]},"approved":{"type":"integer","description":"Approved takes.","examples":[1]},"takes":{"type":"integer","description":"Takes in all.","examples":[1]}},"required":["actions","approved","takes"],"description":"How far its animation has come."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"currentOutfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["581b2a39-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The outfit it's shown in; `null`: the base outfit.","examples":["581b2a39-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"folderId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The folder it's kept in; `null`: the top level.","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"gameId":{"type":"string","minLength":1,"maxLength":128,"examples":["86c3e75d-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"imported":{"anyOf":[{"type":"object","properties":{"action":{"type":"string","description":"The action it was imported as."},"cell":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"description":"Cell size, `[width, height]` in px."},"file":{"type":"string","description":"The file's name, as uploaded."},"grid":{"type":"object","properties":{"cellH":{"type":"number","examples":[1]},"cellW":{"type":"number","examples":[1]},"cols":{"type":"number","examples":[1]},"gapX":{"type":"number","examples":[1]},"gapY":{"type":"number","examples":[1]},"offsetX":{"type":"number","examples":[1]},"offsetY":{"type":"number","examples":[1]},"rows":{"type":"number","examples":[1]}},"required":["cellH","cellW","cols","gapX","gapY","offsetX","offsetY","rows"],"description":"The grid it was sliced with, in sheet px."},"height":{"type":"number","description":"Height of the figure, in px.","examples":[1280]},"importId":{"type":"string","description":"The import that brought it in (`GET /sprites/imports/{importId}`).","examples":["1b0c94d4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"palette":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","properties":{"actionKey":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"actionName":{"type":"string"},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"fps":{"type":"number","examples":[1]},"frames":{"type":"number","examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"row":{"type":"number","examples":[1]}},"required":["direction","frames","row"]},"description":"How its rows were mapped to actions and directions."},"sourceKey":{"type":"string","description":"The sheet, as kept for the character.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["action","cell","file","height","palette"],"description":"The sheet it was imported from."},{"type":"null"}]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"Its Library item (kind `sprite`, type `element`).","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"master":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The approved master's largest image; `null` until one."},"masterVersionId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The approved master (a Library version); `null` until one.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"palette":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]},"role":{"type":"string","minLength":1,"maxLength":40,"examples":["skin"]}},"required":["hex","role"],"description":"A colour of the palette and what it's for."}},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"role":{"type":"string","examples":["Hero"]},"rules":{"type":"string","description":"Identity rules every frame keeps, one per sentence.","examples":["Hood always up."]},"sizeClass":{"enum":["small","medium","large"],"type":"string"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["convertedFromItemId","counts","createdAt","currentOutfitId","folderId","gameId","id","imported","libraryItemId","master","masterVersionId","name","palette","prompt","role","rules","sizeClass","updatedAt"],"description":"A character of a game's cast."}}},"required":["characters"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/characters/{characterId}/dna":{"get":{"operationId":"getSpriteCharacterDna","summary":"Get a character's Sprite DNA","description":"A character's Sprite DNA, as its export ships it: the JSON and a Markdown brief any LLM or image model can follow. Its animations' timing and gameplay come from their approved takes.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"responses":{"200":{"description":"The DNA.","content":{"application/json":{"schema":{"type":"object","properties":{"dna":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The DNA as JSON (schema `remagica.sprite-dna/1`): identity, style traits, palette, proportions, animations with their timing, keyframes, gameplay and status per direction, and the master's file names.","examples":[{}]},"markdown":{"type":"string","description":"The same DNA as a Markdown brief, ending with a prompt any image model can follow."}},"required":["dna","markdown"],"description":"Everything that makes a character itself, as exports ship it (`dna.json` and `DNA.md`)."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/characters/{characterId}":{"get":{"operationId":"getSpriteCharacter","summary":"Get a character","description":"Requires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"responses":{"200":{"description":"The character.","content":{"application/json":{"schema":{"type":"object","properties":{"convertedFromItemId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["a7447df4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The Library item it was converted from, if any.","examples":["a7447df4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"counts":{"type":"object","properties":{"actions":{"type":"integer","examples":[1]},"approved":{"type":"integer","description":"Approved takes.","examples":[1]},"takes":{"type":"integer","description":"Takes in all.","examples":[1]}},"required":["actions","approved","takes"],"description":"How far its animation has come."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"currentOutfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["581b2a39-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The outfit it's shown in; `null`: the base outfit.","examples":["581b2a39-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"folderId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The folder it's kept in; `null`: the top level.","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"gameId":{"type":"string","minLength":1,"maxLength":128,"examples":["86c3e75d-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"imported":{"anyOf":[{"type":"object","properties":{"action":{"type":"string","description":"The action it was imported as."},"cell":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"description":"Cell size, `[width, height]` in px."},"file":{"type":"string","description":"The file's name, as uploaded."},"grid":{"type":"object","properties":{"cellH":{"type":"number","examples":[1]},"cellW":{"type":"number","examples":[1]},"cols":{"type":"number","examples":[1]},"gapX":{"type":"number","examples":[1]},"gapY":{"type":"number","examples":[1]},"offsetX":{"type":"number","examples":[1]},"offsetY":{"type":"number","examples":[1]},"rows":{"type":"number","examples":[1]}},"required":["cellH","cellW","cols","gapX","gapY","offsetX","offsetY","rows"],"description":"The grid it was sliced with, in sheet px."},"height":{"type":"number","description":"Height of the figure, in px.","examples":[1280]},"importId":{"type":"string","description":"The import that brought it in (`GET /sprites/imports/{importId}`).","examples":["1b0c94d4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"palette":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","properties":{"actionKey":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"actionName":{"type":"string"},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"fps":{"type":"number","examples":[1]},"frames":{"type":"number","examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"row":{"type":"number","examples":[1]}},"required":["direction","frames","row"]},"description":"How its rows were mapped to actions and directions."},"sourceKey":{"type":"string","description":"The sheet, as kept for the character.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["action","cell","file","height","palette"],"description":"The sheet it was imported from."},{"type":"null"}]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"Its Library item (kind `sprite`, type `element`).","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"master":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The approved master's largest image; `null` until one."},"masterVersionId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The approved master (a Library version); `null` until one.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"palette":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]},"role":{"type":"string","minLength":1,"maxLength":40,"examples":["skin"]}},"required":["hex","role"],"description":"A colour of the palette and what it's for."}},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"role":{"type":"string","examples":["Hero"]},"rules":{"type":"string","description":"Identity rules every frame keeps, one per sentence.","examples":["Hood always up."]},"sizeClass":{"enum":["small","medium","large"],"type":"string"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["convertedFromItemId","counts","createdAt","currentOutfitId","folderId","gameId","id","imported","libraryItemId","master","masterVersionId","name","palette","prompt","role","rules","sizeClass","updatedAt"],"description":"A character of a game's cast."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"},"patch":{"operationId":"updateSpriteCharacter","summary":"Update a character","description":"Changes a character: the fields you send replace theirs; the rest stay. A new name renames its Library item too. `masterVersionId` switches which of its master versions it's animated from (and renders its colour skins again from that one).\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"palette":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]},"role":{"type":"string","minLength":1,"maxLength":40,"examples":["skin"]}},"required":["hex","role"],"description":"A colour of the palette and what it's for."}},"prompt":{"type":"string","maxLength":4000,"description":"What the character looks like, for its master.","examples":["A lighthouse on a cliff at dusk, cinematic"]},"role":{"type":"string","maxLength":60},"rules":{"type":"string","maxLength":2000},"sizeClass":{"enum":["small","medium","large"],"type":"string"},"currentOutfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["581b2a39-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Show it in one of its outfits; `null`: the base outfit.","examples":["581b2a39-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"folderId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Move it into a folder; `null`: to the top level. Folders only keep things in order: its look stays as it is.","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"type":"string","minLength":1,"maxLength":128,"description":"Make another of its master versions (a version of its Library item with a master image) the one it's animated from.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]}}}}}},"responses":{"200":{"description":"The character.","content":{"application/json":{"schema":{"type":"object","properties":{"convertedFromItemId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["a7447df4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The Library item it was converted from, if any.","examples":["a7447df4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"counts":{"type":"object","properties":{"actions":{"type":"integer","examples":[1]},"approved":{"type":"integer","description":"Approved takes.","examples":[1]},"takes":{"type":"integer","description":"Takes in all.","examples":[1]}},"required":["actions","approved","takes"],"description":"How far its animation has come."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"currentOutfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["581b2a39-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The outfit it's shown in; `null`: the base outfit.","examples":["581b2a39-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"folderId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The folder it's kept in; `null`: the top level.","examples":["899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"gameId":{"type":"string","minLength":1,"maxLength":128,"examples":["86c3e75d-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"imported":{"anyOf":[{"type":"object","properties":{"action":{"type":"string","description":"The action it was imported as."},"cell":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"description":"Cell size, `[width, height]` in px."},"file":{"type":"string","description":"The file's name, as uploaded."},"grid":{"type":"object","properties":{"cellH":{"type":"number","examples":[1]},"cellW":{"type":"number","examples":[1]},"cols":{"type":"number","examples":[1]},"gapX":{"type":"number","examples":[1]},"gapY":{"type":"number","examples":[1]},"offsetX":{"type":"number","examples":[1]},"offsetY":{"type":"number","examples":[1]},"rows":{"type":"number","examples":[1]}},"required":["cellH","cellW","cols","gapX","gapY","offsetX","offsetY","rows"],"description":"The grid it was sliced with, in sheet px."},"height":{"type":"number","description":"Height of the figure, in px.","examples":[1280]},"importId":{"type":"string","description":"The import that brought it in (`GET /sprites/imports/{importId}`).","examples":["1b0c94d4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"palette":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"object","properties":{"actionKey":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"actionName":{"type":"string"},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"fps":{"type":"number","examples":[1]},"frames":{"type":"number","examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"row":{"type":"number","examples":[1]}},"required":["direction","frames","row"]},"description":"How its rows were mapped to actions and directions."},"sourceKey":{"type":"string","description":"The sheet, as kept for the character.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["action","cell","file","height","palette"],"description":"The sheet it was imported from."},{"type":"null"}]},"libraryItemId":{"type":"string","minLength":1,"maxLength":128,"description":"Its Library item (kind `sprite`, type `element`).","examples":["17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"master":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The approved master's largest image; `null` until one."},"masterVersionId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The approved master (a Library version); `null` until one.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"palette":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]},"role":{"type":"string","minLength":1,"maxLength":40,"examples":["skin"]}},"required":["hex","role"],"description":"A colour of the palette and what it's for."}},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"role":{"type":"string","examples":["Hero"]},"rules":{"type":"string","description":"Identity rules every frame keeps, one per sentence.","examples":["Hood always up."]},"sizeClass":{"enum":["small","medium","large"],"type":"string"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["convertedFromItemId","counts","createdAt","currentOutfitId","folderId","gameId","id","imported","libraryItemId","master","masterVersionId","name","palette","prompt","role","rules","sizeClass","updatedAt"],"description":"A character of a game's cast."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/characters/{characterId}/drift/active":{"get":{"operationId":"getActiveSpriteDriftRun","summary":"Get a character's running drift fix","description":"The character's drift run still going (queued or running), so a page opened mid-run can follow it; `run` is null when none is. A character runs one fix at a time: starting another meanwhile is refused with `CONFLICT`.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"responses":{"200":{"description":"The run, or null.","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"anyOf":[{"type":"object","properties":{"characterId":{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string"},"creditCap":{"type":"integer","examples":[1]},"credits":{"type":"integer","description":"Credits spent, once the run ended.","examples":[12]},"held":{"type":"integer","examples":[1]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"now":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The frame being redrawn now."},"outfitId":{"anyOf":[{"type":"string","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"queue":{"type":"array","items":{"type":"object","properties":{"before":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"best":{"anyOf":[{"type":"number","minimum":0,"maximum":1,"examples":[1]},{"type":"null"}],"examples":[1]},"frameId":{"type":"string","examples":["f68c2bb4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"status":{"enum":["pending","fixed","low"],"type":"string"},"takeId":{"type":"string","examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tries":{"type":"integer","examples":[1]}},"required":["before","best","frameId","label","status","takeId","tries"]}},"result":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":["Fixed 3 of 4 for 12 credits. Still low after 2 tries: walk, right, frame 6. Open them to touch up."]},"status":{"enum":["queued","running","done","failed"],"type":"string"},"stoppedAtCap":{"type":"boolean"},"threshold":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"triesPerFrame":{"type":"integer","examples":[1]},"updatedAt":{"type":"string"}},"required":["characterId","createdAt","creditCap","credits","held","id","model","now","outfitId","queue","result","status","stoppedAtCap","threshold","triesPerFrame","updatedAt"],"description":"A drift run: what it queued and how each frame ended."},{"type":"null"}],"description":"The run still going (queued or running), or null."}},"required":["run"],"description":"A character's drift run in progress, if any."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/characters/{characterId}/drift/fix":{"post":{"operationId":"fixSpriteDrift","summary":"Fix drifted frames","description":"Redraws the character's frames scoring below the line (unlocked ones, worst first, at most 32) to match the master: up to `triesPerFrame` image edits each, cleaned up and scored again, one that clears the line replacing the frame (its old file kept for revert). One credit hold of at most `creditCap` covers the run, and it stops before a call would spend past the cap. Follow it on the studio's live feed (topic `drift`) or with `GET /sprites/drift/{runId}`.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"outfitId":{"type":"string","minLength":1,"maxLength":128,"description":"That outfit's takes; the base outfit's otherwise.","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"takeId":{"type":"string","minLength":1,"maxLength":128,"description":"That take alone, its frames scored again first, whatever its outfit or whether it stands.","examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"threshold":{"type":"number","minimum":0.5,"maximum":0.99,"description":"Frames scoring below it are flagged, from 0.5 to 0.99. Default 0.9.","examples":[0.9]},"creditCap":{"type":"integer","minimum":1,"maximum":100000,"description":"The most the run may spend, in credits.","examples":[20]},"idempotencyKey":{"type":"string","minLength":1,"maxLength":255,"description":"Sending the same key again returns the same run.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"triesPerFrame":{"type":"integer","minimum":1,"maximum":3,"description":"Redraws per frame before it's left for a touch-up.","examples":[2]}},"required":["creditCap","triesPerFrame"]}}}},"responses":{"202":{"description":"Accepted: the run is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the run set aside: every try at its worst, at most the cap.","examples":[12]},"frames":{"type":"integer","description":"Frames queued, worst first.","examples":[1]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"examples":[3]},"runId":{"type":"string","description":"The run. Follow it on the studio's live feed (topic `drift`) or with `GET /sprites/drift/{runId}`.","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["credits","frames","model","priceVersion","runId"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/characters/{characterId}/drift":{"get":{"operationId":"getSpriteDriftReport","summary":"Get a character's drift report","description":"Scores of every frame of each animation's standing take against the character's master (1 is identical), the frames below `threshold` worst first, counts, the take checks and what one try of a fix costs.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}},{"name":"outfitId","in":"query","schema":{"type":"string","minLength":1,"maxLength":128,"description":"That outfit's takes; the base outfit's otherwise.","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"allowEmptyValue":true,"allowReserved":true},{"name":"takeId","in":"query","schema":{"type":"string","minLength":1,"maxLength":128,"description":"That take alone, its frames scored again first, whatever its outfit or whether it stands.","examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"allowEmptyValue":true,"allowReserved":true},{"name":"threshold","in":"query","schema":{"type":"number","minimum":0.5,"maximum":0.99,"description":"Frames scoring below it are flagged, from 0.5 to 0.99. Default 0.9.","examples":[0.9]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The report.","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","properties":{"animations":{"type":"integer","description":"Animations with a frame below the line.","examples":[1]},"fixable":{"type":"integer","description":"Frames below the line that aren't locked: what a fix redraws.","examples":[1]},"frames":{"type":"integer","examples":[1]},"low":{"type":"integer","examples":[1]},"unscored":{"type":"integer","examples":[1]}},"required":["animations","fixable","frames","low","unscored"]},"creditsPerTry":{"anyOf":[{"type":"integer","examples":[12]},{"type":"null"}],"description":"What one try of a frame fix costs at most, in credits (the edit and background removal); null when it isn't priced. A run sets aside min(cap, fixable × tries × this).","examples":[12]},"rows":{"type":"array","items":{"type":"object","properties":{"actionId":{"type":"string","examples":["c4f7ff02-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"actionName":{"type":"string"},"checks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"detail":{"type":"string"},"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string"},"ok":{"type":"boolean"}},"required":["detail","key","label","ok"]}},{"type":"null"}],"description":"Height, baseline, colours and palette, as the take's last scoring found them."},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"frameIds":{"type":"array","items":{"type":"string"}},"low":{"type":"integer","examples":[1]},"scores":{"type":"array","items":{"anyOf":[{"type":"number","minimum":0,"maximum":1,"examples":[1]},{"type":"null"}],"examples":[1]}},"status":{"enum":["queued","generating","draft","review","approved","failed"],"type":"string"},"takeId":{"type":"string","examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["actionId","actionName","checks","direction","frameIds","low","scores","status","takeId"]}},"scoreModel":{"type":"string","examples":["remagica-sim-2"]},"summary":{"type":"string"},"threshold":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"worst":{"type":"array","items":{"type":"object","properties":{"actionId":{"type":"string","examples":["c4f7ff02-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"frameId":{"type":"string","examples":["f68c2bb4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"index":{"type":"integer","examples":[1]},"label":{"type":"string","examples":["Walk, right, frame 6"]},"locked":{"type":"boolean"},"score":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"takeId":{"type":"string","examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["actionId","direction","frameId","index","label","locked","score","takeId"]},"description":"Every frame below the line, worst first."}},"required":["counts","creditsPerTry","rows","scoreModel","summary","threshold","worst"],"description":"How close every frame of each animation's standing take (the approved one, else the newest finished one) is to the master, 1 being identical."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/drift/{runId}":{"get":{"operationId":"getSpriteDriftRun","summary":"Get a drift run","description":"A drift run as it stands: each queued frame's tries and outcome, what it spent, and its result once it ended.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$","examples":["2f9b1c7d4e5a6b8c9d0e1f2a3b4c5d6e"]}}],"responses":{"200":{"description":"The run.","content":{"application/json":{"schema":{"type":"object","properties":{"characterId":{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string"},"creditCap":{"type":"integer","examples":[1]},"credits":{"type":"integer","description":"Credits spent, once the run ended.","examples":[12]},"held":{"type":"integer","examples":[1]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"now":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The frame being redrawn now."},"outfitId":{"anyOf":[{"type":"string","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"queue":{"type":"array","items":{"type":"object","properties":{"before":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"best":{"anyOf":[{"type":"number","minimum":0,"maximum":1,"examples":[1]},{"type":"null"}],"examples":[1]},"frameId":{"type":"string","examples":["f68c2bb4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"status":{"enum":["pending","fixed","low"],"type":"string"},"takeId":{"type":"string","examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"tries":{"type":"integer","examples":[1]}},"required":["before","best","frameId","label","status","takeId","tries"]}},"result":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":["Fixed 3 of 4 for 12 credits. Still low after 2 tries: walk, right, frame 6. Open them to touch up."]},"status":{"enum":["queued","running","done","failed"],"type":"string"},"stoppedAtCap":{"type":"boolean"},"threshold":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"triesPerFrame":{"type":"integer","examples":[1]},"updatedAt":{"type":"string"}},"required":["characterId","createdAt","creditCap","credits","held","id","model","now","outfitId","queue","result","status","stoppedAtCap","threshold","triesPerFrame","updatedAt"],"description":"A drift run: what it queued and how each frame ended."}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/exports":{"post":{"operationId":"createSpriteExport","summary":"Export sprites","description":"Exports the characters' animations (each direction's standing take, per outfit: the approved one, else the newest finished one) for an engine: sheets or one atlas per character at a whole-number scale, the engine's own files, `metadata.json`, gameplay data and Sprite DNA, zipped. Charges nothing. Follow it on the studio's live feed (topic `export`) or with `GET /sprites/exports/{exportId}`, which has the download link once it's ready.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"characterIds":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","minLength":1,"maxLength":128},"description":"The game's characters to export, one folder each.","examples":[["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]]},"engine":{"enum":["godot","unity","unreal","gamemaker","phaser","rpgmaker","aseprite","zip"],"type":"string","description":"The target: `godot` (SpriteFrames), `unity` (sliced sheets and clips), `unreal` (Paper2D atlas), `gamemaker` (sprites), `phaser` (JSON hash atlas and anims), `rpgmaker` (MZ character sheets), `aseprite` (sheet data with tags) or `zip` (every frame as a PNG).","examples":["godot"]},"gameId":{"type":"string","minLength":1,"maxLength":128,"examples":["5c2a9e1d-7b3f-4a6e-8d0c-2f1e3a4b5c6d"]},"layout":{"enum":["sheets","atlas"],"type":"string","default":"sheets","description":"`sheets`: a sheet per animation, a row per direction. `atlas`: one packed atlas per character, power-of-two sized."},"options":{"type":"object","properties":{"dna":{"type":"boolean","description":"Ship each character's Sprite DNA (`dna.json` and `DNA.md`). Default on."},"gameplay":{"type":"boolean","description":"Ship hurt and hit boxes, events and root motion: in the engine's own format where it has one, else in `gameplay.json`. Default on."},"mirrors":{"type":"boolean","description":"Draw mirrored directions (left from right); off, the engine flips the sprite itself (every supported engine can; RPG Maker gets its left row drawn either way). Default off."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"What the download is called. Default: the game's slug.","examples":["Autumn campaign"]},"padding":{"type":"integer","minimum":0,"maximum":16,"description":"Empty pixels between and around cells, in output px. Default 0.","examples":[1]},"takeId":{"type":"string","minLength":1,"maxLength":128,"description":"Only this take's animation. Default: every animation.","examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"trim":{"type":"boolean","description":"Crop every cell of a character to the box around all its frames (pivots move with it). Default off."}},"description":"What the bundle includes and how cells are cut."},"scale":{"type":"integer","minimum":1,"maximum":8,"default":1,"description":"Whole-number upscale: nearest neighbour for pixel styles, smooth for the rest.","examples":[2]},"idempotencyKey":{"type":"string","minLength":1,"maxLength":255,"description":"Sending the same key again returns the same export.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["characterIds","engine","gameId"]}}}},"responses":{"202":{"description":"Accepted: the export is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"exportId":{"type":"string","description":"The export: follow it on the studio's live feed (topic `export`) or with `GET /sprites/exports/{exportId}`.","examples":["4e8c2a1f6b3d5e7a9c0b1d2e3f4a5b6c"]},"status":{"enum":["queued","running","ready","failed"],"type":"string"}},"required":["exportId","status"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"},"get":{"operationId":"listSpriteExports","summary":"List exports","description":"A game's exports, newest first (the last 100).\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"gameId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["5c2a9e1d-7b3f-4a6e-8d0c-2f1e3a4b5c6d"]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The exports.","content":{"application/json":{"schema":{"type":"object","properties":{"exports":{"type":"array","items":{"type":"object","properties":{"characterIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"downloadUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A signed link to the ZIP while it's ready; null otherwise.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"engine":{"enum":["godot","unity","unreal","gamemaker","phaser","rpgmaker","aseprite","zip"],"type":"string"},"gameId":{"type":"string","examples":["86c3e75d-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"layout":{"enum":["sheets","atlas"],"type":"string"},"manifest":{"anyOf":[{"type":"object","properties":{"animations":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"character":{"type":"string"},"characterId":{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"fps":{"type":"integer","examples":[1]},"frames":{"type":"integer","examples":[1]},"id":{"type":"string","examples":["walk_E"]},"mirroredFrom":{"anyOf":[{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},{"type":"null"}]},"playback":{"type":"string"}},"required":["action","character","characterId","direction","fps","frames","id","mirroredFrom","playback"]}},"bytes":{"type":"integer","description":"The ZIP's size, once built.","examples":[2457600]},"engine":{"enum":["godot","unity","unreal","gamemaker","phaser","rpgmaker","aseprite","zip"],"type":"string"},"error":{"type":"string","description":"Why it failed, in plain words."},"files":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"integer","examples":[2457600]},"kind":{"enum":["image","text"],"type":"string"},"path":{"type":"string","examples":["ember_knight/ember_knight_walk.png"]}},"required":["kind","path"]}},"layout":{"enum":["sheets","atlas"],"type":"string"},"missing":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"character":{"type":"string"},"characterId":{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"}},"required":["action","character","characterId","direction"]},"description":"Actions and drawn directions with no finished take (base outfit): left out of the bundle."},"scale":{"type":"integer","examples":[1]},"sheets":{"type":"array","items":{"type":"object","properties":{"frames":{"type":"integer","examples":[1]},"height":{"type":"integer","examples":[1280]},"path":{"type":"string"},"width":{"type":"integer","examples":[1024]}},"required":["frames","height","path","width"]}}},"required":["animations","engine","files","layout","missing","scale","sheets"]},{"type":"null"}],"description":"Files, sheets, animations and gaps once built; on failure, `error` says why."},"options":{"type":"object","properties":{"dna":{"type":"boolean"},"gameplay":{"type":"boolean"},"mirrors":{"type":"boolean"},"padding":{"type":"integer","examples":[1]},"trim":{"type":"boolean"}},"required":["dna","gameplay","mirrors","padding","trim"]},"scale":{"type":"integer","examples":[1]},"status":{"enum":["queued","running","ready","failed"],"type":"string"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["characterIds","createdAt","downloadUrl","engine","gameId","id","layout","manifest","options","scale","status","updatedAt"]}}},"required":["exports"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/exports/{exportId}":{"get":{"operationId":"getSpriteExport","summary":"Get an export","description":"An export as it stands: its status, its manifest once built (files, sheets, animations and what's missing) and, while it's ready, a signed link to the ZIP.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"exportId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["4e8c2a1f6b3d5e7a9c0b1d2e3f4a5b6c"]}}],"responses":{"200":{"description":"The export.","content":{"application/json":{"schema":{"type":"object","properties":{"characterIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"downloadUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A signed link to the ZIP while it's ready; null otherwise.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"engine":{"enum":["godot","unity","unreal","gamemaker","phaser","rpgmaker","aseprite","zip"],"type":"string"},"gameId":{"type":"string","examples":["86c3e75d-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"layout":{"enum":["sheets","atlas"],"type":"string"},"manifest":{"anyOf":[{"type":"object","properties":{"animations":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"character":{"type":"string"},"characterId":{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"fps":{"type":"integer","examples":[1]},"frames":{"type":"integer","examples":[1]},"id":{"type":"string","examples":["walk_E"]},"mirroredFrom":{"anyOf":[{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},{"type":"null"}]},"playback":{"type":"string"}},"required":["action","character","characterId","direction","fps","frames","id","mirroredFrom","playback"]}},"bytes":{"type":"integer","description":"The ZIP's size, once built.","examples":[2457600]},"engine":{"enum":["godot","unity","unreal","gamemaker","phaser","rpgmaker","aseprite","zip"],"type":"string"},"error":{"type":"string","description":"Why it failed, in plain words."},"files":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"integer","examples":[2457600]},"kind":{"enum":["image","text"],"type":"string"},"path":{"type":"string","examples":["ember_knight/ember_knight_walk.png"]}},"required":["kind","path"]}},"layout":{"enum":["sheets","atlas"],"type":"string"},"missing":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"character":{"type":"string"},"characterId":{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"}},"required":["action","character","characterId","direction"]},"description":"Actions and drawn directions with no finished take (base outfit): left out of the bundle."},"scale":{"type":"integer","examples":[1]},"sheets":{"type":"array","items":{"type":"object","properties":{"frames":{"type":"integer","examples":[1]},"height":{"type":"integer","examples":[1280]},"path":{"type":"string"},"width":{"type":"integer","examples":[1024]}},"required":["frames","height","path","width"]}}},"required":["animations","engine","files","layout","missing","scale","sheets"]},{"type":"null"}],"description":"Files, sheets, animations and gaps once built; on failure, `error` says why."},"options":{"type":"object","properties":{"dna":{"type":"boolean"},"gameplay":{"type":"boolean"},"mirrors":{"type":"boolean"},"padding":{"type":"integer","examples":[1]},"trim":{"type":"boolean"}},"required":["dna","gameplay","mirrors","padding","trim"]},"scale":{"type":"integer","examples":[1]},"status":{"enum":["queued","running","ready","failed"],"type":"string"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["characterIds","createdAt","downloadUrl","engine","gameId","id","layout","manifest","options","scale","status","updatedAt"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/exports/pack":{"post":{"operationId":"packSpriteExports","summary":"Pack exports into one ZIP","description":"Puts ready exports in one ZIP: a folder's characters, each exported from a game of its own, as one bundle with a folder per character. Files the exports share as they are are kept once; an export whose files would clash goes in a folder of its own. Asking again for the same exports reuses the ZIP. Charges nothing.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"exportIds":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","minLength":1,"maxLength":128},"description":"Ready exports to put in one ZIP, each a game's characters (a folder's characters are each in a game of their own).","examples":[["4e8c2a1f6b3d5e7a9c0b1d2e3f4a5b6c"]]},"name":{"type":"string","minLength":1,"maxLength":80,"description":"What the download is called. Default: `sprites`.","examples":["Bosses"]}},"required":["exportIds"]}}}},"responses":{"200":{"description":"The ZIP's link.","content":{"application/json":{"schema":{"type":"object","properties":{"bytes":{"type":"integer","description":"The ZIP's size.","examples":[2457600]},"downloadUrl":{"type":"string","description":"A signed link to the ZIP, valid for an hour.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"files":{"type":"integer","description":"Files in the ZIP.","examples":[1]}},"required":["bytes","downloadUrl","files"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/exports/preview":{"post":{"operationId":"previewSpriteExport","summary":"Preview an export","description":"A dry run of an export: the files it would hold and each sheet's size, from the standing takes (approved, else the newest finished), without drawing anything. With trim on, sizes are before trimming.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"characterIds":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","minLength":1,"maxLength":128},"description":"The game's characters to export, one folder each.","examples":[["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]]},"engine":{"enum":["godot","unity","unreal","gamemaker","phaser","rpgmaker","aseprite","zip"],"type":"string","description":"The target: `godot` (SpriteFrames), `unity` (sliced sheets and clips), `unreal` (Paper2D atlas), `gamemaker` (sprites), `phaser` (JSON hash atlas and anims), `rpgmaker` (MZ character sheets), `aseprite` (sheet data with tags) or `zip` (every frame as a PNG).","examples":["godot"]},"gameId":{"type":"string","minLength":1,"maxLength":128,"examples":["5c2a9e1d-7b3f-4a6e-8d0c-2f1e3a4b5c6d"]},"layout":{"enum":["sheets","atlas"],"type":"string","default":"sheets","description":"`sheets`: a sheet per animation, a row per direction. `atlas`: one packed atlas per character, power-of-two sized."},"options":{"type":"object","properties":{"dna":{"type":"boolean","description":"Ship each character's Sprite DNA (`dna.json` and `DNA.md`). Default on."},"gameplay":{"type":"boolean","description":"Ship hurt and hit boxes, events and root motion: in the engine's own format where it has one, else in `gameplay.json`. Default on."},"mirrors":{"type":"boolean","description":"Draw mirrored directions (left from right); off, the engine flips the sprite itself (every supported engine can; RPG Maker gets its left row drawn either way). Default off."},"name":{"type":"string","minLength":1,"maxLength":80,"description":"What the download is called. Default: the game's slug.","examples":["Autumn campaign"]},"padding":{"type":"integer","minimum":0,"maximum":16,"description":"Empty pixels between and around cells, in output px. Default 0.","examples":[1]},"takeId":{"type":"string","minLength":1,"maxLength":128,"description":"Only this take's animation. Default: every animation.","examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"trim":{"type":"boolean","description":"Crop every cell of a character to the box around all its frames (pivots move with it). Default off."}},"description":"What the bundle includes and how cells are cut."},"scale":{"type":"integer","minimum":1,"maximum":8,"default":1,"description":"Whole-number upscale: nearest neighbour for pixel styles, smooth for the rest.","examples":[2]}},"required":["characterIds","engine","gameId"]}}}},"responses":{"200":{"description":"What the export would hold.","content":{"application/json":{"schema":{"type":"object","properties":{"animations":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"character":{"type":"string"},"characterId":{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"fps":{"type":"integer","examples":[1]},"frames":{"type":"integer","examples":[1]},"id":{"type":"string","examples":["walk_E"]},"mirroredFrom":{"anyOf":[{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},{"type":"null"}]},"playback":{"type":"string"}},"required":["action","character","characterId","direction","fps","frames","id","mirroredFrom","playback"]}},"engine":{"enum":["godot","unity","unreal","gamemaker","phaser","rpgmaker","aseprite","zip"],"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"bytes":{"type":"integer","examples":[2457600]},"kind":{"enum":["image","text"],"type":"string"},"path":{"type":"string","examples":["ember_knight/ember_knight_walk.png"]}},"required":["kind","path"]}},"layout":{"enum":["sheets","atlas"],"type":"string"},"missing":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string"},"character":{"type":"string"},"characterId":{"type":"string","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"}},"required":["action","character","characterId","direction"]},"description":"Actions and drawn directions with no finished take (base outfit): left out of the bundle."},"scale":{"type":"integer","examples":[1]},"sheets":{"type":"array","items":{"type":"object","properties":{"frames":{"type":"integer","examples":[1]},"height":{"type":"integer","examples":[1280]},"path":{"type":"string"},"width":{"type":"integer","examples":[1024]}},"required":["frames","height","path","width"]}},"trimmed":{"type":"boolean","description":"Whether trim is on: the sizes shown are before trimming, which only the export measures."}},"required":["animations","engine","files","layout","missing","scale","sheets","trimmed"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/folders":{"post":{"operationId":"createSpriteFolder","summary":"Create a folder","description":"Makes a folder for characters, at the top level or inside `parentId`.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Bosses"]},"parentId":{"type":"string","minLength":1,"maxLength":128,"description":"The folder to make it in; left out: the top level.","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["name"]}}}},"responses":{"201":{"description":"The folder.","content":{"application/json":{"schema":{"type":"object","properties":{"characters":{"type":"integer","description":"Characters kept directly in it (not in its subfolders).","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"parentId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The folder it sits in; `null`: the top level.","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["characters","createdAt","id","name","parentId","updatedAt"],"description":"A folder of the studio's characters."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"},"get":{"operationId":"listSpriteFolders","summary":"List folders","description":"Every folder in the workspace, by name, each with its parent and how many characters it holds.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[],"responses":{"200":{"description":"The folders.","content":{"application/json":{"schema":{"type":"object","properties":{"folders":{"type":"array","items":{"type":"object","properties":{"characters":{"type":"integer","description":"Characters kept directly in it (not in its subfolders).","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"parentId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The folder it sits in; `null`: the top level.","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["characters","createdAt","id","name","parentId","updatedAt"],"description":"A folder of the studio's characters."},"description":"Every folder in the workspace, by name."}},"required":["folders"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/folders/{folderId}":{"delete":{"operationId":"deleteSpriteFolder","summary":"Delete a folder","description":"Deletes a folder and its subfolders. The characters in them stay, at the top level.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"folderId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"},"patch":{"operationId":"updateSpriteFolder","summary":"Update a folder","description":"Renames a folder or moves it (`parentId`, `null` for the top level). A folder can't go inside itself or one of its subfolders.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"folderId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"parentId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Move it into another folder; `null`: to the top level. Never into itself or one of its own subfolders.","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}}}}},"responses":{"200":{"description":"The folder.","content":{"application/json":{"schema":{"type":"object","properties":{"characters":{"type":"integer","description":"Characters kept directly in it (not in its subfolders).","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"parentId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The folder it sits in; `null`: the top level.","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["characters","createdAt","id","name","parentId","updatedAt"],"description":"A folder of the studio's characters."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/frames/estimate":{"post":{"operationId":"estimateSpriteFrameEdit","summary":"Estimate a frame edit","description":"What a redraw (`count` 1) or `count` in-betweens of a take would set aside now, in credits: each frame an image edit and, at worst, background removal. Nothing is started or charged.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","minimum":1,"maximum":3,"description":"Frames it draws: 1 for a redraw (the default), up to 3 in-betweens.","examples":[1]},"model":{"type":"string","minLength":1,"maxLength":200,"description":"A base image model (`google/nano-banana-pro`, `openai/gpt-image-2`, `google/nano-banana-2.1`) or its `sprite_frame_fix/…` id. Left out: the game's.","examples":["google/nano-banana-pro"]},"takeId":{"type":"string","minLength":1,"maxLength":128,"examples":["6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9e"]}},"required":["takeId"]}}}},"responses":{"200":{"description":"What the request would set aside.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the request sets aside, in credits: its worst case.","examples":[12]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"description":"The price revision it's priced at.","examples":[3]}},"required":["credits","model","priceVersion"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/frames/{frameId}/fix":{"post":{"operationId":"fixSpriteFrame","summary":"Redraw a frame","description":"Redraws one frame to match the master, with the frames either side as references and your prompt's change; with `region`, only that box is replaced (feathered into the frame). The old file is kept for revert. Holds credits for the worst case and settles at what ran; the take is scored again and an approved take goes back to review. Locked frames and takes still running are refused. Follow it on the live feed (`GET /sprites/events`, topic `take`, by take id), then read the take.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"frameId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["f68c2bb4-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":200,"description":"A base image model (`google/nano-banana-pro`, `openai/gpt-image-2`, `google/nano-banana-2.1`) or its `sprite_frame_fix/…` id. Left out: the game's.","examples":["google/nano-banana-pro"]},"prompt":{"type":"string","maxLength":2000,"description":"What to change, in your words.","examples":["Shorten the blade"]},"region":{"type":"object","properties":{"h":{"type":"integer","minimum":1,"maximum":4096,"examples":[1]},"w":{"type":"integer","minimum":1,"maximum":4096,"examples":[1]},"x":{"type":"integer","minimum":0,"maximum":4096,"examples":[1]},"y":{"type":"integer","minimum":0,"maximum":4096,"examples":[1]}},"required":["h","w","x","y"],"description":"Only this box is redrawn, in frame pixels from the top left; the rest of the frame stays as it is."}}}}}},"responses":{"202":{"description":"Accepted: the redraw is held and started.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the request sets aside: every frame at its worst.","examples":[12]},"model":{"type":"string","description":"The capability model it runs.","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"examples":[3]},"requestId":{"type":"string","minLength":1,"maxLength":128,"description":"The request: its credit hold's subject.","examples":["2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"takeId":{"type":"string","minLength":1,"maxLength":128,"description":"The take it changes: follow it on the live feed (`GET /sprites/events`, topic `take`).","examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["credits","model","priceVersion","requestId","takeId"],"description":"A frame edit, held and started."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/frames/tween":{"post":{"operationId":"tweenSpriteFrames","summary":"Add in-betweens","description":"Draws 1 to 3 in-betweens between the frames at `afterIndex` and `afterIndex + 1`, from both frames and the master. They're inserted after the first (flagged `isTween`), and the later frames, the action's frame count, loop points, storyboard keys, cancel window and beats move along. Holds credits for every frame at its worst and settles at what ran; an approved take goes back to review. Follow it on the live feed (`GET /sprites/events`, topic `take`, by take id), then read the take.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"afterIndex":{"type":"integer","minimum":0,"description":"The frame they go after (0-based); they lead to the frame after it.","examples":[1]},"count":{"type":"integer","minimum":1,"maximum":3,"description":"In-betweens to draw, 1 to 3.","examples":[1]},"model":{"type":"string","minLength":1,"maxLength":200,"description":"A base image model (`google/nano-banana-pro`, `openai/gpt-image-2`, `google/nano-banana-2.1`) or its `sprite_frame_fix/…` id. Left out: the game's.","examples":["google/nano-banana-pro"]},"takeId":{"type":"string","minLength":1,"maxLength":128,"examples":["6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9e"]}},"required":["afterIndex","count","takeId"]}}}},"responses":{"202":{"description":"Accepted: the in-betweens are held and started.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the request sets aside: every frame at its worst.","examples":[12]},"model":{"type":"string","description":"The capability model it runs.","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"examples":[3]},"requestId":{"type":"string","minLength":1,"maxLength":128,"description":"The request: its credit hold's subject.","examples":["2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"takeId":{"type":"string","minLength":1,"maxLength":128,"description":"The take it changes: follow it on the live feed (`GET /sprites/events`, topic `take`).","examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["credits","model","priceVersion","requestId","takeId"],"description":"A frame edit, held and started."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"sprites:write"}},"/sprites/frames/{frameId}":{"delete":{"operationId":"deleteSpriteFrame","summary":"Remove a frame","description":"Removes an unlocked frame (an in-between or any other) and moves the later frames back one, with the action's loop points, storyboard keys and cancel window. The take is scored again; an approved take goes back to review. A take keeps at least one frame.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"frameId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["f68c2bb4-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"Removed.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true},"take":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"status":{"enum":["queued","generating","draft","review","approved","failed"],"type":"string","description":"An approved take whose frames change goes back to `review`, to be approved again."}},"required":["id","status"],"description":"The frame's take, after the edit."}},"required":["deleted","take"],"description":"The frame is gone and the later ones moved back."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"},"patch":{"operationId":"updateSpriteFrame","summary":"Update a frame","description":"Changes a frame's gameplay data (hurt and hit boxes, events, root motion), whether it's locked, or its hold.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"frameId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["f68c2bb4-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"gameplay":{"anyOf":[{"type":"object","properties":{"events":{"type":"array","maxItems":16,"items":{"type":"string","minLength":1,"maxLength":60}},"hit":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]},"damage":{"type":"integer","minimum":0,"maximum":9999,"description":"Damage the hit deals; absent: the game decides.","examples":[1]},"knockback":{"type":"object","properties":{"x":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]},"y":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]}},"required":["x","y"],"description":"The push a hit gives, in game units: x forward as faced, y up."},"on":{"type":"boolean"}},"required":["h","w","x","y","on"]},"hurt":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]}},"required":["h","w","x","y"],"description":"A box in sprite px from the top left, facing right."},"root":{"type":"number","description":"How far the body moves forward on this frame, in px.","examples":[1]}},"required":["events","hit","hurt","root"],"description":"A frame's gameplay data, as games read it."},{"type":"null"}]},"holdMs":{"anyOf":[{"type":"integer","minimum":1,"maximum":10000,"examples":[1]},{"type":"null"}],"examples":[1]},"locked":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The frame.","content":{"application/json":{"schema":{"type":"object","properties":{"clipIndex":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"The clip frame it plays; `null`: it isn't from a clip.","examples":[1]},"editedFromKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The key before a touch-up, kept for undo.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"gameplay":{"anyOf":[{"type":"object","properties":{"events":{"type":"array","maxItems":16,"items":{"type":"string","minLength":1,"maxLength":60}},"hit":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]},"damage":{"type":"integer","minimum":0,"maximum":9999,"description":"Damage the hit deals; absent: the game decides.","examples":[1]},"knockback":{"type":"object","properties":{"x":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]},"y":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]}},"required":["x","y"],"description":"The push a hit gives, in game units: x forward as faced, y up."},"on":{"type":"boolean"}},"required":["h","w","x","y","on"]},"hurt":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]}},"required":["h","w","x","y"],"description":"A box in sprite px from the top left, facing right."},"root":{"type":"number","description":"How far the body moves forward on this frame, in px.","examples":[1]}},"required":["events","hit","hurt","root"],"description":"A frame's gameplay data, as games read it."},{"type":"null"}]},"holdMs":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"How long it holds, in ms; `null`: the action's fps.","examples":[1]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"index":{"type":"integer","examples":[1]},"isTween":{"type":"boolean"},"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"locked":{"type":"boolean","description":"Kept as is when the take is generated again."},"offsetX":{"type":"integer","description":"Where preview and export draw it, in canvas px.","examples":[1]},"offsetY":{"type":"integer","examples":[1]},"score":{"anyOf":[{"type":"number","examples":[1]},{"type":"null"}],"description":"How close it is to the master, 0 to 1.","examples":[1]},"scoreModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"takeId":{"type":"string","minLength":1,"maxLength":128,"examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["clipIndex","editedFromKey","gameplay","holdMs","id","index","isTween","key","locked","offsetX","offsetY","score","scoreModel","takeId","url"],"description":"A frame of a take."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/frames/{frameId}/replace":{"post":{"operationId":"replaceSpriteFrame","summary":"Replace a frame's image","description":"Saves a touch-up: an uploaded PNG the frame's size (`POST /uploads` first) becomes the frame's file. The generated file is kept for revert (only the first original, so revert always gets back to it). The take is scored again; an approved take goes back to review. Locked frames can't change.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"frameId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["f68c2bb4-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"The storage key of a PNG you uploaded (`POST /uploads`, then `PUT` it to the returned URL).","examples":["uploads/org_123/5d1c…/frame.png"]}},"required":["key"],"description":"The touched-up frame: a PNG the size of the frame, as the Touch up tools drew it."}},"required":["image"]}}}},"responses":{"200":{"description":"The frame, scored again.","content":{"application/json":{"schema":{"type":"object","properties":{"frame":{"type":"object","properties":{"clipIndex":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"The clip frame it plays; `null`: it isn't from a clip.","examples":[1]},"editedFromKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The key before a touch-up, kept for undo.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"gameplay":{"anyOf":[{"type":"object","properties":{"events":{"type":"array","maxItems":16,"items":{"type":"string","minLength":1,"maxLength":60}},"hit":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]},"damage":{"type":"integer","minimum":0,"maximum":9999,"description":"Damage the hit deals; absent: the game decides.","examples":[1]},"knockback":{"type":"object","properties":{"x":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]},"y":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]}},"required":["x","y"],"description":"The push a hit gives, in game units: x forward as faced, y up."},"on":{"type":"boolean"}},"required":["h","w","x","y","on"]},"hurt":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]}},"required":["h","w","x","y"],"description":"A box in sprite px from the top left, facing right."},"root":{"type":"number","description":"How far the body moves forward on this frame, in px.","examples":[1]}},"required":["events","hit","hurt","root"],"description":"A frame's gameplay data, as games read it."},{"type":"null"}]},"holdMs":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"How long it holds, in ms; `null`: the action's fps.","examples":[1]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"index":{"type":"integer","examples":[1]},"isTween":{"type":"boolean"},"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"locked":{"type":"boolean","description":"Kept as is when the take is generated again."},"offsetX":{"type":"integer","description":"Where preview and export draw it, in canvas px.","examples":[1]},"offsetY":{"type":"integer","examples":[1]},"score":{"anyOf":[{"type":"number","examples":[1]},{"type":"null"}],"description":"How close it is to the master, 0 to 1.","examples":[1]},"scoreModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"takeId":{"type":"string","minLength":1,"maxLength":128,"examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["clipIndex","editedFromKey","gameplay","holdMs","id","index","isTween","key","locked","offsetX","offsetY","score","scoreModel","takeId","url"],"description":"A frame of a take."},"take":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"status":{"enum":["queued","generating","draft","review","approved","failed"],"type":"string","description":"An approved take whose frames change goes back to `review`, to be approved again."}},"required":["id","status"],"description":"The frame's take, after the edit."}},"required":["frame","take"],"description":"The frame after the edit, scored again."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/frames/{frameId}/revert":{"post":{"operationId":"revertSpriteFrame","summary":"Revert a frame","description":"Puts the generated frame back after touch-ups or redraws. The take is scored again; an approved take goes back to review.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"frameId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["f68c2bb4-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"The frame, scored again.","content":{"application/json":{"schema":{"type":"object","properties":{"frame":{"type":"object","properties":{"clipIndex":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"The clip frame it plays; `null`: it isn't from a clip.","examples":[1]},"editedFromKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The key before a touch-up, kept for undo.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"gameplay":{"anyOf":[{"type":"object","properties":{"events":{"type":"array","maxItems":16,"items":{"type":"string","minLength":1,"maxLength":60}},"hit":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]},"damage":{"type":"integer","minimum":0,"maximum":9999,"description":"Damage the hit deals; absent: the game decides.","examples":[1]},"knockback":{"type":"object","properties":{"x":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]},"y":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]}},"required":["x","y"],"description":"The push a hit gives, in game units: x forward as faced, y up."},"on":{"type":"boolean"}},"required":["h","w","x","y","on"]},"hurt":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]}},"required":["h","w","x","y"],"description":"A box in sprite px from the top left, facing right."},"root":{"type":"number","description":"How far the body moves forward on this frame, in px.","examples":[1]}},"required":["events","hit","hurt","root"],"description":"A frame's gameplay data, as games read it."},{"type":"null"}]},"holdMs":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"How long it holds, in ms; `null`: the action's fps.","examples":[1]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"index":{"type":"integer","examples":[1]},"isTween":{"type":"boolean"},"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"locked":{"type":"boolean","description":"Kept as is when the take is generated again."},"offsetX":{"type":"integer","description":"Where preview and export draw it, in canvas px.","examples":[1]},"offsetY":{"type":"integer","examples":[1]},"score":{"anyOf":[{"type":"number","examples":[1]},{"type":"null"}],"description":"How close it is to the master, 0 to 1.","examples":[1]},"scoreModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"takeId":{"type":"string","minLength":1,"maxLength":128,"examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["clipIndex","editedFromKey","gameplay","holdMs","id","index","isTween","key","locked","offsetX","offsetY","score","scoreModel","takeId","url"],"description":"A frame of a take."},"take":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"status":{"enum":["queued","generating","draft","review","approved","failed"],"type":"string","description":"An approved take whose frames change goes back to `review`, to be approved again."}},"required":["id","status"],"description":"The frame's take, after the edit."}},"required":["frame","take"],"description":"The frame after the edit, scored again."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/games":{"post":{"operationId":"createSpriteGame","summary":"Create a game","description":"Starts a game's style bible. What you leave out comes from the defaults: the `pixel` style and its recipe, a side-scroller camera, a 32 px canvas, the standard size classes, rules and cleanup. Its slug is made from the name, unique in the workspace.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"camera":{"enum":["side","four","eight","iso"],"type":"string","description":"Which directions each action is drawn in: `side` (side-scroller), `four` or `eight` (top-down) or `iso` (isometric)."},"canvas":{"type":"object","properties":{"light":{"enum":["tl","tr"],"type":"string","description":"Where the light comes from: top left or top right."},"line":{"enum":["none","fine","bold"],"type":"string"},"outline":{"enum":["none","dark","selective"],"type":"string"},"resolutionPx":{"anyOf":[{"const":256},{"const":512},{"const":1024}]},"shading":{"enum":["flat","two"],"type":"string"},"sizePx":{"anyOf":[{"const":16},{"const":32},{"const":64}]}},"description":"Left out, or in part: the defaults fill the rest."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Moonfall"]},"recipe":{"type":"array","maxItems":24,"items":{"type":"string","minLength":1,"maxLength":200},"description":"Left out: the style's own traits."},"style":{"type":"string","description":"Default `pixel`."}},"required":["name"]}}}},"responses":{"201":{"description":"The game.","content":{"application/json":{"schema":{"type":"object","properties":{"camera":{"enum":["side","four","eight","iso"],"type":"string","description":"Which directions each action is drawn in: `side` (side-scroller), `four` or `eight` (top-down) or `iso` (isometric)."},"canvas":{"type":"object","properties":{"light":{"enum":["tl","tr"],"type":"string","description":"Where the light comes from: top left or top right."},"line":{"enum":["none","fine","bold"],"type":"string"},"outline":{"enum":["none","dark","selective"],"type":"string"},"resolutionPx":{"anyOf":[{"const":256},{"const":512},{"const":1024}]},"shading":{"enum":["flat","two"],"type":"string"},"sizePx":{"anyOf":[{"const":16},{"const":32},{"const":64}]}},"required":["light","line","outline","resolutionPx","shading","sizePx"],"description":"How the game's sprites are drawn. Pixel styles use `sizePx`, the rest `resolutionPx`."},"cleanup":{"type":"object","properties":{"align":{"type":"boolean","description":"Align feet to the baseline."},"bg":{"type":"boolean","description":"Remove the background."},"color":{"type":"boolean","description":"Match colour to the master (non-pixel styles)."},"quant":{"type":"boolean","description":"Quantise to the locked palette (pixel styles)."},"snap":{"type":"boolean","description":"Snap to the pixel grid (pixel styles)."},"upscale":{"type":"boolean","description":"Upscale to the game's resolution (non-pixel styles)."}},"required":["align","bg","color","quant","snap","upscale"],"description":"The cleanup steps a take goes through."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"imageModel":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"The image model takes use; `null`: the app's default."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"recipe":{"type":"array","maxItems":24,"items":{"type":"string","minLength":1,"maxLength":200},"description":"The style's traits, in order: what prompts say about the look. Never names a game or studio."},"rules":{"type":"object","properties":{"maxColours":{"type":"integer","minimum":2,"maximum":256,"examples":[1]},"oneOutline":{"type":"boolean","description":"Every sprite shares one outline colour, `outlineHex`."},"outlineHex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]}},"required":["maxColours","oneOutline","outlineHex"],"description":"The checks every frame of the game is held to."},"seed":{"anyOf":[{"type":"integer","minimum":0,"maximum":2147483647,"examples":[1]},{"type":"null"}],"description":"A fixed seed for every take; `null`: a new one each time.","examples":[1]},"sizeClasses":{"type":"object","properties":{"large":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"medium":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"small":{"type":"integer","minimum":1,"maximum":64,"examples":[1]}},"required":["large","medium","small"],"description":"How tall each size class stands, in px on a 32 px canvas."},"slug":{"type":"string","description":"Unique in the workspace; made from the name.","examples":["moonfall"]},"style":{"type":"string","description":"A base style (`pixel`, `painted`, `cel`, `3d`, `vector`) or a look id.","examples":["pixel"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"videoModel":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"The video model clip takes use; `null`: the app's default."}},"required":["camera","canvas","cleanup","createdAt","id","imageModel","name","recipe","rules","seed","sizeClasses","slug","style","updatedAt","videoModel"],"description":"A game: its style bible and defaults."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"sprites:write"},"get":{"operationId":"listSpriteGames","summary":"List games","description":"The workspace's games, last edited first.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"responses":{"200":{"description":"The games.","content":{"application/json":{"schema":{"type":"object","properties":{"games":{"type":"array","items":{"type":"object","properties":{"camera":{"enum":["side","four","eight","iso"],"type":"string","description":"Which directions each action is drawn in: `side` (side-scroller), `four` or `eight` (top-down) or `iso` (isometric)."},"canvas":{"type":"object","properties":{"light":{"enum":["tl","tr"],"type":"string","description":"Where the light comes from: top left or top right."},"line":{"enum":["none","fine","bold"],"type":"string"},"outline":{"enum":["none","dark","selective"],"type":"string"},"resolutionPx":{"anyOf":[{"const":256},{"const":512},{"const":1024}]},"shading":{"enum":["flat","two"],"type":"string"},"sizePx":{"anyOf":[{"const":16},{"const":32},{"const":64}]}},"required":["light","line","outline","resolutionPx","shading","sizePx"],"description":"How the game's sprites are drawn. Pixel styles use `sizePx`, the rest `resolutionPx`."},"cleanup":{"type":"object","properties":{"align":{"type":"boolean","description":"Align feet to the baseline."},"bg":{"type":"boolean","description":"Remove the background."},"color":{"type":"boolean","description":"Match colour to the master (non-pixel styles)."},"quant":{"type":"boolean","description":"Quantise to the locked palette (pixel styles)."},"snap":{"type":"boolean","description":"Snap to the pixel grid (pixel styles)."},"upscale":{"type":"boolean","description":"Upscale to the game's resolution (non-pixel styles)."}},"required":["align","bg","color","quant","snap","upscale"],"description":"The cleanup steps a take goes through."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"imageModel":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"The image model takes use; `null`: the app's default."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"recipe":{"type":"array","maxItems":24,"items":{"type":"string","minLength":1,"maxLength":200},"description":"The style's traits, in order: what prompts say about the look. Never names a game or studio."},"rules":{"type":"object","properties":{"maxColours":{"type":"integer","minimum":2,"maximum":256,"examples":[1]},"oneOutline":{"type":"boolean","description":"Every sprite shares one outline colour, `outlineHex`."},"outlineHex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]}},"required":["maxColours","oneOutline","outlineHex"],"description":"The checks every frame of the game is held to."},"seed":{"anyOf":[{"type":"integer","minimum":0,"maximum":2147483647,"examples":[1]},{"type":"null"}],"description":"A fixed seed for every take; `null`: a new one each time.","examples":[1]},"sizeClasses":{"type":"object","properties":{"large":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"medium":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"small":{"type":"integer","minimum":1,"maximum":64,"examples":[1]}},"required":["large","medium","small"],"description":"How tall each size class stands, in px on a 32 px canvas."},"slug":{"type":"string","description":"Unique in the workspace; made from the name.","examples":["moonfall"]},"style":{"type":"string","description":"A base style (`pixel`, `painted`, `cel`, `3d`, `vector`) or a look id.","examples":["pixel"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"videoModel":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"The video model clip takes use; `null`: the app's default."}},"required":["camera","canvas","cleanup","createdAt","id","imageModel","name","recipe","rules","seed","sizeClasses","slug","style","updatedAt","videoModel"],"description":"A game: its style bible and defaults."}}},"required":["games"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/games/{gameId}":{"get":{"operationId":"getSpriteGame","summary":"Get a game","description":"Requires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"gameId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3c6f2a51-9d0e-4b7a-8f12-6e4d0c9b7a21"]}}],"responses":{"200":{"description":"The game.","content":{"application/json":{"schema":{"type":"object","properties":{"camera":{"enum":["side","four","eight","iso"],"type":"string","description":"Which directions each action is drawn in: `side` (side-scroller), `four` or `eight` (top-down) or `iso` (isometric)."},"canvas":{"type":"object","properties":{"light":{"enum":["tl","tr"],"type":"string","description":"Where the light comes from: top left or top right."},"line":{"enum":["none","fine","bold"],"type":"string"},"outline":{"enum":["none","dark","selective"],"type":"string"},"resolutionPx":{"anyOf":[{"const":256},{"const":512},{"const":1024}]},"shading":{"enum":["flat","two"],"type":"string"},"sizePx":{"anyOf":[{"const":16},{"const":32},{"const":64}]}},"required":["light","line","outline","resolutionPx","shading","sizePx"],"description":"How the game's sprites are drawn. Pixel styles use `sizePx`, the rest `resolutionPx`."},"cleanup":{"type":"object","properties":{"align":{"type":"boolean","description":"Align feet to the baseline."},"bg":{"type":"boolean","description":"Remove the background."},"color":{"type":"boolean","description":"Match colour to the master (non-pixel styles)."},"quant":{"type":"boolean","description":"Quantise to the locked palette (pixel styles)."},"snap":{"type":"boolean","description":"Snap to the pixel grid (pixel styles)."},"upscale":{"type":"boolean","description":"Upscale to the game's resolution (non-pixel styles)."}},"required":["align","bg","color","quant","snap","upscale"],"description":"The cleanup steps a take goes through."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"imageModel":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"The image model takes use; `null`: the app's default."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"recipe":{"type":"array","maxItems":24,"items":{"type":"string","minLength":1,"maxLength":200},"description":"The style's traits, in order: what prompts say about the look. Never names a game or studio."},"rules":{"type":"object","properties":{"maxColours":{"type":"integer","minimum":2,"maximum":256,"examples":[1]},"oneOutline":{"type":"boolean","description":"Every sprite shares one outline colour, `outlineHex`."},"outlineHex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]}},"required":["maxColours","oneOutline","outlineHex"],"description":"The checks every frame of the game is held to."},"seed":{"anyOf":[{"type":"integer","minimum":0,"maximum":2147483647,"examples":[1]},{"type":"null"}],"description":"A fixed seed for every take; `null`: a new one each time.","examples":[1]},"sizeClasses":{"type":"object","properties":{"large":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"medium":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"small":{"type":"integer","minimum":1,"maximum":64,"examples":[1]}},"required":["large","medium","small"],"description":"How tall each size class stands, in px on a 32 px canvas."},"slug":{"type":"string","description":"Unique in the workspace; made from the name.","examples":["moonfall"]},"style":{"type":"string","description":"A base style (`pixel`, `painted`, `cel`, `3d`, `vector`) or a look id.","examples":["pixel"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"videoModel":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"The video model clip takes use; `null`: the app's default."}},"required":["camera","canvas","cleanup","createdAt","id","imageModel","name","recipe","rules","seed","sizeClasses","slug","style","updatedAt","videoModel"],"description":"A game: its style bible and defaults."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"},"patch":{"operationId":"updateSpriteGame","summary":"Update a game","description":"Changes a game's style bible: the fields you send replace theirs (`canvas`, `rules`, `sizeClasses` and `cleanup` field by field); the rest stay. A new `style` without a `recipe` takes that style's recipe.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"gameId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["3c6f2a51-9d0e-4b7a-8f12-6e4d0c9b7a21"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"camera":{"enum":["side","four","eight","iso"],"type":"string","description":"Which directions each action is drawn in: `side` (side-scroller), `four` or `eight` (top-down) or `iso` (isometric)."},"canvas":{"type":"object","properties":{"light":{"enum":["tl","tr"],"type":"string","description":"Where the light comes from: top left or top right."},"line":{"enum":["none","fine","bold"],"type":"string"},"outline":{"enum":["none","dark","selective"],"type":"string"},"resolutionPx":{"anyOf":[{"const":256},{"const":512},{"const":1024}]},"shading":{"enum":["flat","two"],"type":"string"},"sizePx":{"anyOf":[{"const":16},{"const":32},{"const":64}]}},"description":"The fields you send replace theirs; the rest stay."},"cleanup":{"type":"object","properties":{"align":{"type":"boolean","description":"Align feet to the baseline."},"bg":{"type":"boolean","description":"Remove the background."},"color":{"type":"boolean","description":"Match colour to the master (non-pixel styles)."},"quant":{"type":"boolean","description":"Quantise to the locked palette (pixel styles)."},"snap":{"type":"boolean","description":"Snap to the pixel grid (pixel styles)."},"upscale":{"type":"boolean","description":"Upscale to the game's resolution (non-pixel styles)."}}},"imageModel":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"recipe":{"type":"array","maxItems":24,"items":{"type":"string","minLength":1,"maxLength":200},"description":"Replaces the recipe. Left out while `style` changes: the new style's traits."},"rules":{"type":"object","properties":{"maxColours":{"type":"integer","minimum":2,"maximum":256,"examples":[1]},"oneOutline":{"type":"boolean","description":"Every sprite shares one outline colour, `outlineHex`."},"outlineHex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]}}},"seed":{"anyOf":[{"type":"integer","minimum":0,"maximum":2147483647,"examples":[1]},{"type":"null"}],"description":"A fixed seed for every take; `null`: a new one each time.","examples":[1]},"sizeClasses":{"type":"object","properties":{"large":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"medium":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"small":{"type":"integer","minimum":1,"maximum":64,"examples":[1]}}},"style":{"type":"string","description":"A base style (`pixel`, `painted`, `cel`, `3d`, `vector`) or a look id.","examples":["pixel"]},"videoModel":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}}}}}},"responses":{"200":{"description":"The game.","content":{"application/json":{"schema":{"type":"object","properties":{"camera":{"enum":["side","four","eight","iso"],"type":"string","description":"Which directions each action is drawn in: `side` (side-scroller), `four` or `eight` (top-down) or `iso` (isometric)."},"canvas":{"type":"object","properties":{"light":{"enum":["tl","tr"],"type":"string","description":"Where the light comes from: top left or top right."},"line":{"enum":["none","fine","bold"],"type":"string"},"outline":{"enum":["none","dark","selective"],"type":"string"},"resolutionPx":{"anyOf":[{"const":256},{"const":512},{"const":1024}]},"shading":{"enum":["flat","two"],"type":"string"},"sizePx":{"anyOf":[{"const":16},{"const":32},{"const":64}]}},"required":["light","line","outline","resolutionPx","shading","sizePx"],"description":"How the game's sprites are drawn. Pixel styles use `sizePx`, the rest `resolutionPx`."},"cleanup":{"type":"object","properties":{"align":{"type":"boolean","description":"Align feet to the baseline."},"bg":{"type":"boolean","description":"Remove the background."},"color":{"type":"boolean","description":"Match colour to the master (non-pixel styles)."},"quant":{"type":"boolean","description":"Quantise to the locked palette (pixel styles)."},"snap":{"type":"boolean","description":"Snap to the pixel grid (pixel styles)."},"upscale":{"type":"boolean","description":"Upscale to the game's resolution (non-pixel styles)."}},"required":["align","bg","color","quant","snap","upscale"],"description":"The cleanup steps a take goes through."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"imageModel":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"The image model takes use; `null`: the app's default."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"recipe":{"type":"array","maxItems":24,"items":{"type":"string","minLength":1,"maxLength":200},"description":"The style's traits, in order: what prompts say about the look. Never names a game or studio."},"rules":{"type":"object","properties":{"maxColours":{"type":"integer","minimum":2,"maximum":256,"examples":[1]},"oneOutline":{"type":"boolean","description":"Every sprite shares one outline colour, `outlineHex`."},"outlineHex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]}},"required":["maxColours","oneOutline","outlineHex"],"description":"The checks every frame of the game is held to."},"seed":{"anyOf":[{"type":"integer","minimum":0,"maximum":2147483647,"examples":[1]},{"type":"null"}],"description":"A fixed seed for every take; `null`: a new one each time.","examples":[1]},"sizeClasses":{"type":"object","properties":{"large":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"medium":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"small":{"type":"integer","minimum":1,"maximum":64,"examples":[1]}},"required":["large","medium","small"],"description":"How tall each size class stands, in px on a 32 px canvas."},"slug":{"type":"string","description":"Unique in the workspace; made from the name.","examples":["moonfall"]},"style":{"type":"string","description":"A base style (`pixel`, `painted`, `cel`, `3d`, `vector`) or a look id.","examples":["pixel"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"videoModel":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"description":"The video model clip takes use; `null`: the app's default."}},"required":["camera","canvas","cleanup","createdAt","id","imageModel","name","recipe","rules","seed","sizeClasses","slug","style","updatedAt","videoModel"],"description":"A game: its style bible and defaults."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/imports":{"post":{"operationId":"createSpriteImport","summary":"Import a sprite sheet","description":"Imports a sheet you uploaded (`POST /uploads`): sliced on `grid`, its ground taken out, each row fitted to the game's canvas (one scale for the sheet, so the master's figure stands at the size class's height, and each row's lowest feet on the baseline) and made a draft take of its action in its direction, then scored against the master. With no `characterId` a new character is made (a Library sprite); its master comes from `masterFrom`, by default the first row's first frame. Rows can name the character's actions by key or any action by name (new ones are added). Charges nothing. Follow it on the studio's live feed (topic `import`) or with `GET /sprites/imports/{importId}`.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"characterId":{"type":"string","minLength":1,"maxLength":128,"description":"The game's character it goes to. Left out: a new character is made.","examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]},"gameId":{"type":"string","minLength":1,"maxLength":128,"examples":["5c2a9e1d-7b3f-4a6e-8d0c-2f1e3a4b5c6d"]},"grid":{"type":"object","properties":{"cellH":{"type":"integer","minimum":1,"maximum":4096,"description":"Cell height in sheet px. Left out: the rows share the sheet.","examples":[1]},"cellW":{"type":"integer","minimum":1,"maximum":4096,"description":"Cell width in sheet px. Left out: the columns share the sheet.","examples":[1]},"cols":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"gapX":{"type":"integer","minimum":0,"maximum":512,"description":"Px between columns.","examples":[1]},"gapY":{"type":"integer","minimum":0,"maximum":512,"description":"Px between rows.","examples":[1]},"offsetX":{"type":"integer","minimum":0,"maximum":4096,"description":"Px before the first column.","examples":[1]},"offsetY":{"type":"integer","minimum":0,"maximum":4096,"description":"Px above the first row.","examples":[1]},"rows":{"type":"integer","minimum":1,"maximum":32,"examples":[1]}},"required":["cols","rows"],"description":"The sheet's grid: cell `i` of a row starts at `offsetX + i × (cellW + gapX)`.","examples":[{"cols":8,"rows":4}]},"idempotencyKey":{"type":"string","minLength":1,"maxLength":255,"description":"The same key returns the same import.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"image":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"The storage key of a PNG you uploaded (`POST /uploads`, then `PUT` it to the returned URL).","examples":["uploads/org_123/5d1c…/frame.png"]}},"required":["key"],"description":"An image you uploaded."},"key":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The background colour to take out, as `#rrggbb`; `null` keeps every pixel. Left out: the sheet's own ground is found (a flat colour round its border).","examples":["#ff00ff"]},"masterFrom":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":63,"description":"The frame in that row (its cells with a figure, from 0).","examples":[1]},"row":{"type":"integer","minimum":0,"maximum":31,"description":"A row of the sheet, from 0 at the top.","examples":[1]}},"required":["index","row"],"description":"The frame the master is made from. Left out: the first row's first frame for a new character, and the character's own master otherwise."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"The new character's name. Left out: the file's.","examples":["Autumn campaign"]},"rows":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"object","properties":{"actionKey":{"type":"string","minLength":1,"maxLength":64,"description":"One of the character's actions, by key (`idle`, `walk`, ...).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"actionName":{"type":"string","minLength":1,"maxLength":120,"description":"An action by name: the character's when it has one called that, else a new one."},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"fps":{"type":"integer","minimum":1,"maximum":60,"description":"Frames a second. Left out: the action's.","examples":[1]},"frameCount":{"type":"integer","minimum":1,"maximum":64,"description":"How many of the row's frames to use. Left out: all of them.","examples":[1]},"playback":{"enum":["loop","once","pingpong"],"type":"string"},"row":{"type":"integer","minimum":0,"maximum":31,"description":"The sheet row. Left out: its place in `rows`.","examples":[1]}},"required":["direction"]},"description":"The rows to import, each an action (`actionKey` or `actionName`) in a direction: one take each."}},"required":["gameId","grid","image","rows"]}}}},"responses":{"202":{"description":"Accepted: the import is queued.","content":{"application/json":{"schema":{"type":"object","properties":{"characterId":{"type":"string","minLength":1,"maxLength":128,"description":"The character it goes to (made by the import when new).","examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"importId":{"type":"string","minLength":1,"maxLength":128,"description":"The import: the live feed (`GET /sprites/events`, topic `import`) follows it.","examples":["2b7d4f9a1c3e5a7b9d0f2e4c6a8b0d1f"]},"status":{"enum":["queued","running","done","failed"],"type":"string"}},"required":["characterId","importId","status"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/imports/{importId}":{"get":{"operationId":"getSpriteImport","summary":"Get an import","description":"An import as it stands: queued, running (with what it's doing), done or failed (with why), and the takes it makes.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"importId","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,128}$","examples":["2b7d4f9a1c3e5a7b9d0f2e4c6a8b0d1f"]}}],"responses":{"200":{"description":"The import.","content":{"application/json":{"schema":{"type":"object","properties":{"characterId":{"type":"string","minLength":1,"maxLength":128,"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string"},"failure":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, in plain words."},"gameId":{"type":"string","minLength":1,"maxLength":128,"examples":["86c3e75d-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The master version it made, if it made one.","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"progress":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"status":{"enum":["queued","running","done","failed"],"type":"string"},"step":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What it's doing now, in plain words."},"takeIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128},"description":"The takes it makes, a row each."},"updatedAt":{"type":"string"}},"required":["characterId","createdAt","failure","gameId","id","masterVersionId","progress","status","step","takeIds","updatedAt"],"description":"A sheet import."}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/imports/preview":{"post":{"operationId":"previewSpriteImport","summary":"Preview a sheet import","description":"Reads a sheet you uploaded without importing anything: its ground (clear, a key colour or neither), its grid (found from its gutters and the figures' spacing, or yours completed), the empty cells, frames per row, a suggested mapping of rows to actions and directions, what the master frame measures and warnings in plain words (mixed sizes, too many colours, feet off the baseline, figures cut off).\n\nRequires scope `sprites:read`.","tags":["Sprites"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"characterId":{"type":"string","minLength":1,"maxLength":128,"description":"The character it would go to: its actions are offered. Left out: a new character's standard actions.","examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]},"gameId":{"type":"string","minLength":1,"maxLength":128,"examples":["5c2a9e1d-7b3f-4a6e-8d0c-2f1e3a4b5c6d"]},"grid":{"type":"object","properties":{"cellH":{"type":"integer","minimum":1,"maximum":4096,"description":"Cell height in sheet px. Left out: the rows share the sheet.","examples":[1]},"cellW":{"type":"integer","minimum":1,"maximum":4096,"description":"Cell width in sheet px. Left out: the columns share the sheet.","examples":[1]},"cols":{"type":"integer","minimum":1,"maximum":64,"examples":[1]},"gapX":{"type":"integer","minimum":0,"maximum":512,"description":"Px between columns.","examples":[1]},"gapY":{"type":"integer","minimum":0,"maximum":512,"description":"Px between rows.","examples":[1]},"offsetX":{"type":"integer","minimum":0,"maximum":4096,"description":"Px before the first column.","examples":[1]},"offsetY":{"type":"integer","minimum":0,"maximum":4096,"description":"Px above the first row.","examples":[1]},"rows":{"type":"integer","minimum":1,"maximum":32,"examples":[1]}},"required":["cols","rows"],"description":"Your grid. Left out: it's found from the sheet."},"image":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"The storage key of a PNG you uploaded (`POST /uploads`, then `PUT` it to the returned URL).","examples":["uploads/org_123/5d1c…/frame.png"]}},"required":["key"],"description":"An image you uploaded."},"key":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The background colour to take out, as `#rrggbb`; `null` keeps every pixel. Left out: the sheet's own ground is found (a flat colour round its border).","examples":["#ff00ff"]},"masterFrom":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":63,"description":"The frame in that row (its cells with a figure, from 0).","examples":[1]},"row":{"type":"integer","minimum":0,"maximum":31,"description":"A row of the sheet, from 0 at the top.","examples":[1]}},"required":["index","row"],"description":"The frame the master is made from. Left out: the first row's first frame for a new character, and the character's own master otherwise."},"rows":{"type":"array","maxItems":32,"items":{"type":"object","properties":{"actionKey":{"type":"string","minLength":1,"maxLength":64,"description":"One of the character's actions, by key (`idle`, `walk`, ...).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"frames":{"type":"integer","minimum":0,"maximum":64,"examples":[1]},"row":{"type":"integer","minimum":0,"maximum":31,"description":"A row of the sheet, from 0 at the top.","examples":[1]}},"required":["frames","row"]},"description":"Your mapping so far, for its warnings. Left out: the suggested one."}},"required":["gameId","image"]}}}},"responses":{"200":{"description":"What the sheet is and how it would import.","content":{"application/json":{"schema":{"type":"object","properties":{"actions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["key","name"]},"description":"The actions a row can be (the character's, or the standard ones)."},"background":{"type":"object","properties":{"hex":{"type":"string"},"kind":{"enum":["alpha","key","none"],"type":"string"}},"required":["kind"],"description":"The sheet's ground: clear (`alpha`), a flat colour (`key`, with its `hex`) or neither (`none`)."},"cells":{"type":"integer","description":"Cells in the grid.","examples":[1]},"directions":{"type":"array","items":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"description":"Directions a row can be: the camera's drawn ones (left-facing ones are flipped on export)."},"emptyCells":{"type":"array","items":{"type":"integer","examples":[1]},"description":"Cells with no figure, as `row × cols + col`."},"grid":{"type":"object","properties":{"cellH":{"type":"integer","examples":[1]},"cellW":{"type":"integer","examples":[1]},"cols":{"type":"integer","examples":[1]},"gapX":{"type":"integer","examples":[1]},"gapY":{"type":"integer","examples":[1]},"offsetX":{"type":"integer","examples":[1]},"offsetY":{"type":"integer","examples":[1]},"rows":{"type":"integer","examples":[1]}},"required":["cellH","cellW","cols","gapX","gapY","offsetX","offsetY","rows"],"description":"The grid, in sheet px."},"height":{"type":"integer","examples":[1280]},"key":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The colour that would be taken out, or `null`.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"measurements":{"type":"object","properties":{"cell":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}]},"colourCount":{"type":"integer","examples":[1]},"feetRow":{"type":"integer","description":"The master frame's lowest opaque row, in its cell.","examples":[1]},"heightPx":{"type":"integer","description":"The master frame's figure height, in sheet px.","examples":[1]},"palette":{"type":"array","items":{"type":"string"}},"widthPx":{"type":"integer","examples":[1]}},"required":["cell","colourCount","feetRow","heightPx","palette","widthPx"],"description":"What the sheet measures."},"rowFrames":{"type":"array","items":{"type":"integer","examples":[1]},"description":"Frames (cells with a figure) in each row."},"rows":{"type":"array","items":{"type":"object","properties":{"actionKey":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"actionName":{"type":"string"},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"frames":{"type":"integer","description":"Its frames: cells with a figure. 0: nothing to import.","examples":[1]},"row":{"type":"integer","examples":[1]}},"required":["direction","frames","row"],"description":"What a sheet row would be imported as."},"description":"The suggested mapping, a row each."},"warnings":{"type":"array","items":{"type":"string"},"description":"In plain words: mixed sizes, too many colours, feet off the baseline, figures cut off."},"width":{"type":"integer","examples":[1024]}},"required":["actions","background","cells","directions","emptyCells","grid","height","key","measurements","rowFrames","rows","warnings","width"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/characters/{characterId}/masters/candidates":{"get":{"operationId":"listSpriteMasterCandidates","summary":"List master candidates","description":"A character's master candidates, newest request first, each with its files (short-lived download URLs), what it measures, or why it failed.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"responses":{"200":{"description":"The candidates.","content":{"application/json":{"schema":{"type":"object","properties":{"candidates":{"type":"array","items":{"type":"object","properties":{"canvasPx":{"type":"integer","examples":[1]},"createdAt":{"type":"string"},"files":{"anyOf":[{"type":"object","properties":{"canvas":{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},"large":{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."}},"required":["canvas","large"]},{"type":"null"}],"description":"The master at canvas size and at 1024 px."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"index":{"type":"integer","examples":[1]},"issues":{"type":"array","items":{"type":"string"},"description":"Why it failed, in plain words."},"largePx":{"type":"integer","examples":[1]},"measurements":{"anyOf":[{"type":"object","properties":{"feetRow":{"type":"integer","examples":[1]},"heightPx":{"type":"integer","examples":[1]},"palette":{"type":"array","items":{"type":"string"}},"widthPx":{"type":"integer","examples":[1]}},"required":["feetRow","heightPx","palette","widthPx"]},{"type":"null"}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"pickedVersionId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["5372dc4a-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The master version it became, once picked.","examples":["5372dc4a-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"prompt":{"type":"string","examples":["A lighthouse on a cliff at dusk, cinematic"]},"requestId":{"type":"string","minLength":1,"maxLength":128,"examples":["2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"status":{"enum":["failed","ready"],"type":"string"}},"required":["canvasPx","createdAt","files","id","index","issues","largePx","measurements","model","pickedVersionId","prompt","requestId","status"],"description":"A candidate a master request drew."}}},"required":["candidates"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/characters/{characterId}/masters/estimate":{"post":{"operationId":"estimateSpriteMaster","summary":"Estimate a master request","description":"What a master request would set aside now, in credits: every candidate drawn three times (the first try and two silent retries), each with background removal. Nothing is started or charged.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"aspectRatio":{"enum":["1:1","3:4","4:3","9:16","16:9"],"type":"string","description":"The shape it's drawn at, `1:1` by default. The figure is then fitted to the game's square canvas, so this only changes how the model frames it."},"greenScreen":{"type":"boolean","description":"`true`: drawn on a flat key colour (magenta, or green for a pink or purple character) and keyed out for free. `false`: drawn with the model's own transparent background where it has one; a model without one stays on the key colour. Left out: what the model does best."},"quality":{"enum":["auto","low","medium","high","xhigh","max"],"type":"string","description":"Rendering quality, for a model whose `qualities` list it (GPT Image); left out: its `defaultQuality`. Ignored by a model with none."},"resolution":{"enum":["1K","2K","4K"],"type":"string","description":"`1K` by default, or the model's lowest when it has no 1K."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A fixed seed, for a model with `seed` (Nano Banana): the first candidate draws with it, each next one with one more, so the same prompt and seed draw the same images again. Left out: a random one. Ignored by a model that takes none.","examples":[1]},"count":{"type":"integer","minimum":1,"maximum":4,"description":"Candidates to draw, 1 to 4; four by default.","examples":[1]},"model":{"type":"string","minLength":1,"maxLength":200,"description":"A base image model (`google/nano-banana-pro`, `google/nano-banana-2.1`, `bytedance/seedream-5-lite`, `openai/gpt-image-2`, `openai/gpt-image-2.5-sunburst`, `openai/gpt-image-2.5-flare`) or its capability model id. Left out: the game's.","examples":["google/nano-banana-pro"]}}}}}},"responses":{"200":{"description":"What the request would set aside.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the request sets aside, in credits: its worst case.","examples":[12]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"description":"The price revision it's priced at.","examples":[3]}},"required":["credits","model","priceVersion"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/characters/{characterId}/masters":{"post":{"operationId":"generateSpriteMaster","summary":"Draw master candidates","description":"Draws candidates (four by default) of a character's master: full body, a neutral ready pose, on a clean ground, fitted to its size class with its feet on the baseline and validated (one that fails is drawn again, up to twice). Holds credits for the worst case and settles at what ran. Follow it with `GET /sprites/events` (`sprites.watch`), then read the rows. Pick one with `POST /sprites/characters/{characterId}/masters/pick`.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"aspectRatio":{"enum":["1:1","3:4","4:3","9:16","16:9"],"type":"string","description":"The shape it's drawn at, `1:1` by default. The figure is then fitted to the game's square canvas, so this only changes how the model frames it."},"greenScreen":{"type":"boolean","description":"`true`: drawn on a flat key colour (magenta, or green for a pink or purple character) and keyed out for free. `false`: drawn with the model's own transparent background where it has one; a model without one stays on the key colour. Left out: what the model does best."},"quality":{"enum":["auto","low","medium","high","xhigh","max"],"type":"string","description":"Rendering quality, for a model whose `qualities` list it (GPT Image); left out: its `defaultQuality`. Ignored by a model with none."},"resolution":{"enum":["1K","2K","4K"],"type":"string","description":"`1K` by default, or the model's lowest when it has no 1K."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"A fixed seed, for a model with `seed` (Nano Banana): the first candidate draws with it, each next one with one more, so the same prompt and seed draw the same images again. Left out: a random one. Ignored by a model that takes none.","examples":[1]},"count":{"type":"integer","minimum":1,"maximum":4,"description":"Candidates to draw, 1 to 4; four by default.","examples":[1]},"description":{"type":"string","minLength":1,"maxLength":4000,"description":"What the character is, in your words.","examples":["A stalwart knight in steel plate with a crimson plume"]},"keyColour":{"enum":["magenta","green"],"type":"string","description":"The flat colour it's drawn on to be keyed out, when it's drawn on one. Left out: magenta, or green for a pink or purple character."},"model":{"type":"string","minLength":1,"maxLength":200,"description":"A base image model (`google/nano-banana-pro`, `google/nano-banana-2.1`, `bytedance/seedream-5-lite`, `openai/gpt-image-2`, `openai/gpt-image-2.5-sunburst`, `openai/gpt-image-2.5-flare`) or its capability model id. Left out: the game's.","examples":["google/nano-banana-pro"]},"referenceKeys":{"type":"array","maxItems":8,"items":{"type":"string","minLength":1,"maxLength":1024},"description":"Your own references, by storage key, in order."},"sourceImageKey":{"type":"string","minLength":1,"maxLength":1024,"description":"The image the character is made from (From an image).","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["description"]}}}},"responses":{"202":{"description":"Accepted: the request is held and started.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the request sets aside, in credits: its worst case.","examples":[12]},"model":{"type":"string","description":"The capability model it runs.","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"description":"The price revision it's priced at.","examples":[3]},"requestId":{"type":"string","minLength":1,"maxLength":128,"description":"The request: the live feed (`GET /sprites/events`, topic `master`) names it and each of its candidates (`<requestId>-<n>`).","examples":["2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["credits","model","priceVersion","requestId"],"description":"A master or views request, held and started."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/characters/{characterId}/views":{"get":{"operationId":"listSpriteViews","summary":"List turnaround views","description":"The character's master in use from each of its camera's turnaround views (top-down 4-way: front, right, back; 8-way: also front-right and back-right; isometric: front-right, back-right; side-scroller: its own only), the master's own first, with the ones drawn so far and what drawing them sets aside.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"responses":{"200":{"description":"The views.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"anyOf":[{"type":"integer","examples":[12]},{"type":"null"}],"description":"What drawing the views sets aside (`masters.views`); `null`: the camera has none to draw (a side-scroller mirrors left).","examples":[12]},"versionId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The master version they belong to; `null`: no master yet.","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"views":{"type":"array","items":{"type":"object","properties":{"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"file":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The view's image; `null`: not drawn yet."},"main":{"type":"boolean","description":"The master's own view: always there."}},"required":["direction","file","main"]}}},"required":["credits","versionId","views"],"description":"The character's master in use from each of its camera's turnaround views, the master's own first. A take in a direction starts from its view when it's drawn."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/characters/{characterId}/masters/pick":{"post":{"operationId":"pickSpriteMaster","summary":"Pick a master","description":"Makes a candidate the character's master: a new version of its Library item. Its approved takes go back to review, having been checked against the old master, and its colour skins are rendered again from it. Picking the same candidate again returns the version it made.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"candidateId":{"type":"string","minLength":1,"maxLength":128,"examples":["cc6fa3d4-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["candidateId"]}}}},"responses":{"200":{"description":"The master version.","content":{"application/json":{"schema":{"type":"object","properties":{"n":{"type":"integer","description":"The version's number.","examples":[1]},"versionId":{"type":"string","minLength":1,"maxLength":128,"examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["n","versionId"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/characters/{characterId}/masters/returns":{"post":{"operationId":"returnSpriteEdit","summary":"Bring an edit back to Sprites","description":"Brings an edit of one of a character's images back to Sprites: once the edit's generation ends, its image is cut out as a master is (keyed for free, or through background removal, which the request holds credits for and settles at what ran) and kept as a new candidate of the character. Asking again for the same edit is the same request. Follow it with `GET /sprites/events` (`sprites.watch`), then read the rows.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"generationId":{"type":"string","minLength":1,"maxLength":128,"description":"The generation that edited one of the character's images (in the Image tool, or `POST /generations/...`). It can still be running.","examples":["241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["generationId"]}}}},"responses":{"202":{"description":"Accepted: the edit comes back when it ends.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the request sets aside, in credits: its worst case.","examples":[12]},"model":{"type":"string","description":"The capability model it runs.","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"description":"The price revision it's priced at.","examples":[3]},"requestId":{"type":"string","minLength":1,"maxLength":128,"description":"The request: the live feed (`GET /sprites/events`, topic `master`) names it and each of its candidates (`<requestId>-<n>`).","examples":["2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["credits","model","priceVersion","requestId"],"description":"A master or views request, held and started."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/characters/{characterId}/masters/{versionId}/views":{"post":{"operationId":"generateSpriteViews","summary":"Draw turnaround views","description":"Draws a master version's turnaround views for the game's camera (top-down 4-way: right and back; 8-way: also front-right and back-right; isometric: back-right), each at the master's height and baseline, into a new version. A side-scroller has none (left is mirrored). Follow it with `GET /sprites/events` (`sprites.watch`), then read the rows.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}},{"name":"versionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"The master version the views are drawn from.","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":200,"description":"A base image model (`google/nano-banana-pro`, `google/nano-banana-2.1`, `bytedance/seedream-5-lite`, `openai/gpt-image-2`, `openai/gpt-image-2.5-sunburst`, `openai/gpt-image-2.5-flare`) or its capability model id. Left out: the game's.","examples":["google/nano-banana-pro"]}}}}}},"responses":{"202":{"description":"Accepted: the request is held and started.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the request sets aside, in credits: its worst case.","examples":[12]},"model":{"type":"string","description":"The capability model it runs.","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"description":"The price revision it's priced at.","examples":[3]},"requestId":{"type":"string","minLength":1,"maxLength":128,"description":"The request: the live feed (`GET /sprites/events`, topic `master`) names it and each of its candidates (`<requestId>-<n>`).","examples":["2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"views":{"type":"array","items":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"description":"The views it draws, in camera order."}},"required":["credits","model","priceVersion","requestId","views"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/characters/{characterId}/outfits":{"post":{"operationId":"createSpriteOutfit","summary":"Create an outfit","description":"Adds an outfit to a character. With a `prompt`, an edit of its master that keeps the pose, drawn later with `POST /sprites/characters/{characterId}/outfits/generate`. With `paletteOverrides` and no prompt, a colour skin: the master with those colours swapped, rendered at once (no credits).\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Winter cloak"]},"paletteOverrides":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]},"role":{"type":"string","minLength":1,"maxLength":40,"examples":["skin"]}},"required":["hex","role"],"description":"A colour of the palette and what it's for."}},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]}},"required":["name"]}}}},"responses":{"201":{"description":"The outfit.","content":{"application/json":{"schema":{"type":"object","properties":{"characterId":{"type":"string","minLength":1,"maxLength":128,"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"fit":{"anyOf":[{"type":"object","properties":{"baselineDelta":{"type":"number","description":"How far its feet sit below (+) or above (-) the master's baseline, in canvas px.","examples":[1]},"boxDelta":{"type":"number","description":"The most any edge of its box moved from the master's.","examples":[1]},"height":{"type":"number","description":"Its height, in canvas px.","examples":[1280]},"heightDelta":{"type":"number","examples":[1]},"ok":{"type":"boolean","description":"Every measure within 1 px of the master's; otherwise the studio warns."},"width":{"type":"number","examples":[1024]},"widthDelta":{"type":"number","examples":[1]}},"required":["baselineDelta","height"]},{"type":"null"}],"description":"How it sits against the base master (the fit check); `null` until it's made."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"isBase":{"type":"boolean"},"master":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The outfit's master; `null` until it's made."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"paletteOverrides":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]},"role":{"type":"string","minLength":1,"maxLength":40,"examples":["skin"]}},"required":["hex","role"],"description":"A colour of the palette and what it's for."},"description":"A colour skin's colours: each `role` is a colour of the master (`#rrggbb`), its `hex` the colour the skin paints instead."},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"status":{"enum":["queued","generating","ready","failed"],"type":"string"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["characterId","createdAt","fit","id","isBase","master","name","paletteOverrides","prompt","status","updatedAt"],"description":"An outfit: an edit of the master that keeps the pose (drawn from its prompt), or a colour skin (palette overrides, no prompt). The base outfit is the master itself."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"},"get":{"operationId":"listSpriteOutfits","summary":"List a character's outfits","description":"A character's outfits: the base outfit (the master itself, made the first time it's asked for) first, then the rest oldest first, each with its master (a short-lived URL) and fit check once it's made.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"responses":{"200":{"description":"The outfits.","content":{"application/json":{"schema":{"type":"object","properties":{"outfits":{"type":"array","items":{"type":"object","properties":{"characterId":{"type":"string","minLength":1,"maxLength":128,"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"fit":{"anyOf":[{"type":"object","properties":{"baselineDelta":{"type":"number","description":"How far its feet sit below (+) or above (-) the master's baseline, in canvas px.","examples":[1]},"boxDelta":{"type":"number","description":"The most any edge of its box moved from the master's.","examples":[1]},"height":{"type":"number","description":"Its height, in canvas px.","examples":[1280]},"heightDelta":{"type":"number","examples":[1]},"ok":{"type":"boolean","description":"Every measure within 1 px of the master's; otherwise the studio warns."},"width":{"type":"number","examples":[1024]},"widthDelta":{"type":"number","examples":[1]}},"required":["baselineDelta","height"]},{"type":"null"}],"description":"How it sits against the base master (the fit check); `null` until it's made."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"isBase":{"type":"boolean"},"master":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The outfit's master; `null` until it's made."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"paletteOverrides":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]},"role":{"type":"string","minLength":1,"maxLength":40,"examples":["skin"]}},"required":["hex","role"],"description":"A colour of the palette and what it's for."},"description":"A colour skin's colours: each `role` is a colour of the master (`#rrggbb`), its `hex` the colour the skin paints instead."},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"status":{"enum":["queued","generating","ready","failed"],"type":"string"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["characterId","createdAt","fit","id","isBase","master","name","paletteOverrides","prompt","status","updatedAt"],"description":"An outfit: an edit of the master that keeps the pose (drawn from its prompt), or a colour skin (palette overrides, no prompt). The base outfit is the master itself."}}},"required":["outfits"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/outfits/{outfitId}":{"delete":{"operationId":"deleteSpriteOutfit","summary":"Delete an outfit","description":"Deletes an outfit, the takes drawn in it and their frames. A character shown in it goes back to the base outfit, which can't be deleted.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"outfitId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"},"patch":{"operationId":"updateSpriteOutfit","summary":"Update an outfit","description":"Changes an outfit's name, prompt or palette overrides; the rest stay. A colour skin's new overrides render it again. The base outfit only takes a new name.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"outfitId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"paletteOverrides":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]},"role":{"type":"string","minLength":1,"maxLength":40,"examples":["skin"]}},"required":["hex","role"],"description":"A colour of the palette and what it's for."}},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]}}}}}},"responses":{"200":{"description":"The outfit.","content":{"application/json":{"schema":{"type":"object","properties":{"characterId":{"type":"string","minLength":1,"maxLength":128,"examples":["eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"fit":{"anyOf":[{"type":"object","properties":{"baselineDelta":{"type":"number","description":"How far its feet sit below (+) or above (-) the master's baseline, in canvas px.","examples":[1]},"boxDelta":{"type":"number","description":"The most any edge of its box moved from the master's.","examples":[1]},"height":{"type":"number","description":"Its height, in canvas px.","examples":[1280]},"heightDelta":{"type":"number","examples":[1]},"ok":{"type":"boolean","description":"Every measure within 1 px of the master's; otherwise the studio warns."},"width":{"type":"number","examples":[1024]},"widthDelta":{"type":"number","examples":[1]}},"required":["baselineDelta","height"]},{"type":"null"}],"description":"How it sits against the base master (the fit check); `null` until it's made."},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"isBase":{"type":"boolean"},"master":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The outfit's master; `null` until it's made."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"paletteOverrides":{"type":"array","maxItems":64,"items":{"type":"object","properties":{"hex":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","examples":["#140f17"]},"role":{"type":"string","minLength":1,"maxLength":40,"examples":["skin"]}},"required":["hex","role"],"description":"A colour of the palette and what it's for."},"description":"A colour skin's colours: each `role` is a colour of the master (`#rrggbb`), its `hex` the colour the skin paints instead."},"prompt":{"type":"string","maxLength":4000,"examples":["A lighthouse on a cliff at dusk, cinematic"]},"status":{"enum":["queued","generating","ready","failed"],"type":"string"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["characterId","createdAt","fit","id","isBase","master","name","paletteOverrides","prompt","status","updatedAt"],"description":"An outfit: an edit of the master that keeps the pose (drawn from its prompt), or a colour skin (palette overrides, no prompt). The base outfit is the master itself."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/characters/{characterId}/outfits/estimate":{"post":{"operationId":"estimateSpriteOutfit","summary":"Estimate an outfit","description":"What drawing an outfit would set aside now, in credits: one edit of the master and a background removal. Nothing is started or charged.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":200,"description":"A base image model (`google/nano-banana-pro`, `openai/gpt-image-2`, `openai/gpt-image-2.5-sunburst`, `openai/gpt-image-2.5-flare`) or its `sprite_view/…` capability model id. Left out: the game's.","examples":["google/nano-banana-pro"]}}}}}},"responses":{"200":{"description":"What drawing the outfit would set aside.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the request sets aside, in credits: its worst case.","examples":[12]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"description":"The price revision it's priced at.","examples":[3]}},"required":["credits","model","priceVersion"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/characters/{characterId}/outfits/generate":{"post":{"operationId":"generateSpriteOutfit","summary":"Draw an outfit","description":"Draws an outfit as an edit of the character's master: only the clothing and gear `prompt` names change, and the pose, size and framing stay the master's (the master and the pose guide are its references). Send `prompt` (and a `name`) for a new outfit, or `outfitId` to draw one again. The outfit goes `queued`, `generating`, then `ready` with its master and its fit check (height, baseline, width and position against the master, each within 1 px or a warning), or `failed`. Holds credits for the worst case and settles at what ran. Follow it with `GET /sprites/events` (topic `outfit`), then read `GET /sprites/characters/{characterId}/outfits`.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":200,"description":"A base image model (`google/nano-banana-pro`, `openai/gpt-image-2`, `openai/gpt-image-2.5-sunburst`, `openai/gpt-image-2.5-flare`) or its `sprite_view/…` capability model id. Left out: the game's.","examples":["google/nano-banana-pro"]},"name":{"type":"string","minLength":1,"maxLength":120,"description":"A new outfit's name; made from the first words of its prompt when left out.","examples":["Scout hood"]},"outfitId":{"type":"string","minLength":1,"maxLength":128,"description":"Draw this outfit again (not the base outfit or a colour skin). Left out: a new outfit is made.","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"prompt":{"type":"string","maxLength":4000,"description":"What the outfit changes: the clothing and gear to draw. Needed for a new outfit; an outfit drawn again keeps its own without it.","examples":["A hooded scout cloak with no cape"]}}}}}},"responses":{"202":{"description":"Accepted: the outfit is held and queued.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the request sets aside, in credits: its worst case.","examples":[12]},"model":{"type":"string","description":"The capability model it runs.","examples":["google/nano-banana-pro"]},"outfitId":{"type":"string","minLength":1,"maxLength":128,"description":"The outfit, `queued`: the live feed (`GET /sprites/events`, topic `outfit`) names it as it's drawn.","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"examples":[3]},"requestId":{"type":"string","minLength":1,"maxLength":128,"description":"The request: its credit hold.","examples":["2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["credits","model","outfitId","priceVersion","requestId"],"description":"An outfit held and started."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/presets":{"post":{"operationId":"createSpritePreset","summary":"Create a preset","description":"Saves a timing or export setup for every game of the workspace.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The setup, as the Studio saves it.","examples":[{}]},"kind":{"enum":["timing","export"],"type":"string","description":"`timing` (fps, playback, holds) or `export` (engine setup)."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Snappy combat"]}},"required":["data","kind","name"]}}}},"responses":{"201":{"description":"The preset.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{}]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["timing","export"],"type":"string","description":"`timing` (fps, playback, holds) or `export` (engine setup)."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["createdAt","data","id","kind","name","updatedAt"],"description":"A saved timing or export setup of the workspace."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"sprites:write"},"get":{"operationId":"listSpritePresets","summary":"List presets","description":"The workspace's saved presets, oldest first.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"kind","in":"query","schema":{"enum":["timing","export"],"type":"string","description":"`timing` (fps, playback, holds) or `export` (engine setup)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The presets.","content":{"application/json":{"schema":{"type":"object","properties":{"presets":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{}]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["timing","export"],"type":"string","description":"`timing` (fps, playback, holds) or `export` (engine setup)."},"name":{"type":"string","minLength":1,"maxLength":120,"examples":["Autumn campaign"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["createdAt","data","id","kind","name","updatedAt"],"description":"A saved timing or export setup of the workspace."}}},"required":["presets"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/takes/{takeId}/approve":{"post":{"operationId":"approveSpriteTake","summary":"Approve a take","description":"Approves a finished take (draft or needing review) as its action's frames in that direction and outfit. The take approved there before goes back to review.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"takeId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9e"]}}],"responses":{"200":{"description":"The take.","content":{"application/json":{"schema":{"type":"object","properties":{"actionId":{"type":"string","minLength":1,"maxLength":128,"examples":["c4f7ff02-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"approvedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"approvedByUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["b11d81fb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["b11d81fb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"change":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What it was asked to change from its action's words; `null`: drawn as the action says."},"clip":{"anyOf":[{"type":"object","properties":{"cutBy":{"anyOf":[{"enum":["key","removal"],"type":"string"},{"type":"null"}],"description":"How its frames were cut out: `key`, keyed by colour for free; `removal`, through paid background removal; `null`: not recorded."},"fallback":{"anyOf":[{"type":"object","properties":{"from":{"type":"string"},"reason":{"type":"string"}},"required":["from","reason"]},{"type":"null"}],"description":"Why another model made it than the one asked for."},"fps":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"examples":[1]},"frameCount":{"type":"integer","examples":[1]},"seconds":{"anyOf":[{"type":"integer","examples":[5]},{"type":"null"}],"description":"How long the clip was asked to be.","examples":[5]},"snapped":{"type":"boolean","description":"Pixel snap is on: its frames have a pixel look (`takes.clipSnap`)."}},"required":["cutBy","fallback","fps","frameCount","seconds","snapped"]},{"type":"null"}],"description":"A clip take whose every frame was kept (`takes.clipInspector`); `null`: any other."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"credits":{"anyOf":[{"type":"integer","examples":[12]},{"type":"null"}],"examples":[12]},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"failure":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, in plain words."},"frames":{"type":"array","items":{"type":"object","properties":{"clipIndex":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"The clip frame it plays; `null`: it isn't from a clip.","examples":[1]},"editedFromKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The key before a touch-up, kept for undo.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"gameplay":{"anyOf":[{"type":"object","properties":{"events":{"type":"array","maxItems":16,"items":{"type":"string","minLength":1,"maxLength":60}},"hit":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]},"damage":{"type":"integer","minimum":0,"maximum":9999,"description":"Damage the hit deals; absent: the game decides.","examples":[1]},"knockback":{"type":"object","properties":{"x":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]},"y":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]}},"required":["x","y"],"description":"The push a hit gives, in game units: x forward as faced, y up."},"on":{"type":"boolean"}},"required":["h","w","x","y","on"]},"hurt":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]}},"required":["h","w","x","y"],"description":"A box in sprite px from the top left, facing right."},"root":{"type":"number","description":"How far the body moves forward on this frame, in px.","examples":[1]}},"required":["events","hit","hurt","root"],"description":"A frame's gameplay data, as games read it."},{"type":"null"}]},"holdMs":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"How long it holds, in ms; `null`: the action's fps.","examples":[1]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"index":{"type":"integer","examples":[1]},"isTween":{"type":"boolean"},"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"locked":{"type":"boolean","description":"Kept as is when the take is generated again."},"offsetX":{"type":"integer","description":"Where preview and export draw it, in canvas px.","examples":[1]},"offsetY":{"type":"integer","examples":[1]},"score":{"anyOf":[{"type":"number","examples":[1]},{"type":"null"}],"description":"How close it is to the master, 0 to 1.","examples":[1]},"scoreModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"takeId":{"type":"string","minLength":1,"maxLength":128,"examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["clipIndex","editedFromKey","gameplay","holdMs","id","index","isTween","key","locked","offsetX","offsetY","score","scoreModel","takeId","url"],"description":"A frame of a take."}},"generationIds":{"type":"array","items":{"type":"string"}},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"outfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"`null`: the base outfit.","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"raw":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The raw sheet or clip, before cleanup."},"seed":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"examples":[1]},"status":{"enum":["queued","generating","draft","review","approved","failed"],"type":"string"},"step":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The pipeline step it's on, while it runs."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["actionId","approvedAt","approvedByUserId","change","clip","createdAt","credits","direction","failure","frames","generationIds","id","masterVersionId","model","outfitId","raw","seed","status","step","updatedAt"],"description":"One generation of an action in one direction, with its frames."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/characters/{characterId}/takes":{"get":{"operationId":"listSpriteTakes","summary":"List a character's takes","description":"A character's takes, newest first, each with its frames in order and short-lived download URLs. Takes of removed actions are left out.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}},{"name":"actionId","in":"query","schema":{"type":"string","minLength":1,"maxLength":128,"description":"Only this action's.","examples":["c4f7ff02-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"allowEmptyValue":true,"allowReserved":true},{"name":"direction","in":"query","schema":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The takes.","content":{"application/json":{"schema":{"type":"object","properties":{"takes":{"type":"array","items":{"type":"object","properties":{"actionId":{"type":"string","minLength":1,"maxLength":128,"examples":["c4f7ff02-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"approvedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"approvedByUserId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["b11d81fb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["b11d81fb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"change":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What it was asked to change from its action's words; `null`: drawn as the action says."},"clip":{"anyOf":[{"type":"object","properties":{"cutBy":{"anyOf":[{"enum":["key","removal"],"type":"string"},{"type":"null"}],"description":"How its frames were cut out: `key`, keyed by colour for free; `removal`, through paid background removal; `null`: not recorded."},"fallback":{"anyOf":[{"type":"object","properties":{"from":{"type":"string"},"reason":{"type":"string"}},"required":["from","reason"]},{"type":"null"}],"description":"Why another model made it than the one asked for."},"fps":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"examples":[1]},"frameCount":{"type":"integer","examples":[1]},"seconds":{"anyOf":[{"type":"integer","examples":[5]},{"type":"null"}],"description":"How long the clip was asked to be.","examples":[5]},"snapped":{"type":"boolean","description":"Pixel snap is on: its frames have a pixel look (`takes.clipSnap`)."}},"required":["cutBy","fallback","fps","frameCount","seconds","snapped"]},{"type":"null"}],"description":"A clip take whose every frame was kept (`takes.clipInspector`); `null`: any other."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"credits":{"anyOf":[{"type":"integer","examples":[12]},{"type":"null"}],"examples":[12]},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"failure":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, in plain words."},"frames":{"type":"array","items":{"type":"object","properties":{"clipIndex":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"The clip frame it plays; `null`: it isn't from a clip.","examples":[1]},"editedFromKey":{"anyOf":[{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The key before a touch-up, kept for undo.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"gameplay":{"anyOf":[{"type":"object","properties":{"events":{"type":"array","maxItems":16,"items":{"type":"string","minLength":1,"maxLength":60}},"hit":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]},"damage":{"type":"integer","minimum":0,"maximum":9999,"description":"Damage the hit deals; absent: the game decides.","examples":[1]},"knockback":{"type":"object","properties":{"x":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]},"y":{"type":"integer","minimum":-9999,"maximum":9999,"examples":[1]}},"required":["x","y"],"description":"The push a hit gives, in game units: x forward as faced, y up."},"on":{"type":"boolean"}},"required":["h","w","x","y","on"]},"hurt":{"type":"object","properties":{"h":{"type":"integer","minimum":0,"examples":[1]},"w":{"type":"integer","minimum":0,"examples":[1]},"x":{"type":"integer","examples":[1]},"y":{"type":"integer","examples":[1]}},"required":["h","w","x","y"],"description":"A box in sprite px from the top left, facing right."},"root":{"type":"number","description":"How far the body moves forward on this frame, in px.","examples":[1]}},"required":["events","hit","hurt","root"],"description":"A frame's gameplay data, as games read it."},{"type":"null"}]},"holdMs":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"How long it holds, in ms; `null`: the action's fps.","examples":[1]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"index":{"type":"integer","examples":[1]},"isTween":{"type":"boolean"},"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"locked":{"type":"boolean","description":"Kept as is when the take is generated again."},"offsetX":{"type":"integer","description":"Where preview and export draw it, in canvas px.","examples":[1]},"offsetY":{"type":"integer","examples":[1]},"score":{"anyOf":[{"type":"number","examples":[1]},{"type":"null"}],"description":"How close it is to the master, 0 to 1.","examples":[1]},"scoreModel":{"anyOf":[{"type":"string"},{"type":"null"}]},"takeId":{"type":"string","minLength":1,"maxLength":128,"examples":["2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["clipIndex","editedFromKey","gameplay","holdMs","id","index","isTween","key","locked","offsetX","offsetY","score","scoreModel","takeId","url"],"description":"A frame of a take."}},"generationIds":{"type":"array","items":{"type":"string"}},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"masterVersionId":{"anyOf":[{"type":"string","examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"outfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"`null`: the base outfit.","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"raw":{"anyOf":[{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"url":{"type":"string","description":"A short-lived download URL.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","url"],"description":"A file in your storage."},{"type":"null"}],"description":"The raw sheet or clip, before cleanup."},"seed":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"examples":[1]},"status":{"enum":["queued","generating","draft","review","approved","failed"],"type":"string"},"step":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The pipeline step it's on, while it runs."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]}},"required":["actionId","approvedAt","approvedByUserId","change","clip","createdAt","credits","direction","failure","frames","generationIds","id","masterVersionId","model","outfitId","raw","seed","status","step","updatedAt"],"description":"One generation of an action in one direction, with its frames."}}},"required":["takes"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"},"post":{"operationId":"generateSpriteTake","summary":"Draw a take","description":"Makes one take of an action in a direction: a short video clip that starts on the master, with every frame kept, cut out and fitted to the master's height and baseline, and its best loop (or the whole clip, for a one-shot) selected as the take's frames (`takes.clipInspector` shows them all). With `source: sheet` or an image model, one sheet of its frames instead. It's `queued`, then `generating`, then a `draft` with its frames (or `failed`, refunded). The character needs a master. Follow it with `GET /sprites/events` (`sprites.watch`), then read the rows.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":200,"description":"An image model for sheet takes (`google/nano-banana-pro`, `openai/gpt-image-2`, `google/nano-banana-2.1`) or a video model for clip takes (`kling/v4`, `bytedance/seedance-2.5`, `xai/grok-imagine-video-1.5`), or its capability model id (`sprite_take/…`, `sprite_clip_take/…`). Takes of the other kind, and all when left out, use the game's (else Nano Banana Pro and the plan's video model).","examples":["google/nano-banana-pro"]},"actionId":{"type":"string","minLength":1,"maxLength":128,"examples":["c4f7ff02-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"change":{"type":"string","maxLength":500,"description":"What to change from the action's words, for this take only (a regeneration's \"slower swing, arms wider\"). The action keeps its own words."},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string","description":"A direction the game's camera draws. Left-facing ones (W, NW, SW) are mirrored at export, never drawn."},"outfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Left out or `null`: the base outfit.","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"seconds":{"type":"integer","minimum":1,"maximum":30,"description":"A clip's length, within the model's durations. Left out: the action's, its preset's, or the model's default.","examples":[5]},"source":{"enum":["sheet","clip"],"type":"string","description":"`clip`: the master animated as a short video, every frame kept. `sheet`: every frame drawn in one image. Left out: a clip, unless `model` is an image model."}},"required":["actionId","direction"]}}}},"responses":{"202":{"description":"Accepted: the take is held and queued.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the request sets aside, in credits: its worst case.","examples":[12]},"model":{"type":"string","description":"The capability model it runs.","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"description":"The price revision it's priced at.","examples":[3]},"requestId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The request's hold; `null` when there was nothing to draw.","examples":["2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"takes":{"type":"array","items":{"type":"object","properties":{"actionId":{"type":"string","minLength":1,"maxLength":128,"examples":["c4f7ff02-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128,"description":"The take (`queued`): the live feed (`GET /sprites/events`, topic `take`) follows it.","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"model":{"type":"string","description":"The capability model the take runs.","examples":["google/nano-banana-pro"]},"outfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"enum":["sheet","clip"],"type":"string"}},"required":["actionId","direction","id","model","outfitId","source"]}}},"required":["credits","model","priceVersion","requestId","takes"],"description":"Takes held and started."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/takes/{takeId}":{"delete":{"operationId":"deleteSpriteTake","summary":"Delete a take","description":"Deletes a take (a version of an action in a direction) with its frames and files. A take still drawing can't be deleted; the action and its other takes stay.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"takeId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9e"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/characters/{characterId}/takes/estimate":{"post":{"operationId":"estimateSpriteTakes","summary":"Estimate takes","description":"What making takes would usually cost now, in credits (`credits`), and what they would set aside (`holdCredits`). A sheet take sets aside its sheet and a background removal; a clip take its clip by the second and a background removal per frame, used only when the clip's ground won't key, and what isn't used goes back. Send `items`, or leave them out to price every missing take (as `generateMissing` would make them). Nothing is started or charged.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":200,"description":"An image model for sheet takes (`google/nano-banana-pro`, `openai/gpt-image-2`, `google/nano-banana-2.1`) or a video model for clip takes (`kling/v4`, `bytedance/seedance-2.5`, `xai/grok-imagine-video-1.5`), or its capability model id (`sprite_take/…`, `sprite_clip_take/…`). Takes of the other kind, and all when left out, use the game's (else Nano Banana Pro and the plan's video model).","examples":["google/nano-banana-pro"]},"outfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Left out or `null`: the base outfit.","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"enum":["sheet","clip"],"type":"string","description":"Make every missing take this way; left out: clips, unless `model` is an image model."},"items":{"type":"array","minItems":1,"maxItems":64,"items":{"type":"object","properties":{"actionId":{"type":"string","minLength":1,"maxLength":128,"examples":["c4f7ff02-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"change":{"type":"string","maxLength":500,"description":"What to change from the action's words, for this take only (a regeneration's \"slower swing, arms wider\"). The action keeps its own words."},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string","description":"A direction the game's camera draws. Left-facing ones (W, NW, SW) are mirrored at export, never drawn."},"outfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Left out or `null`: the base outfit.","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"seconds":{"type":"integer","minimum":1,"maximum":30,"description":"A clip's length, within the model's durations. Left out: the action's, its preset's, or the model's default.","examples":[5]},"source":{"enum":["sheet","clip"],"type":"string","description":"`clip`: the master animated as a short video, every frame kept. `sheet`: every frame drawn in one image. Left out: a clip, unless `model` is an image model."}},"required":["actionId","direction"],"description":"One take to make: an action in a direction."},"description":"The takes to price; left out: every missing one."}}}}}},"responses":{"200":{"description":"What the takes would cost and set aside.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the takes usually cost: a clip's frames key for free.","examples":[12]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"description":"The price revision it's priced at.","examples":[3]},"count":{"type":"integer","description":"How many takes it draws.","examples":[1]},"holdCredits":{"type":"integer","description":"What starting them sets aside: every take's worst case. What isn't used goes back.","examples":[12]}},"required":["credits","model","priceVersion","count","holdCredits"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/sprites/characters/{characterId}/takes/missing":{"post":{"operationId":"generateMissingSpriteTakes","summary":"Draw the missing takes","description":"Makes every take the character lacks: each action (as a clip, or as `source` says) in each direction its game's camera draws (left-facing ones are mirrored at export), in the outfit asked for, with no take there that hasn't failed. At most 64 at a time; they run as the plan's renders at a time allow, under one credit hold. It starts as many as the balance covers, in action order, and says how many it `skipped`; `402` only when not even one can start. Nothing to draw: `requestId` is `null`. Follow it with `GET /sprites/events` (`sprites.watch`), then read the rows.\n\nRequires scope `sprites:write`.","tags":["Sprites"],"parameters":[{"name":"characterId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","minLength":1,"maxLength":200,"description":"An image model for sheet takes (`google/nano-banana-pro`, `openai/gpt-image-2`, `google/nano-banana-2.1`) or a video model for clip takes (`kling/v4`, `bytedance/seedance-2.5`, `xai/grok-imagine-video-1.5`), or its capability model id (`sprite_take/…`, `sprite_clip_take/…`). Takes of the other kind, and all when left out, use the game's (else Nano Banana Pro and the plan's video model).","examples":["google/nano-banana-pro"]},"outfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Left out or `null`: the base outfit.","examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"enum":["sheet","clip"],"type":"string","description":"Make every missing take this way; left out: clips, unless `model` is an image model."}}}}}},"responses":{"202":{"description":"Accepted: the takes are held and queued.","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer","description":"What the request sets aside, in credits: its worst case.","examples":[12]},"model":{"type":"string","description":"The capability model it runs.","examples":["google/nano-banana-pro"]},"priceVersion":{"anyOf":[{"type":"integer","examples":[3]},{"type":"null"}],"description":"The price revision it's priced at.","examples":[3]},"requestId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The request's hold; `null` when there was nothing to draw.","examples":["2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"takes":{"type":"array","items":{"type":"object","properties":{"actionId":{"type":"string","minLength":1,"maxLength":128,"examples":["c4f7ff02-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"direction":{"enum":["E","W","N","S","NE","NW","SE","SW"],"type":"string"},"id":{"type":"string","minLength":1,"maxLength":128,"description":"The take (`queued`): the live feed (`GET /sprites/events`, topic `take`) follows it.","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"model":{"type":"string","description":"The capability model the take runs.","examples":["google/nano-banana-pro"]},"outfitId":{"anyOf":[{"type":"string","minLength":1,"maxLength":128,"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"enum":["sheet","clip"],"type":"string"}},"required":["actionId","direction","id","model","outfitId","source"]}},"refusal":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why takes were left out, as the ledger said it; `null` when none were."},"skipped":{"type":"integer","description":"Takes left out because the balance didn't cover them.","examples":[1]},"skippedAnimations":{"type":"integer","description":"Animations with at least one take left out.","examples":[1]}},"required":["credits","model","priceVersion","requestId","takes","refusal","skipped","skippedAnimations"],"description":"The missing takes the balance covers, held and started, and how many it didn't."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"403":{"description":"Forbidden: the credentials are valid but can't use this resource.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["FORBIDDEN"],"examples":["FORBIDDEN"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You don't have access to this resource."],"type":"string"},"status":{"const":403,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"429":{"description":"429","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONCURRENCY_LIMIT"],"examples":["CONCURRENCY_LIMIT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Your plan's renders are all busy: wait for one to finish."],"type":"string"},"status":{"const":429,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":"concurrency_limit","description":"`concurrency_limit`: the workspace's plan is already running as many renders as it allows."},"limit":{"type":"integer","description":"Renders the plan runs at a time.","examples":[20]},"running":{"type":"integer","description":"The workspace's renders queued or running now.","examples":[1]}},"required":["code","limit","running"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:write"}},"/sprites/events":{"get":{"operationId":"watchSprites","summary":"Follow Sprite Studio","description":"Streams the workspace's Sprite Studio changes as server-sent events: master requests and candidates (topic `master`), outfits (`outfit`), takes (`take`), drift runs (`drift`), exports (`export`) and sheet imports (`import`), each as `{ topic, id, status, step?, progress? }`. An event only says what changed: read the rows. Nothing is replayed: list when you connect and again whenever you reconnect. The stream ends after 15 minutes; reconnect to keep following.\n\nRequires scope `sprites:read`.","tags":["Sprites"],"parameters":[],"responses":{"200":{"description":"An event stream of the workspace's sprite changes.","content":{"text/event-stream":{"schema":{"oneOf":[{"type":"object","properties":{"event":{"const":"message"},"data":{"type":"object","properties":{"id":{"type":"string","description":"What changed: a master request or candidate (`master`), an outfit (`outfit`), a take (`take`), a drift run (`drift`), an export (`export`) or a sheet import (`import`).","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"progress":{"type":"number","minimum":0,"maximum":1,"examples":[1]},"result":{"enum":["fixed","tweened","failed"],"type":"string","description":"On `take`, how a paid frame edit ended: `fixed` (a frame redrawn), `tweened` (in-betweens added) or `failed`."},"status":{"type":"string"},"step":{"type":"string","description":"What it's doing now, or why it failed, in plain words."},"topic":{"enum":["drift","export","import","master","outfit","take"],"type":"string"}},"required":["id","status","topic"],"description":"One change in the workspace's Sprite Studio."},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event","data"]},{"type":"object","properties":{"event":{"const":"done"},"data":{"type":"object","properties":{"reason":{"enum":["closed","timeout"],"type":"string"}},"required":["reason"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event","data"]},{"type":"object","properties":{"event":{"const":"error"},"data":{},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event"]}]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"sprites:read"}},"/presets/{slug}/results":{"post":{"operationId":"addPresetResults","summary":"Keep a preset's example results","description":"Records a preset's example results on the nodes it was inserted as (after `insertPreset` and a save), so they stay on the canvas: the files are copied into your workspace and kept as one finished run.\n\nRequires scope `templates:use`.","tags":["Templates"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"nodeIds":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"type":"string","minLength":1,"maxLength":64},"description":"Each fragment node id and the id it was inserted as (what `insertPreset` returns).","examples":[{}]},"workflowId":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["nodeIds","workflowId"]}}}},"responses":{"201":{"description":"How many results were recorded.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"integer","description":"Example results recorded on the project's nodes.","examples":[1]}},"required":["results"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"templates:use"}},"/templates/{slug}":{"delete":{"operationId":"deleteTemplate","summary":"Delete a template","description":"Deletes a template you saved from a project. Projects made from it stay.\n\nRequires scope `templates:delete`.","tags":["Templates"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"templates:delete"},"get":{"operationId":"getTemplate","summary":"Get a template","description":"A template with its canvas, read-only: each node's box, title and example image.\n\nRequires scope `templates:read`.","tags":["Templates"],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":80}}],"responses":{"200":{"description":"The template.","content":{"application/json":{"schema":{"type":"object","properties":{"coverThumbnailUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"A small WebP of the cover (download URL) for cards and tiles; null where none was made, so show `coverUrl`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"coverUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"The card's image at full size (download URL), once previews are made.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"outputKind":{"enum":["image","video","audio"],"type":"string","description":"What it mainly makes."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A short clip the card plays on hover (video templates).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"canDelete":{"type":"boolean","description":"You saved it, so you can delete it."},"categories":{"type":"array","items":{"enum":["cinematic","advertising","fashion","branding","fmcg","fastfood","editing","campaigns"],"type":"string"}},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"ownerName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Who saved it (a workspace's own); null for ours."},"slug":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]},"visibility":{"anyOf":[{"enum":["personal","team"],"type":"string"},{"type":"null"}],"description":"A workspace's own: `personal` (its maker only) or `team`. Null for ours, which everyone sees."},"canvas":{"type":"object","properties":{"bounds":{"type":"object","properties":{"h":{"type":"number","examples":[1]},"w":{"type":"number","examples":[1]},"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["h","w","x","y"]},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"type":"string"},"target":{"type":"string"}},"required":["id","source","target"]}},"nodes":{"type":"array","items":{"type":"object","properties":{"h":{"type":"number","examples":[1]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"image":{"type":"string","description":"The newest image the node made (download URL)."},"label":{"type":"string"},"parentId":{"type":"string","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"text":{"type":"string"},"type":{"type":"string"},"w":{"type":"number","examples":[1]},"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["h","id","label","type","w","x","y"]}}},"required":["bounds","edges","nodes"],"description":"The canvas as boxes, for a preview: each node's absolute rectangle, title, short text and newest image, and the edges between them."},"nodeCount":{"type":"integer","examples":[1]},"workflow":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"nodeCount":{"type":"integer","examples":[1]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"version":{"type":"integer","examples":[3]},"activeRuns":{"type":"array","items":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"anyOf":[{},{}]},{"type":"null"}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"description":"The runs still going."},"creditsSpent":{"type":"integer","description":"The credits all the workflow's runs have spent.","examples":[12]},"document":{"type":"object","properties":{"pages":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","properties":{"edges":{"type":"array","maxItems":2000,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"sourceHandle":{"type":"string","minLength":1,"maxLength":64},"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"targetHandle":{"type":"string","minLength":1,"maxLength":64}},"required":["id","source","sourceHandle","target","targetHandle"]},"default":[]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"nodes":{"type":"array","maxItems":500,"items":{"type":"object","properties":{"data":{"type":"object","properties":{"exposedParameterKeys":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":64}},"label":{"type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{"seed":42}]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{},"additionalProperties":{},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]}},"required":["createdAt","id","status"]},"default":[]},"selectedResultIndex":{"type":"integer","minimum":0,"examples":[1]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["default","processing","error","success"],"type":"string","default":"default"},"tags":{"type":"array","maxItems":12,"items":{"type":"string","minLength":1,"maxLength":32}},"variables":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"maxLength":64},"variableId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["84598e5d-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["handle","variableId"]}}},"default":{"results":[],"settings":{},"status":"default"}},"height":{"type":"number","exclusiveMinimum":0,"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"parentId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"position":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["x","y"]},"type":{"type":"string","minLength":1,"maxLength":64},"width":{"type":"number","exclusiveMinimum":0,"examples":[1024]}},"required":["id","position","type"]},"default":[]},"viewport":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]},"zoom":{"type":"number","exclusiveMinimum":0,"examples":[1]}},"required":["x","y","zoom"]}},"required":["id","name"]},"default":[{"id":"page-1","name":"Page 1","edges":[],"nodes":[]}]},"schemaVersion":{"const":2,"default":2},"variables":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"options":{"type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":200}},"pageId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","number","choice"],"type":"string"},"value":{"type":"string","maxLength":100000,"default":""}},"required":["id","name","type"]},"default":[]}},"description":"The document (`schemaVersion: 2`): `pages` of `nodes` and `edges` in React Flow's shape, and the workflow's `variables`. A node's settings are in `data.settings` (see `GET /node-types`); edges join handles by key. Nodes' `results` and `status` are the server's: they're filled in when you read the workflow and ignored when you save it. A node shows and sends on the result at `data.selectedResultIndex`, or its newest when that's left out."},"files":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Download URLs of the workspace's files the document points at (Import files, batch uploads, media variables), by storage key, to show them before anything runs.","examples":[{}]}},"required":["createdAt","id","name","nodeCount","updatedAt","version","activeRuns","creditsSpent","document","files"],"description":"The template as a workflow, read-only: its document with each example result as a finished result (files with download URLs), for the canvas to open it as it is."}},"required":["coverThumbnailUrl","coverUrl","outputKind","previewUrl","canDelete","categories","description","ownerName","slug","title","visibility","canvas","nodeCount","workflow"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"templates:read"}},"/presets":{"get":{"operationId":"listPresets","summary":"List presets","description":"The presets for the canvas's Presets panel, by tab and search, each with the graph to insert and its example results.\n\nRequires scope `templates:read`.","tags":["Templates"],"parameters":[{"name":"category","in":"query","schema":{"enum":["marketing","branding","ecommerce"],"type":"string","description":"Only presets in this tab."},"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string","maxLength":200,"description":"Only those whose title or description contains this (any case)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The presets, in panel order.","content":{"application/json":{"schema":{"type":"object","properties":{"presets":{"type":"array","items":{"type":"object","properties":{"coverThumbnailUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"A small WebP of the cover (download URL) for cards and tiles; null where none was made, so show `coverUrl`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"coverUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"The card's image at full size (download URL), once previews are made.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"outputKind":{"enum":["image","video","audio"],"type":"string","description":"What it mainly makes."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A short clip the card plays on hover (video templates).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"category":{"enum":["marketing","branding","ecommerce"],"type":"string"},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"fragment":{"type":"object","properties":{"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"sourceHandle":{"type":"string","minLength":1,"maxLength":64},"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"targetHandle":{"type":"string","minLength":1,"maxLength":64}},"required":["id","source","sourceHandle","target","targetHandle"]}},"nodes":{"type":"array","items":{"type":"object","properties":{"data":{"type":"object","properties":{"exposedParameterKeys":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":64}},"label":{"type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{"seed":42}]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{},{},{}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]}},"required":["createdAt","id","status"]},"default":[]},"selectedResultIndex":{"type":"integer","minimum":0,"examples":[1]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["default","processing","error","success"],"type":"string","default":"default"},"tags":{"type":"array","maxItems":12,"items":{"type":"string","minLength":1,"maxLength":32}},"variables":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"maxLength":64},"variableId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["84598e5d-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["handle","variableId"]}}},"default":{"results":[],"settings":{},"status":"default"}},"height":{"type":"number","exclusiveMinimum":0,"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"parentId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"position":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["x","y"]},"type":{"type":"string","minLength":1,"maxLength":64},"width":{"type":"number","exclusiveMinimum":0,"examples":[1024]}},"required":["id","position","type"]}},"results":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{},"format":{}}},{"type":"object","properties":{"content":{},"contentType":{},"durationSeconds":{},"format":{},"height":{},"kind":{},"thumbnail":{},"thumbnailUrl":{},"url":{},"width":{}}}]}},"format":{"const":"list"}},"required":["content","format"]}]},"examples":[{}]},"description":"Example outputs by the fragment's node ids, files with download URLs.","examples":[{}]}},"required":["edges","nodes","results"],"description":"The graph to insert (sections first, members with `parentId`), as `insertPreset` in @remagica/workflow/presets takes it."},"slug":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]}},"required":["coverThumbnailUrl","coverUrl","outputKind","previewUrl","category","description","fragment","slug","title"]}}},"required":["presets"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"templates:read"}},"/templates":{"get":{"operationId":"listTemplates","summary":"List templates","description":"The templates on the Templates page, by category and search, with their cover and hover preview.\n\nRequires scope `templates:read`.","tags":["Templates"],"parameters":[{"name":"category","in":"query","schema":{"enum":["cinematic","advertising","fashion","branding","fmcg","fastfood","editing","campaigns"],"type":"string","description":"Only templates in this category."},"allowEmptyValue":true,"allowReserved":true},{"name":"owner","in":"query","schema":{"enum":["mine","team"],"type":"string","description":"Only your workspace's own: `mine` (those you saved) or `team` (those saved for the whole workspace). Left out: ours and your workspace's."},"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string","maxLength":200,"description":"Only those whose title or description contains this (any case)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The templates, in gallery order.","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"coverThumbnailUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"A small WebP of the cover (download URL) for cards and tiles; null where none was made, so show `coverUrl`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"coverUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"The card's image at full size (download URL), once previews are made.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"outputKind":{"enum":["image","video","audio"],"type":"string","description":"What it mainly makes."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"A short clip the card plays on hover (video templates).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"canDelete":{"type":"boolean","description":"You saved it, so you can delete it."},"categories":{"type":"array","items":{"enum":["cinematic","advertising","fashion","branding","fmcg","fastfood","editing","campaigns"],"type":"string"}},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"ownerName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Who saved it (a workspace's own); null for ours."},"slug":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]},"visibility":{"anyOf":[{"enum":["personal","team"],"type":"string"},{"type":"null"}],"description":"A workspace's own: `personal` (its maker only) or `team`. Null for ours, which everyone sees."}},"required":["coverThumbnailUrl","coverUrl","outputKind","previewUrl","canDelete","categories","description","ownerName","slug","title","visibility"]}}},"required":["templates"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"templates:read"}},"/thumbnail-studio/formats":{"get":{"operationId":"listThumbnailFormats","summary":"List thumbnail formats","description":"The thumbnail and cover formats: each platform's exact pixels and the parts of the frame its interface covers (safe zones).\n\nRequires scope `models:list`.","tags":["Generations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"custom":{"type":"object","properties":{"max":{"type":"integer","examples":[1]},"min":{"type":"integer","examples":[1]}},"required":["max","min"],"description":"The pixel range a `custom` format's width and height take."},"formats":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"id":{"enum":["youtube","youtube-2k","vertical-cover","instagram-portrait","instagram-square","story","link-post","x-post","linkedin-post","pinterest-pin","podcast-cover","stream","custom"],"type":"string"},"label":{"type":"string"},"platforms":{"type":"array","items":{"type":"string"},"readOnly":true},"safeZones":{"type":"array","items":{"type":"object","properties":{"h":{"type":"number","examples":[1]},"label":{"type":"string"},"w":{"type":"number","examples":[1]},"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["h","label","w","x","y"]},"readOnly":true,"description":"Parts of the frame the platform's interface covers, as fractions (0–1) of the frame."},"width":{"type":"integer","examples":[1024]}},"required":["height","id","label","platforms","safeZones","width"],"description":"A platform preset: exact pixels and safe zones."},"readOnly":true}},"required":["custom","formats"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"models:list"}},"/thumbnail-studio/plan":{"post":{"operationId":"planThumbnail","summary":"Plan thumbnail concepts","description":"Turns a thumbnail brief into one to three concepts, each a different click angle: a short hook printed on the image, the references with their roles, and a ready image request for each. With `engine: llm` an art director model looks at the brief's images (video frames, a face, a product, a style) and writes each concept; `layout: collage` builds it from the supplied frames. Library references are `ref-NNNN` ids from the thumbnail reference library.\n\nRequires scope `generations:submit`.","tags":["Generations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"brief":{"type":"object","properties":{"assets":{"type":"array","maxItems":8,"items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","minLength":1,"maxLength":80},"role":{"enum":["subject","product","layout","lighting","typography"],"type":"string"}},"required":["key","role"]},"default":[]},"audience":{"type":"string","minLength":1,"maxLength":300},"concepts":{"type":"integer","minimum":1,"maximum":3,"default":2},"evidence":{"type":"string","minLength":1,"maxLength":1000},"format":{"type":"object","properties":{"height":{"type":"integer","minimum":256,"maximum":4096,"examples":[1280]},"id":{"enum":["youtube","youtube-2k","vertical-cover","instagram-portrait","instagram-square","story","link-post","x-post","linkedin-post","pinterest-pin","podcast-cover","stream","custom"],"type":"string"},"width":{"type":"integer","minimum":256,"maximum":4096,"examples":[1024]}},"required":["id"],"description":"A platform preset, or `custom` with a width and height (256–4096 px).","default":{"id":"youtube"}},"headline":{"type":"string","minLength":1,"maxLength":60},"job":{"enum":["device-review","product-comparison","gadget-build","science-curiosity","illustrated-science","math-intuition","experiment","engineering","investigation","business","podcast-episode","interview-clip","gaming","sports","lifestyle","entertainment"],"type":"string"},"layout":{"enum":["auto","collage"],"type":"string","default":"auto","description":"`collage` builds the thumbnail out of the supplied frames and photos (with fewer than two it's `auto`); `auto` lets the art director choose."},"notes":{"type":"string","minLength":1,"maxLength":2000},"promise":{"type":"string","minLength":1,"maxLength":500},"recipe":{"enum":["product-review-mkbhd","minimal-hardware-dave2d","product-comparison-mrwhosetheboss-mkbhd","gadget-curiosity-and-practical-builds","science-curiosity-veritasium","illustrated-science-kurzgesagt","math-and-diagrams-3blue1brown","experiment-spectacle-mark-rober","engineering-explainers-real-engineering","investigative-documentary-fern","editorial-business-and-geopolitics-bloomberg-originals","full-podcast-episode-three-distinct-choices","interview-clip-q-a-and-social-conversation","gaming-mechanics-progression-and-series-identity","sports-and-competitive-matchups","food-and-taste-tests","travel-luxury-and-experience","transformations-tutorials-and-practical-outcomes","horror-and-suspense","film-anime-and-story-commentary","meme-surreal-and-reaction-entertainment"],"type":"string"},"references":{"type":"array","maxItems":3,"items":{"type":"object","properties":{"id":{"type":"string","pattern":"^ref-\\d{4}$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"role":{"enum":["layout","lighting","typography"],"type":"string"}},"required":["id","role"]},"default":[]},"subject":{"type":"string","minLength":1,"maxLength":200},"textMode":{"enum":["auto","custom","none"],"type":"string","default":"auto","description":"`auto`: the art director writes a 2–4 word hook (with `headline` as a hint when given); `custom`: `headline` exactly; `none`: no text."},"title":{"type":"string","minLength":1,"maxLength":200,"examples":["Autumn campaign"]},"tone":{"type":"string","minLength":1,"maxLength":120},"variants":{"type":"integer","minimum":1,"maximum":4,"default":1},"videoFormat":{"enum":["review","experiment","explanation","episode","clip","documentary","tutorial","challenge","other"],"type":"string"}},"required":["promise"],"description":"A structured thumbnail brief."},"engine":{"enum":["deterministic","llm"],"type":"string","default":"deterministic","description":"`deterministic`: the same brief always gives the same concepts, free. `llm`: an art director model looks at the brief's images and writes each concept's hook and prompt (charged like the prompt enhancer); it falls back to `deterministic` when its answer doesn't validate."},"model":{"type":"string","minLength":1,"maxLength":200,"description":"The image model the concepts are for (its aspect ratios, resolutions, reference limit and text rendering). GPT Image 2 when left out.","examples":["openai/gpt-image-2"]}},"required":["brief"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"concepts":{"type":"array","items":{"type":"object","properties":{"checks":{"type":"array","items":{"type":"string"}},"hypothesis":{"type":"string"},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"mechanism":{"enum":["object-first","comparison","outcome"],"type":"string"},"prompt":{"type":"string","examples":["A lighthouse on a cliff at dusk, cinematic"]},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"instruction":{"type":"string"},"role":{"enum":["subject","product","layout","lighting","typography"],"type":"string"},"source":{"enum":["asset","library"],"type":"string"},"token":{"type":"string"}},"required":["id","instruction","role","source","token"]}},"request":{"type":"object","properties":{"aspectRatio":{"enum":["auto","21:9","16:9","3:2","4:3","5:4","1:1","4:5","3:4","2:3","9:16"],"type":"string"},"count":{"type":"integer","examples":[1]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"prompt":{"type":"string","examples":["A lighthouse on a cliff at dusk, cinematic"]},"resolution":{"enum":["1K","2K","4K"],"type":"string"}},"required":["aspectRatio","count","model","prompt","resolution"]},"sections":{"type":"object","properties":{"goal":{"type":"string"},"canvas":{"type":"string"},"primarySubject":{"type":"string"},"supportingCue":{"type":"string"},"geometry":{"type":"string"},"environment":{"type":"string"},"lighting":{"type":"string"},"text":{"type":"string"},"references":{"type":"string"},"preserve":{"type":"string"},"exclude":{"type":"string"}},"required":["goal","canvas","primarySubject","supportingCue","geometry","environment","lighting","text","references","preserve","exclude"]},"text":{"type":"object","properties":{"headline":{"anyOf":[{"type":"string"},{"type":"null"}]},"plan":{"enum":["render","none","composite"],"type":"string"}},"required":["headline","plan"]}},"required":["checks","hypothesis","id","label","mechanism","prompt","references","request","sections","text"]}},"dropped":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"reason":{"type":"string"}},"required":["id","reason"]}},"engine":{"enum":["deterministic","llm"],"type":"string"},"fallback":{"type":"string"},"format":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"id":{"enum":["youtube","youtube-2k","vertical-cover","instagram-portrait","instagram-square","story","link-post","x-post","linkedin-post","pinterest-pin","podcast-cover","stream","custom"],"type":"string"},"label":{"type":"string"},"platforms":{"type":"array","items":{"type":"string"},"readOnly":true},"safeZones":{"type":"array","items":{"type":"object","properties":{"h":{"type":"number","examples":[1]},"label":{"type":"string"},"w":{"type":"number","examples":[1]},"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["h","label","w","x","y"]},"readOnly":true,"description":"Parts of the frame the platform's interface covers, as fractions (0–1) of the frame."},"width":{"type":"integer","examples":[1024]}},"required":["height","id","label","platforms","safeZones","width"],"description":"A platform preset: exact pixels and safe zones."},"job":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"}},"required":["id","label"]},"recipe":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"textPolicy":{"enum":["none","short","composite"],"type":"string"}},"required":["id","name","textPolicy"]},"routedBy":{"enum":["job","keywords","recipe","video-format"],"type":"string"},"shape":{"type":"object","properties":{"aspectRatio":{"enum":["auto","21:9","16:9","3:2","4:3","5:4","1:1","4:5","3:4","2:3","9:16"],"type":"string"},"height":{"type":"integer","examples":[1280]},"resolution":{"enum":["1K","2K","4K"],"type":"string"},"upscaled":{"type":"boolean"},"width":{"type":"integer","examples":[1024]}},"required":["aspectRatio","height","resolution","upscaled","width"]}},"required":["concepts","dropped","engine","format","job","recipe","routedBy","shape"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"generations:submit"}},"/thumbnail-studio/recipes":{"get":{"operationId":"listThumbnailRecipes","summary":"List thumbnail recipes","description":"The thumbnail niche recipes (what each shows, when to use it, its prompt language and curated references) and the job routing table that picks one from a brief.\n\nRequires scope `models:list`.","tags":["Generations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"librarySearch":{"type":"array","items":{"type":"string"},"readOnly":true},"recipes":{"type":"array","items":{"type":"string"},"readOnly":true}},"required":["id","label","librarySearch","recipes"]},"readOnly":true},"recipes":{"type":"array","items":{"type":"object","properties":{"avoid":{"type":"string"},"compositingNote":{"type":"string"},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"jobs":{"type":"array","items":{"type":"string"},"readOnly":true},"name":{"type":"string","examples":["Autumn campaign"]},"observations":{"type":"string"},"promptFragment":{"type":"string"},"referenceIds":{"type":"array","items":{"type":"string"},"readOnly":true},"textPolicy":{"enum":["none","short","composite"],"type":"string"},"useWhen":{"type":"string"}},"required":["avoid","compositingNote","id","jobs","name","observations","promptFragment","referenceIds","textPolicy","useWhen"]},"readOnly":true}},"required":["jobs","recipes"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"models:list"}},"/thumbnail-references/{id}":{"get":{"operationId":"getThumbnailReference","summary":"Get a thumbnail reference","description":"One thumbnail reference with its curation notes and licence record.\n\nRequires scope `references:read`.","tags":["Thumbnails"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"The reference.","content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"string"}},"curationStatus":{"type":"string","description":"`recommended_with_context` (curated), `unreviewed` or `avoid_as_generation_reference`."},"height":{"type":"integer","examples":[1280]},"id":{"type":"string","description":"Stable `ref-NNNN` id.","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key of the original: pass it as a reference image's `key` to use it in a generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"previewUrl":{"type":"string","description":"A 480px WebP for grids.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"recipes":{"type":"array","items":{"type":"string"}},"referenceReady":{"type":"boolean","description":"Curated: recipes and defaults use it."},"source":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]},"url":{"type":"string","description":"The original image.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]},"contentType":{"type":"string","examples":["image/png"]},"curationNotes":{"type":"array","items":{"type":"string"}},"license":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The licence record kept with the image.","examples":[{}]},"sha256":{"type":"string"},"sourceUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["categories","curationStatus","height","id","key","previewUrl","recipes","referenceReady","source","title","url","width","contentType","curationNotes","license","sha256","sourceUrl"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"references:read"}},"/thumbnail-references":{"get":{"operationId":"listThumbnailReferences","summary":"List thumbnail references","description":"Lists the thumbnail reference library, curated references first, a page at a time. Filter by niche recipe, source or text; `readyOnly` keeps the curated ones.\n\nRequires scope `references:read`.","tags":["Thumbnails"],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string","maxLength":200,"description":"`nextCursor` of the page before; left out for the first."},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":40},"allowEmptyValue":true,"allowReserved":true},{"name":"q","in":"query","schema":{"type":"string","maxLength":200,"description":"Only those whose title or a category contains this (any case)."},"allowEmptyValue":true,"allowReserved":true},{"name":"readyOnly","in":"query","schema":{"type":"boolean","description":"Only the curated references that recipes use (`referenceReady`)."},"allowEmptyValue":true,"allowReserved":true},{"name":"recipe","in":"query","schema":{"type":"string","minLength":1,"maxLength":120,"description":"Only references for this niche recipe id."},"allowEmptyValue":true,"allowReserved":true},{"name":"source","in":"query","schema":{"type":"string","minLength":1,"maxLength":120,"description":"Only references from this source (`youtube-mkbhd`, ...)."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"A page of references.","content":{"application/json":{"schema":{"type":"object","properties":{"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pass as `cursor` for the next page; `null` on the last."},"references":{"type":"array","items":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"string"}},"curationStatus":{"type":"string","description":"`recommended_with_context` (curated), `unreviewed` or `avoid_as_generation_reference`."},"height":{"type":"integer","examples":[1280]},"id":{"type":"string","description":"Stable `ref-NNNN` id.","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"Storage key of the original: pass it as a reference image's `key` to use it in a generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"previewUrl":{"type":"string","description":"A 480px WebP for grids.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"recipes":{"type":"array","items":{"type":"string"}},"referenceReady":{"type":"boolean","description":"Curated: recipes and defaults use it."},"source":{"type":"string"},"title":{"type":"string","examples":["Autumn campaign"]},"url":{"type":"string","description":"The original image.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["categories","curationStatus","height","id","key","previewUrl","recipes","referenceReady","source","title","url","width"],"description":"A thumbnail from the reference library."}}},"required":["nextCursor","references"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"references:read"}},"/uploads":{"post":{"operationId":"createUpload","summary":"Create an upload URL","description":"Returns a presigned URL for uploading one media file straight to object storage, so large videos never pass through the API.\n\nUpload the file with `PUT uploadUrl`, sending the returned `headers` and the raw bytes as the body, before `expiresAt`. Then pass `key` to `POST /clip-jobs`.\n\nRequires scope `uploads:write`.","tags":["Uploads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUploadRequest"}}}},"responses":{"200":{"description":"The presigned upload URL and how to use it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadTicket"}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["This Idempotency-Key was already used with a different request"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}},"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help."}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"uploads:write"}},"/files/urls":{"post":{"operationId":"getFileUrls","summary":"Get file URLs","description":"Returns short-lived download URLs for files of your workspace by storage key (an upload, a generation output, a workflow's file) and for thumbnail reference library files and built-in reference previews. Other keys are left out.\n\nRequires scope `uploads:write`.","tags":["Uploads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cors":{"type":"boolean","description":"URLs for reading in the browser with CORS (a `<video crossorigin>`, `fetch`): they differ from the plain ones and aren't cached, so a copy the browser cached without CORS headers can't answer them."},"keys":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","minLength":1},"description":"Storage keys of your workspace's files (uploads, generation outputs, workflow files).","examples":[["uploads/Uq4pY2m0JmHnL1mR/0b6f3c8e-6f1a-4c52-9d61-6c1f2d9f6a10/keynote.mp4"]]}},"required":["keys"]}}}},"responses":{"200":{"description":"The download URLs, by key.","content":{"application/json":{"schema":{"type":"object","properties":{"files":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"A short-lived download URL for each key, by key. Keys that aren't your workspace's files are left out.","examples":[{}]}},"required":["files"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"uploads:write"}},"/uploads/from-url":{"post":{"operationId":"uploadFromUrl","summary":"Upload from a link","description":"Copies an image, video or audio file from a public link into the workspace's storage (up to 200 MB) and returns its key, as an upload would. Links to private addresses are refused.\n\nRequires scope `uploads:write`.","tags":["Uploads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri","description":"Public link to an image, video or audio file (a web image someone copied, for example).","examples":["https://example.com/owl.png"]}},"required":["url"]}}}},"responses":{"200":{"description":"The copied file.","content":{"application/json":{"schema":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"key":{"type":"string","description":"Storage key of the copy: `uploads/<organizationId>/<uuid>/<filename>`.","examples":["uploads/Uq4pY2m0JmHnL1mR/0b6f3c8e-6f1a-4c52-9d61-6c1f2d9f6a10/keynote.mp4"]},"kind":{"enum":["image","video","audio"],"type":"string"},"name":{"type":"string","description":"A file name from the link.","examples":["owl.png"]}},"required":["contentType","key","kind","name"],"description":"The file, copied into the workspace's storage."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["This Idempotency-Key was already used with a different request"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}},"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help."}},"security":[{"apiKey":[]}],"parameters":[{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"x-required-scope":"uploads:write"}},"/video-frames/analyze":{"post":{"operationId":"analyzeVideoFrames","summary":"Let AI pick thumbnail frames","description":"\"Let AI pick\": finds the video's candidate frames (as `extract`), then has a vision model tag each one (people and expressions, products, the setting, the moment, the thumbnail role it suits) and pick the best 1–3 with a reason; with speech, it also suggests a thumbnail brief. Kept per video content: a video analyzed before returns its result at once, free. Otherwise the analysis is queued and charged (`402` when the workspace can't cover it; refunded if it fails): follow it with `GET /video-frames/{analysisId}/events`. Videos up to 2 GB.\n\nRequires scope `generations:submit`.","tags":["Generations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of your videos (an upload or a generation's output).","examples":["uploads/org_123/0b6c.../talk.mp4"]},"maxFrames":{"type":"integer","minimum":1,"maximum":96,"description":"How many candidate frames to keep (1–96, default 48). Used the first time a video is analyzed; later calls return what was kept then.","examples":[1]}},"required":["key"]}}}},"responses":{"200":{"description":"The analysis, done or queued.","content":{"application/json":{"schema":{"type":"object","properties":{"brief":{"anyOf":[{"type":"object","properties":{"headline":{"anyOf":[{"type":"string"},{"type":"null"}]},"job":{"type":"string"},"promise":{"type":"string"},"recipe":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"type":"string"},"title":{"anyOf":[{"type":"string","examples":["Autumn campaign"]},{"type":"null"}],"examples":["Autumn campaign"]}},"required":["job","promise","subject"]},{"type":"null"}],"description":"A thumbnail brief suggested from what the video says (subject, promise, job and recipe ids of the thumbnail engine), when it has speech."},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"credits":{"type":"integer","description":"Credits charged so far (only the AI pick is charged).","examples":[12]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"frames":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"exposure":{"type":"number","description":"0–1: balanced, nothing clipped.","examples":[1]},"faces":{"type":"array","items":{"type":"object","properties":{"h":{"type":"number","examples":[1]},"w":{"type":"number","examples":[1]},"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["h","w","x","y"]},"description":"Detected faces, as fractions of the frame, largest first."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"The frame's storage key (a JPEG of yours): use it as an image input or reference.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"ms":{"type":"integer","description":"Where in the video, in ms.","examples":[1]},"scene":{"type":"boolean","description":"Just after a shot change."},"score":{"type":"number","description":"Sharpness, exposure and faces combined (higher is better).","examples":[1]},"sharpness":{"type":"number","examples":[1]},"tags":{"anyOf":[{"type":"object","properties":{"environment":{"type":"string","maxLength":200},"moment":{"type":"string","maxLength":200},"objects":{"type":"array","items":{"type":"string","maxLength":200}},"people":{"type":"array","items":{"type":"object","properties":{"expression":{"type":"string","maxLength":200},"eyeContact":{"type":"boolean"}},"required":["expression","eyeContact"]}},"products":{"type":"array","items":{"type":"string","maxLength":200}},"quality":{"type":"integer","minimum":0,"maximum":2,"examples":[1]},"role":{"enum":["subject","product","environment","moment"],"type":"string"}},"required":["environment","moment","objects","people","products","quality","role"]},{"type":"null"}],"description":"What the AI pick saw: people and expressions, objects, products, the setting, the moment, the role it suits and its quality (0–2). Null before an AI pick."},"url":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["exposure","faces","height","key","ms","scene","score","sharpness","tags","url","width"],"description":"A candidate thumbnail frame."}},{"type":"null"}],"description":"The candidates in time order, once extracted."},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"mode":{"enum":["extract","pick"],"type":"string","description":"What the latest run does: `extract` (candidates only, free) or `pick` (the AI's tags and picks too)."},"picks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"ms":{"type":"integer","examples":[1]},"reason":{"type":"string"},"role":{"enum":["subject","product","environment","moment"],"type":"string"},"url":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","ms","reason","role","url"]}},{"type":"null"}],"description":"The AI's 1–3 best frames, with roles and reasons."},"progress":{"type":"integer","minimum":0,"maximum":100,"examples":[1]},"stage":{"enum":["queued","extracting","picking","completed","failed"],"type":"string"},"status":{"enum":["queued","processing","completed","failed"],"type":"string"},"videoKey":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]}},"required":["brief","completedAt","createdAt","credits","durationSeconds","error","frames","id","mode","picks","progress","stage","status","videoKey"],"description":"A video's candidate thumbnail frames and AI picks."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"generations:submit"}},"/video-frames/extract":{"post":{"operationId":"extractVideoFrames","summary":"Extract thumbnail frames","description":"Finds a video's candidate thumbnail frames without a model call: shot changes plus an even grid, near-duplicates dropped, ranked by sharpness, exposure and faces; the best (48 by default) are stored as JPEGs. Free, and kept per video content: a video extracted before returns its frames at once. Otherwise it's queued: follow it with `GET /video-frames/{analysisId}/events`. Videos up to 2 GB.\n\nRequires scope `generations:submit`.","tags":["Generations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":1024,"description":"Storage key of one of your videos (an upload or a generation's output).","examples":["uploads/org_123/0b6c.../talk.mp4"]},"maxFrames":{"type":"integer","minimum":1,"maximum":96,"description":"How many candidate frames to keep (1–96, default 48). Used the first time a video is analyzed; later calls return what was kept then.","examples":[1]}},"required":["key"]}}}},"responses":{"200":{"description":"The analysis, done or queued.","content":{"application/json":{"schema":{"type":"object","properties":{"brief":{"anyOf":[{"type":"object","properties":{"headline":{"anyOf":[{"type":"string"},{"type":"null"}]},"job":{"type":"string"},"promise":{"type":"string"},"recipe":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"type":"string"},"title":{"anyOf":[{"type":"string","examples":["Autumn campaign"]},{"type":"null"}],"examples":["Autumn campaign"]}},"required":["job","promise","subject"]},{"type":"null"}],"description":"A thumbnail brief suggested from what the video says (subject, promise, job and recipe ids of the thumbnail engine), when it has speech."},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"credits":{"type":"integer","description":"Credits charged so far (only the AI pick is charged).","examples":[12]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"frames":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"exposure":{"type":"number","description":"0–1: balanced, nothing clipped.","examples":[1]},"faces":{"type":"array","items":{"type":"object","properties":{"h":{"type":"number","examples":[1]},"w":{"type":"number","examples":[1]},"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["h","w","x","y"]},"description":"Detected faces, as fractions of the frame, largest first."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"The frame's storage key (a JPEG of yours): use it as an image input or reference.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"ms":{"type":"integer","description":"Where in the video, in ms.","examples":[1]},"scene":{"type":"boolean","description":"Just after a shot change."},"score":{"type":"number","description":"Sharpness, exposure and faces combined (higher is better).","examples":[1]},"sharpness":{"type":"number","examples":[1]},"tags":{"anyOf":[{"type":"object","properties":{"environment":{"type":"string","maxLength":200},"moment":{"type":"string","maxLength":200},"objects":{"type":"array","items":{"type":"string","maxLength":200}},"people":{"type":"array","items":{"type":"object","properties":{"expression":{"type":"string","maxLength":200},"eyeContact":{"type":"boolean"}},"required":["expression","eyeContact"]}},"products":{"type":"array","items":{"type":"string","maxLength":200}},"quality":{"type":"integer","minimum":0,"maximum":2,"examples":[1]},"role":{"enum":["subject","product","environment","moment"],"type":"string"}},"required":["environment","moment","objects","people","products","quality","role"]},{"type":"null"}],"description":"What the AI pick saw: people and expressions, objects, products, the setting, the moment, the role it suits and its quality (0–2). Null before an AI pick."},"url":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["exposure","faces","height","key","ms","scene","score","sharpness","tags","url","width"],"description":"A candidate thumbnail frame."}},{"type":"null"}],"description":"The candidates in time order, once extracted."},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"mode":{"enum":["extract","pick"],"type":"string","description":"What the latest run does: `extract` (candidates only, free) or `pick` (the AI's tags and picks too)."},"picks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"ms":{"type":"integer","examples":[1]},"reason":{"type":"string"},"role":{"enum":["subject","product","environment","moment"],"type":"string"},"url":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","ms","reason","role","url"]}},{"type":"null"}],"description":"The AI's 1–3 best frames, with roles and reasons."},"progress":{"type":"integer","minimum":0,"maximum":100,"examples":[1]},"stage":{"enum":["queued","extracting","picking","completed","failed"],"type":"string"},"status":{"enum":["queued","processing","completed","failed"],"type":"string"},"videoKey":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]}},"required":["brief","completedAt","createdAt","credits","durationSeconds","error","frames","id","mode","picks","progress","stage","status","videoKey"],"description":"A video's candidate thumbnail frames and AI picks."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"402":{"description":"Payment required: the workspace is out of credits, or you've reached your credit limit. An admin can add credits or raise the limit.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["OUT_OF_CREDITS"],"examples":["OUT_OF_CREDITS"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["You're out of credits."],"type":"string"},"status":{"const":402,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"code":{"const":1101,"description":"`1101`: not enough credits, in the workspace or within your credit limit."}},"required":["code"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"generations:submit"}},"/video-frames/{analysisId}":{"get":{"operationId":"getVideoFrames","summary":"Get a frame analysis","description":"A video frame analysis: its status and progress, the candidate frames (with download URLs) and, after an AI pick, their tags, the picks and a brief suggestion.\n\nRequires scope `generations:read`.","tags":["Generations"],"parameters":[{"name":"analysisId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["d7ab799e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"The analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"brief":{"anyOf":[{"type":"object","properties":{"headline":{"anyOf":[{"type":"string"},{"type":"null"}]},"job":{"type":"string"},"promise":{"type":"string"},"recipe":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"type":"string"},"title":{"anyOf":[{"type":"string","examples":["Autumn campaign"]},{"type":"null"}],"examples":["Autumn campaign"]}},"required":["job","promise","subject"]},{"type":"null"}],"description":"A thumbnail brief suggested from what the video says (subject, promise, job and recipe ids of the thumbnail engine), when it has speech."},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"credits":{"type":"integer","description":"Credits charged so far (only the AI pick is charged).","examples":[12]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"frames":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"exposure":{"type":"number","description":"0–1: balanced, nothing clipped.","examples":[1]},"faces":{"type":"array","items":{"type":"object","properties":{"h":{"type":"number","examples":[1]},"w":{"type":"number","examples":[1]},"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["h","w","x","y"]},"description":"Detected faces, as fractions of the frame, largest first."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"The frame's storage key (a JPEG of yours): use it as an image input or reference.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"ms":{"type":"integer","description":"Where in the video, in ms.","examples":[1]},"scene":{"type":"boolean","description":"Just after a shot change."},"score":{"type":"number","description":"Sharpness, exposure and faces combined (higher is better).","examples":[1]},"sharpness":{"type":"number","examples":[1]},"tags":{"anyOf":[{"type":"object","properties":{"environment":{"type":"string","maxLength":200},"moment":{"type":"string","maxLength":200},"objects":{"type":"array","items":{"type":"string","maxLength":200}},"people":{"type":"array","items":{"type":"object","properties":{"expression":{"type":"string","maxLength":200},"eyeContact":{"type":"boolean"}},"required":["expression","eyeContact"]}},"products":{"type":"array","items":{"type":"string","maxLength":200}},"quality":{"type":"integer","minimum":0,"maximum":2,"examples":[1]},"role":{"enum":["subject","product","environment","moment"],"type":"string"}},"required":["environment","moment","objects","people","products","quality","role"]},{"type":"null"}],"description":"What the AI pick saw: people and expressions, objects, products, the setting, the moment, the role it suits and its quality (0–2). Null before an AI pick."},"url":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["exposure","faces","height","key","ms","scene","score","sharpness","tags","url","width"],"description":"A candidate thumbnail frame."}},{"type":"null"}],"description":"The candidates in time order, once extracted."},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"mode":{"enum":["extract","pick"],"type":"string","description":"What the latest run does: `extract` (candidates only, free) or `pick` (the AI's tags and picks too)."},"picks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"ms":{"type":"integer","examples":[1]},"reason":{"type":"string"},"role":{"enum":["subject","product","environment","moment"],"type":"string"},"url":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","ms","reason","role","url"]}},{"type":"null"}],"description":"The AI's 1–3 best frames, with roles and reasons."},"progress":{"type":"integer","minimum":0,"maximum":100,"examples":[1]},"stage":{"enum":["queued","extracting","picking","completed","failed"],"type":"string"},"status":{"enum":["queued","processing","completed","failed"],"type":"string"},"videoKey":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]}},"required":["brief","completedAt","createdAt","credits","durationSeconds","error","frames","id","mode","picks","progress","stage","status","videoKey"],"description":"A video's candidate thumbnail frames and AI picks."}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"generations:read"}},"/video-frames/{analysisId}/events":{"get":{"operationId":"watchVideoFrames","summary":"Follow a frame analysis","description":"Streams one frame analysis as server-sent events: its state at once (as `GET /video-frames/{analysisId}`), then each change, then a `done` event (`{\"status\": \"completed\"}` or `\"failed\"`) when it ends. A stream closed without `done` (after 15 minutes at most) means it's still running: reconnect.\n\nRequires scope `generations:read`.","tags":["Generations"],"parameters":[{"name":"analysisId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["d7ab799e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"An event stream of the analysis, ending when it does.","content":{"text/event-stream":{"schema":{"oneOf":[{"type":"object","properties":{"event":{"const":"message"},"data":{"type":"object","properties":{"brief":{"anyOf":[{"type":"object","properties":{"headline":{"anyOf":[{"type":"string"},{"type":"null"}]},"job":{"type":"string"},"promise":{"type":"string"},"recipe":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"type":"string"},"title":{"anyOf":[{"type":"string","examples":["Autumn campaign"]},{"type":"null"}],"examples":["Autumn campaign"]}},"required":["job","promise","subject"]},{"type":"null"}],"description":"A thumbnail brief suggested from what the video says (subject, promise, job and recipe ids of the thumbnail engine), when it has speech."},"completedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"credits":{"type":"integer","description":"Credits charged so far (only the AI pick is charged).","examples":[12]},"durationSeconds":{"anyOf":[{"type":"number","examples":[5]},{"type":"null"}],"examples":[5]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"frames":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"exposure":{"type":"number","description":"0–1: balanced, nothing clipped.","examples":[1]},"faces":{"type":"array","items":{"type":"object","properties":{"h":{"type":"number","examples":[1]},"w":{"type":"number","examples":[1]},"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["h","w","x","y"]},"description":"Detected faces, as fractions of the frame, largest first."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"The frame's storage key (a JPEG of yours): use it as an image input or reference.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"ms":{"type":"integer","description":"Where in the video, in ms.","examples":[1]},"scene":{"type":"boolean","description":"Just after a shot change."},"score":{"type":"number","description":"Sharpness, exposure and faces combined (higher is better).","examples":[1]},"sharpness":{"type":"number","examples":[1]},"tags":{"anyOf":[{"type":"object","properties":{"environment":{"type":"string","maxLength":200},"moment":{"type":"string","maxLength":200},"objects":{"type":"array","items":{"type":"string","maxLength":200}},"people":{"type":"array","items":{"type":"object","properties":{"expression":{"type":"string","maxLength":200},"eyeContact":{"type":"boolean"}},"required":["expression","eyeContact"]}},"products":{"type":"array","items":{"type":"string","maxLength":200}},"quality":{"type":"integer","minimum":0,"maximum":2,"examples":[1]},"role":{"enum":["subject","product","environment","moment"],"type":"string"}},"required":["environment","moment","objects","people","products","quality","role"]},{"type":"null"}],"description":"What the AI pick saw: people and expressions, objects, products, the setting, the moment, the role it suits and its quality (0–2). Null before an AI pick."},"url":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["exposure","faces","height","key","ms","scene","score","sharpness","tags","url","width"],"description":"A candidate thumbnail frame."}},{"type":"null"}],"description":"The candidates in time order, once extracted."},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"mode":{"enum":["extract","pick"],"type":"string","description":"What the latest run does: `extract` (candidates only, free) or `pick` (the AI's tags and picks too)."},"picks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"ms":{"type":"integer","examples":[1]},"reason":{"type":"string"},"role":{"enum":["subject","product","environment","moment"],"type":"string"},"url":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key","ms","reason","role","url"]}},{"type":"null"}],"description":"The AI's 1–3 best frames, with roles and reasons."},"progress":{"type":"integer","minimum":0,"maximum":100,"examples":[1]},"stage":{"enum":["queued","extracting","picking","completed","failed"],"type":"string"},"status":{"enum":["queued","processing","completed","failed"],"type":"string"},"videoKey":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.mp4"]}},"required":["brief","completedAt","createdAt","credits","durationSeconds","error","frames","id","mode","picks","progress","stage","status","videoKey"],"description":"A video's candidate thumbnail frames and AI picks."},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event","data"]},{"type":"object","properties":{"event":{"const":"done"},"data":{"type":"object","properties":{"status":{"enum":["completed","failed"],"type":"string"}},"required":["status"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event"]},{"type":"object","properties":{"event":{"const":"error"},"data":{},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event"]}]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"generations:read"}},"/webhook-endpoints":{"post":{"operationId":"createWebhookEndpoint","summary":"Create a webhook endpoint","description":"Adds an endpoint that receives the events you pick, POSTed as JSON and signed with its secret (`Remagica-Signature`). The secret is in this response only: store it. A workspace has at most 20 endpoints.\n\nRequires scope `webhooks:write`.","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","maxLength":200,"description":"A note for your team: what it's for.","examples":["Product shots for the autumn campaign."]},"events":{"type":"array","minItems":1,"maxItems":13,"items":{"enum":["generation.succeeded","generation.failed","generation.canceled","workflow_run.succeeded","workflow_run.failed","workflow_run.canceled","app_run.succeeded","app_run.failed","app_run.canceled","clip_job.succeeded","clip_job.failed","clip_export.succeeded","clip_export.failed"],"type":"string","description":"An event to receive: `<resource>.<outcome>`, for generations, workflow runs, app runs, clip jobs and clip exports.","examples":["generation.succeeded"]},"description":"The events it receives (at least one)."},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"Where deliveries are POSTed: an `https://` URL on the public internet (private, loopback and link-local addresses are refused).","examples":["https://example.com/remagica/webhooks"]}},"required":["events","url"],"description":"A new webhook endpoint."}}}},"responses":{"201":{"description":"The endpoint and its signing secret.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who added it; `null` when an API key did, or the person has left.","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was switched off after failing, until it's switched on again."},"enabled":{"type":"boolean"},"events":{"type":"array","items":{"enum":["generation.succeeded","generation.failed","generation.canceled","workflow_run.succeeded","workflow_run.failed","workflow_run.canceled","app_run.succeeded","app_run.failed","app_run.canceled","clip_job.succeeded","clip_job.failed","clip_export.succeeded","clip_export.failed"],"type":"string","description":"An event to receive: `<resource>.<outcome>`, for generations, workflow runs, app runs, clip jobs and clip exports.","examples":["generation.succeeded"]}},"id":{"type":"string","examples":["whe_4f5a8b9c0d1e2f3a"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["createdAt","createdByUserId","description","disabledReason","enabled","events","id","updatedAt","url"],"description":"A webhook endpoint. Its signing secret is never listed: it's shown once, when the endpoint is created or its secret is rotated."},"secret":{"type":"string","description":"The signing secret (`whsec_...`). Shown this once: store it to verify `Remagica-Signature`.","examples":["whsec_3q2-7wQXjK0h0lC9mF1n8Yy4bVt6sJpR2aUeZoLkHdE"]}},"required":["endpoint","secret"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"webhooks:write"},"get":{"operationId":"listWebhookEndpoints","summary":"List webhook endpoints","description":"The workspace's webhook endpoints, oldest first. Secrets are never listed.\n\nRequires scope `webhooks:read`.","tags":["Webhooks"],"responses":{"200":{"description":"The endpoints.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoints":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who added it; `null` when an API key did, or the person has left.","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was switched off after failing, until it's switched on again."},"enabled":{"type":"boolean"},"events":{"type":"array","items":{"enum":["generation.succeeded","generation.failed","generation.canceled","workflow_run.succeeded","workflow_run.failed","workflow_run.canceled","app_run.succeeded","app_run.failed","app_run.canceled","clip_job.succeeded","clip_job.failed","clip_export.succeeded","clip_export.failed"],"type":"string","description":"An event to receive: `<resource>.<outcome>`, for generations, workflow runs, app runs, clip jobs and clip exports.","examples":["generation.succeeded"]}},"id":{"type":"string","examples":["whe_4f5a8b9c0d1e2f3a"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["createdAt","createdByUserId","description","disabledReason","enabled","events","id","updatedAt","url"],"description":"A webhook endpoint. Its signing secret is never listed: it's shown once, when the endpoint is created or its secret is rotated."}}},"required":["endpoints"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"webhooks:read"}},"/webhook-endpoints/{endpointId}":{"delete":{"operationId":"deleteWebhookEndpoint","summary":"Delete a webhook endpoint","description":"Deletes an endpoint and its delivery log. Nothing more is sent to it, retries included.\n\nRequires scope `webhooks:write`.","tags":["Webhooks"],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["whe_4f5a8b9c0d1e2f3a"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"webhooks:write"},"get":{"operationId":"getWebhookEndpoint","summary":"Get a webhook endpoint","description":"Returns one endpoint (without its secret).\n\nRequires scope `webhooks:read`.","tags":["Webhooks"],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["whe_4f5a8b9c0d1e2f3a"]}}],"responses":{"200":{"description":"The endpoint.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who added it; `null` when an API key did, or the person has left.","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was switched off after failing, until it's switched on again."},"enabled":{"type":"boolean"},"events":{"type":"array","items":{"enum":["generation.succeeded","generation.failed","generation.canceled","workflow_run.succeeded","workflow_run.failed","workflow_run.canceled","app_run.succeeded","app_run.failed","app_run.canceled","clip_job.succeeded","clip_job.failed","clip_export.succeeded","clip_export.failed"],"type":"string","description":"An event to receive: `<resource>.<outcome>`, for generations, workflow runs, app runs, clip jobs and clip exports.","examples":["generation.succeeded"]}},"id":{"type":"string","examples":["whe_4f5a8b9c0d1e2f3a"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["createdAt","createdByUserId","description","disabledReason","enabled","events","id","updatedAt","url"],"description":"A webhook endpoint. Its signing secret is never listed: it's shown once, when the endpoint is created or its secret is rotated."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"webhooks:read"},"patch":{"operationId":"updateWebhookEndpoint","summary":"Update a webhook endpoint","description":"Changes an endpoint's URL, description or events, or switches it on or off. Its secret stays.\n\nRequires scope `webhooks:write`.","tags":["Webhooks"],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["whe_4f5a8b9c0d1e2f3a"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","maxLength":200,"description":"A note for your team: what it's for.","examples":["Product shots for the autumn campaign."]},"enabled":{"type":"boolean","description":"Switch deliveries on or off. Switching on an endpoint that was switched off for failing clears its failures."},"events":{"type":"array","minItems":1,"maxItems":13,"items":{"enum":["generation.succeeded","generation.failed","generation.canceled","workflow_run.succeeded","workflow_run.failed","workflow_run.canceled","app_run.succeeded","app_run.failed","app_run.canceled","clip_job.succeeded","clip_job.failed","clip_export.succeeded","clip_export.failed"],"type":"string","description":"An event to receive: `<resource>.<outcome>`, for generations, workflow runs, app runs, clip jobs and clip exports.","examples":["generation.succeeded"]},"description":"The events it receives (at least one)."},"url":{"type":"string","minLength":1,"maxLength":2048,"description":"Where deliveries are POSTed: an `https://` URL on the public internet (private, loopback and link-local addresses are refused).","examples":["https://example.com/remagica/webhooks"]}},"description":"What to change; anything left out stays."}}}},"responses":{"200":{"description":"The endpoint.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who added it; `null` when an API key did, or the person has left.","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was switched off after failing, until it's switched on again."},"enabled":{"type":"boolean"},"events":{"type":"array","items":{"enum":["generation.succeeded","generation.failed","generation.canceled","workflow_run.succeeded","workflow_run.failed","workflow_run.canceled","app_run.succeeded","app_run.failed","app_run.canceled","clip_job.succeeded","clip_job.failed","clip_export.succeeded","clip_export.failed"],"type":"string","description":"An event to receive: `<resource>.<outcome>`, for generations, workflow runs, app runs, clip jobs and clip exports.","examples":["generation.succeeded"]}},"id":{"type":"string","examples":["whe_4f5a8b9c0d1e2f3a"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["createdAt","createdByUserId","description","disabledReason","enabled","events","id","updatedAt","url"],"description":"A webhook endpoint. Its signing secret is never listed: it's shown once, when the endpoint is created or its secret is rotated."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"webhooks:write"}},"/webhook-endpoints/{endpointId}/deliveries":{"get":{"operationId":"listWebhookDeliveries","summary":"List an endpoint's deliveries","description":"An endpoint's deliveries, newest first: each event sent to it, how many attempts it took and what the last one got back.\n\nRequires scope `webhooks:read`.","tags":["Webhooks"],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["whe_4f5a8b9c0d1e2f3a"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"How many, newest first."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The deliveries.","content":{"application/json":{"schema":{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"attempts":{"type":"integer","minimum":0,"examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"endpointId":{"type":"string","examples":["2ecb03ae-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"eventId":{"type":"string","description":"The event's id (`evt_...`), the same in every delivery and redelivery of it: sent as `Remagica-Event-Id`.","examples":["5e0e63b4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"eventType":{"type":"string","examples":["generation.succeeded"]},"id":{"type":"string","examples":["whd_0d1e2f3a4b5c6d7e"]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the last failed attempt got back, or why it got nothing."},"lastStatus":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"The HTTP status of the last attempt; `null` when nothing answered.","examples":[1]},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When the next retry is due, while it's `pending`.","examples":["2026-10-21T12:00:00.000Z"]},"status":{"enum":["pending","delivered","failed"],"type":"string","description":"`pending` (being sent, or waiting to retry), `delivered` (a 2xx came back) or `failed` (every retry failed)."}},"required":["attempts","createdAt","deliveredAt","endpointId","eventId","eventType","id","lastError","lastStatus","nextAttemptAt","status"],"description":"One event sent to one endpoint."}}},"required":["deliveries"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"webhooks:read"}},"/webhook-deliveries/{deliveryId}/redeliver":{"post":{"operationId":"redeliverWebhook","summary":"Redeliver a webhook","description":"Sends a delivery again, with the same event id and body, now and then with the usual retries if it fails.\n\nRequires scope `webhooks:write`.","tags":["Webhooks"],"parameters":[{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["whd_0d1e2f3a4b5c6d7e"]}}],"responses":{"202":{"description":"The delivery, sending again.","content":{"application/json":{"schema":{"type":"object","properties":{"attempts":{"type":"integer","minimum":0,"examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"endpointId":{"type":"string","examples":["2ecb03ae-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"eventId":{"type":"string","description":"The event's id (`evt_...`), the same in every delivery and redelivery of it: sent as `Remagica-Event-Id`.","examples":["5e0e63b4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"eventType":{"type":"string","examples":["generation.succeeded"]},"id":{"type":"string","examples":["whd_0d1e2f3a4b5c6d7e"]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the last failed attempt got back, or why it got nothing."},"lastStatus":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"The HTTP status of the last attempt; `null` when nothing answered.","examples":[1]},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When the next retry is due, while it's `pending`.","examples":["2026-10-21T12:00:00.000Z"]},"status":{"enum":["pending","delivered","failed"],"type":"string","description":"`pending` (being sent, or waiting to retry), `delivered` (a 2xx came back) or `failed` (every retry failed)."}},"required":["attempts","createdAt","deliveredAt","endpointId","eventId","eventType","id","lastError","lastStatus","nextAttemptAt","status"],"description":"One event sent to one endpoint."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"webhooks:write"}},"/webhook-endpoints/{endpointId}/secret":{"post":{"operationId":"rotateWebhookSecret","summary":"Rotate a webhook secret","description":"Gives an endpoint a new signing secret, in this response only. Deliveries are signed with it from now on; the old one stops working at once.\n\nRequires scope `webhooks:write`.","tags":["Webhooks"],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["whe_4f5a8b9c0d1e2f3a"]}}],"responses":{"200":{"description":"The endpoint and its new signing secret.","content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who added it; `null` when an API key did, or the person has left.","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it was switched off after failing, until it's switched on again."},"enabled":{"type":"boolean"},"events":{"type":"array","items":{"enum":["generation.succeeded","generation.failed","generation.canceled","workflow_run.succeeded","workflow_run.failed","workflow_run.canceled","app_run.succeeded","app_run.failed","app_run.canceled","clip_job.succeeded","clip_job.failed","clip_export.succeeded","clip_export.failed"],"type":"string","description":"An event to receive: `<resource>.<outcome>`, for generations, workflow runs, app runs, clip jobs and clip exports.","examples":["generation.succeeded"]}},"id":{"type":"string","examples":["whe_4f5a8b9c0d1e2f3a"]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["createdAt","createdByUserId","description","disabledReason","enabled","events","id","updatedAt","url"],"description":"A webhook endpoint. Its signing secret is never listed: it's shown once, when the endpoint is created or its secret is rotated."},"secret":{"type":"string","description":"The signing secret (`whsec_...`). Shown this once: store it to verify `Remagica-Signature`.","examples":["whsec_3q2-7wQXjK0h0lC9mF1n8Yy4bVt6sJpR2aUeZoLkHdE"]}},"required":["endpoint","secret"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"webhooks:write"}},"/webhook-endpoints/{endpointId}/test":{"post":{"operationId":"sendWebhookTestEvent","summary":"Send a test event","description":"Sends the endpoint a `webhook.test` event, signed like any other, whatever events it receives. Follow it in the endpoint's deliveries.\n\nRequires scope `webhooks:write`.","tags":["Webhooks"],"parameters":[{"name":"endpointId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["whe_4f5a8b9c0d1e2f3a"]}}],"responses":{"202":{"description":"The test delivery, on its way.","content":{"application/json":{"schema":{"type":"object","properties":{"attempts":{"type":"integer","minimum":0,"examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"endpointId":{"type":"string","examples":["2ecb03ae-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"eventId":{"type":"string","description":"The event's id (`evt_...`), the same in every delivery and redelivery of it: sent as `Remagica-Event-Id`.","examples":["5e0e63b4-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"eventType":{"type":"string","examples":["generation.succeeded"]},"id":{"type":"string","examples":["whd_0d1e2f3a4b5c6d7e"]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the last failed attempt got back, or why it got nothing."},"lastStatus":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"description":"The HTTP status of the last attempt; `null` when nothing answered.","examples":[1]},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When the next retry is due, while it's `pending`.","examples":["2026-10-21T12:00:00.000Z"]},"status":{"enum":["pending","delivered","failed"],"type":"string","description":"`pending` (being sent, or waiting to retry), `delivered` (a 2xx came back) or `failed` (every retry failed)."}},"required":["attempts","createdAt","deliveredAt","endpointId","eventId","eventType","id","lastError","lastStatus","nextAttemptAt","status"],"description":"One event sent to one endpoint."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"webhooks:write"}},"/workflows/{workflowId}/results/{resultId}/cancel":{"post":{"operationId":"cancelWorkflowResult","summary":"Cancel a result","description":"Stops one result still being made (`pending` or `processing`). Its provider is asked where it is now: one not yet rendering is cancelled there and ends as an `error` saying it was cancelled, and its credits come back (nothing it may still deliver is kept). One already rendering where the provider can't stop it is kept instead (`stop: kept`): it finishes, is charged, and says so. `POST …/results/stop-preview` says which first.\n\nRequires scope `workflows:cancel`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"name":"resultId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["750ab75b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"Whether it was still open (and is now cancelled).","content":{"application/json":{"schema":{"type":"object","properties":{"cancelled":{"type":"boolean"}},"required":["cancelled"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:cancel"}},"/workflow-runs/{runId}/cancel":{"post":{"operationId":"cancelWorkflowRun","summary":"Cancel a run","description":"Stops a run: nothing new starts, and each open result's provider is asked where it is now. Results not yet rendering are cancelled and refunded. Results already rendering where the provider can't stop them are kept (`stop: kept`): they finish and are charged, and the run reads `stopped`, its `error` saying so (\"Stopped — 1 result was already rendering and finished.\"). Otherwise it reads `cancelled`.\n\nRequires scope `workflows:cancel`.","tags":["Workflows"],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]}}],"responses":{"200":{"description":"The run.","content":{"application/json":{"schema":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:cancel"}},"/workflows/{workflowId}/revisions":{"post":{"operationId":"createWorkflowRevision","summary":"Save a version","description":"Saves the workflow's document as it is now as a named version.\n\nRequires scope `workflows:write`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"examples":["Autumn campaign"]}}}}}},"responses":{"201":{"description":"The revision.","content":{"application/json":{"schema":{"type":"object","properties":{"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","image","name"]},{"type":"null"}],"description":"Who saved it (who started the run, for `auto`)."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["auto","manual","restore"],"type":"string"},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"runNodeCount":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"examples":[1]},"title":{"anyOf":[{"type":"string","examples":["Autumn campaign"]},{"type":"null"}],"examples":["Autumn campaign"]}},"required":["createdAt","id","kind","runId","title"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:write"},"get":{"operationId":"listWorkflowRevisions","summary":"List versions","description":"A workflow's 100 most recent versions, newest first.\n\nRequires scope `workflows:read`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["2c9a7f10-6b3e-4d21-9f8a-5e7c1b0d4a36"]}}],"responses":{"200":{"description":"The versions.","content":{"application/json":{"schema":{"type":"object","properties":{"revisions":{"type":"array","items":{"type":"object","properties":{"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","image","name"]},{"type":"null"}],"description":"Who saved it (who started the run, for `auto`)."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["auto","manual","restore"],"type":"string"},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"runNodeCount":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"examples":[1]},"title":{"anyOf":[{"type":"string","examples":["Autumn campaign"]},{"type":"null"}],"examples":["Autumn campaign"]}},"required":["createdAt","id","kind","runId","title"]}}},"required":["revisions"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:read"}},"/workflows":{"post":{"operationId":"createWorkflow","summary":"Create a workflow","description":"Creates a workflow, empty (one page) or from a document.\n\nRequires scope `workflows:write`.","tags":["Workflows"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"document":{"type":"object","properties":{"pages":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","properties":{"edges":{"type":"array","maxItems":2000,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"sourceHandle":{"type":"string","minLength":1,"maxLength":64},"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"targetHandle":{"type":"string","minLength":1,"maxLength":64}},"required":["id","source","sourceHandle","target","targetHandle"]},"default":[]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"nodes":{"type":"array","maxItems":500,"items":{"type":"object","properties":{"data":{"type":"object","properties":{"exposedParameterKeys":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":64}},"label":{"type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{"seed":42}]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{},{},{}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]}},"required":["createdAt","id","status"]},"default":[]},"selectedResultIndex":{"type":"integer","minimum":0,"examples":[1]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["default","processing","error","success"],"type":"string","default":"default"},"tags":{"type":"array","maxItems":12,"items":{"type":"string","minLength":1,"maxLength":32}},"variables":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"maxLength":64},"variableId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["84598e5d-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["handle","variableId"]}}},"default":{"results":[],"settings":{},"status":"default"}},"height":{"type":"number","exclusiveMinimum":0,"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"parentId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"position":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["x","y"]},"type":{"type":"string","minLength":1,"maxLength":64},"width":{"type":"number","exclusiveMinimum":0,"examples":[1024]}},"required":["id","position","type"]},"default":[]},"viewport":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]},"zoom":{"type":"number","exclusiveMinimum":0,"examples":[1]}},"required":["x","y","zoom"]}},"required":["id","name"]},"default":[{"id":"page-1","name":"Page 1","edges":[],"nodes":[]}]},"schemaVersion":{"const":2,"default":2},"variables":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"options":{"type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":200}},"pageId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","number","choice"],"type":"string"},"value":{"type":"string","maxLength":100000,"default":""}},"required":["id","name","type"]},"default":[]}},"description":"The document (`schemaVersion: 2`): `pages` of `nodes` and `edges` in React Flow's shape, and the workflow's `variables`. A node's settings are in `data.settings` (see `GET /node-types`); edges join handles by key. Nodes' `results` and `status` are the server's: they're filled in when you read the workflow and ignored when you save it. A node shows and sends on the result at `data.selectedResultIndex`, or its newest when that's left out. One empty page when left out."},"name":{"type":"string","minLength":1,"maxLength":200,"examples":["Autumn campaign"]}},"required":["name"]}}}},"responses":{"201":{"description":"The new workflow.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"nodeCount":{"type":"integer","examples":[1]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"version":{"type":"integer","examples":[3]},"activeRuns":{"type":"array","items":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{},"format":{}}},{"type":"object","properties":{"content":{},"contentType":{},"durationSeconds":{},"format":{},"height":{},"kind":{},"thumbnail":{},"thumbnailUrl":{},"url":{},"width":{}}}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"description":"The runs still going."},"creditsSpent":{"type":"integer","description":"The credits all the workflow's runs have spent.","examples":[12]},"document":{"type":"object","properties":{"pages":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","properties":{"edges":{"type":"array","maxItems":2000,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"sourceHandle":{"type":"string","minLength":1,"maxLength":64},"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"targetHandle":{"type":"string","minLength":1,"maxLength":64}},"required":["id","source","sourceHandle","target","targetHandle"]},"default":[]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"nodes":{"type":"array","maxItems":500,"items":{"type":"object","properties":{"data":{"type":"object","properties":{"exposedParameterKeys":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":64}},"label":{"type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{"seed":42}]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{},{},{}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]}},"required":["createdAt","id","status"]},"default":[]},"selectedResultIndex":{"type":"integer","minimum":0,"examples":[1]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["default","processing","error","success"],"type":"string","default":"default"},"tags":{"type":"array","maxItems":12,"items":{"type":"string","minLength":1,"maxLength":32}},"variables":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"maxLength":64},"variableId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["84598e5d-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["handle","variableId"]}}},"default":{"results":[],"settings":{},"status":"default"}},"height":{"type":"number","exclusiveMinimum":0,"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"parentId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"position":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["x","y"]},"type":{"type":"string","minLength":1,"maxLength":64},"width":{"type":"number","exclusiveMinimum":0,"examples":[1024]}},"required":["id","position","type"]},"default":[]},"viewport":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]},"zoom":{"type":"number","exclusiveMinimum":0,"examples":[1]}},"required":["x","y","zoom"]}},"required":["id","name"]},"default":[{"id":"page-1","name":"Page 1","edges":[],"nodes":[]}]},"schemaVersion":{"const":2,"default":2},"variables":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"options":{"type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":200}},"pageId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","number","choice"],"type":"string"},"value":{"type":"string","maxLength":100000,"default":""}},"required":["id","name","type"]},"default":[]}},"description":"The document (`schemaVersion: 2`): `pages` of `nodes` and `edges` in React Flow's shape, and the workflow's `variables`. A node's settings are in `data.settings` (see `GET /node-types`); edges join handles by key. Nodes' `results` and `status` are the server's: they're filled in when you read the workflow and ignored when you save it. A node shows and sends on the result at `data.selectedResultIndex`, or its newest when that's left out."},"files":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Download URLs of the workspace's files the document points at (Import files, batch uploads, media variables), by storage key, to show them before anything runs.","examples":[{}]}},"required":["createdAt","id","name","nodeCount","updatedAt","version","activeRuns","creditsSpent","document","files"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:write"},"get":{"operationId":"listWorkflows","summary":"List workflows","description":"Your workspace's 100 most recently edited workflows.\n\nRequires scope `workflows:read`.","tags":["Workflows"],"responses":{"200":{"description":"The workflows.","content":{"application/json":{"schema":{"type":"object","properties":{"workflows":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"nodeCount":{"type":"integer","examples":[1]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"version":{"type":"integer","examples":[3]}},"required":["createdAt","id","name","nodeCount","updatedAt","version"]}}},"required":["workflows"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:read"}},"/workflows/{workflowId}":{"delete":{"operationId":"deleteWorkflow","summary":"Delete a workflow","description":"Deletes a workflow with its runs and results. Runs still going are cancelled first. Generated files stay in storage.\n\nRequires scope `workflows:delete`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["2c9a7f10-6b3e-4d21-9f8a-5e7c1b0d4a36"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:delete"},"get":{"operationId":"getWorkflow","summary":"Get a workflow","description":"Returns a workflow: its document with every node's `results` (oldest first, files with download URLs) and `status`, its active runs and its spend. Read it when you connect to `GET /workflows/{workflowId}/events`, and again whenever you reconnect.\n\nRequires scope `workflows:read`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["2c9a7f10-6b3e-4d21-9f8a-5e7c1b0d4a36"]}}],"responses":{"200":{"description":"The workflow.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"nodeCount":{"type":"integer","examples":[1]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"version":{"type":"integer","examples":[3]},"activeRuns":{"type":"array","items":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{},"format":{}}},{"type":"object","properties":{"content":{},"contentType":{},"durationSeconds":{},"format":{},"height":{},"kind":{},"thumbnail":{},"thumbnailUrl":{},"url":{},"width":{}}}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"description":"The runs still going."},"creditsSpent":{"type":"integer","description":"The credits all the workflow's runs have spent.","examples":[12]},"document":{"type":"object","properties":{"pages":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","properties":{"edges":{"type":"array","maxItems":2000,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"sourceHandle":{"type":"string","minLength":1,"maxLength":64},"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"targetHandle":{"type":"string","minLength":1,"maxLength":64}},"required":["id","source","sourceHandle","target","targetHandle"]},"default":[]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"nodes":{"type":"array","maxItems":500,"items":{"type":"object","properties":{"data":{"type":"object","properties":{"exposedParameterKeys":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":64}},"label":{"type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{"seed":42}]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{},{},{}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]}},"required":["createdAt","id","status"]},"default":[]},"selectedResultIndex":{"type":"integer","minimum":0,"examples":[1]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["default","processing","error","success"],"type":"string","default":"default"},"tags":{"type":"array","maxItems":12,"items":{"type":"string","minLength":1,"maxLength":32}},"variables":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"maxLength":64},"variableId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["84598e5d-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["handle","variableId"]}}},"default":{"results":[],"settings":{},"status":"default"}},"height":{"type":"number","exclusiveMinimum":0,"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"parentId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"position":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["x","y"]},"type":{"type":"string","minLength":1,"maxLength":64},"width":{"type":"number","exclusiveMinimum":0,"examples":[1024]}},"required":["id","position","type"]},"default":[]},"viewport":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]},"zoom":{"type":"number","exclusiveMinimum":0,"examples":[1]}},"required":["x","y","zoom"]}},"required":["id","name"]},"default":[{"id":"page-1","name":"Page 1","edges":[],"nodes":[]}]},"schemaVersion":{"const":2,"default":2},"variables":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"options":{"type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":200}},"pageId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","number","choice"],"type":"string"},"value":{"type":"string","maxLength":100000,"default":""}},"required":["id","name","type"]},"default":[]}},"description":"The document (`schemaVersion: 2`): `pages` of `nodes` and `edges` in React Flow's shape, and the workflow's `variables`. A node's settings are in `data.settings` (see `GET /node-types`); edges join handles by key. Nodes' `results` and `status` are the server's: they're filled in when you read the workflow and ignored when you save it. A node shows and sends on the result at `data.selectedResultIndex`, or its newest when that's left out."},"files":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Download URLs of the workspace's files the document points at (Import files, batch uploads, media variables), by storage key, to show them before anything runs.","examples":[{}]}},"required":["createdAt","id","name","nodeCount","updatedAt","version","activeRuns","creditsSpent","document","files"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:read"},"put":{"operationId":"updateWorkflow","summary":"Save a workflow","description":"Saves a workflow's document and/or name. Send the `version` you last read; if someone saved since, you get `409` and should reload (or merge). Nodes' `results` and `status` in what you send are ignored. The response is the workflow's summary with its new `version`.\n\nRequires scope `workflows:write`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"document":{"type":"object","properties":{"pages":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","properties":{"edges":{"type":"array","maxItems":2000,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"sourceHandle":{"type":"string","minLength":1,"maxLength":64},"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"targetHandle":{"type":"string","minLength":1,"maxLength":64}},"required":["id","source","sourceHandle","target","targetHandle"]},"default":[]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"nodes":{"type":"array","maxItems":500,"items":{"type":"object","properties":{"data":{"type":"object","properties":{"exposedParameterKeys":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":64}},"label":{"type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{"seed":42}]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{},{},{}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]}},"required":["createdAt","id","status"]},"default":[]},"selectedResultIndex":{"type":"integer","minimum":0,"examples":[1]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["default","processing","error","success"],"type":"string","default":"default"},"tags":{"type":"array","maxItems":12,"items":{"type":"string","minLength":1,"maxLength":32}},"variables":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"maxLength":64},"variableId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["84598e5d-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["handle","variableId"]}}},"default":{"results":[],"settings":{},"status":"default"}},"height":{"type":"number","exclusiveMinimum":0,"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"parentId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"position":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["x","y"]},"type":{"type":"string","minLength":1,"maxLength":64},"width":{"type":"number","exclusiveMinimum":0,"examples":[1024]}},"required":["id","position","type"]},"default":[]},"viewport":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]},"zoom":{"type":"number","exclusiveMinimum":0,"examples":[1]}},"required":["x","y","zoom"]}},"required":["id","name"]},"default":[{"id":"page-1","name":"Page 1","edges":[],"nodes":[]}]},"schemaVersion":{"const":2,"default":2},"variables":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"options":{"type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":200}},"pageId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","number","choice"],"type":"string"},"value":{"type":"string","maxLength":100000,"default":""}},"required":["id","name","type"]},"default":[]}},"description":"The document (`schemaVersion: 2`): `pages` of `nodes` and `edges` in React Flow's shape, and the workflow's `variables`. A node's settings are in `data.settings` (see `GET /node-types`); edges join handles by key. Nodes' `results` and `status` are the server's: they're filled in when you read the workflow and ignored when you save it. A node shows and sends on the result at `data.selectedResultIndex`, or its newest when that's left out."},"name":{"type":"string","minLength":1,"maxLength":200,"examples":["Autumn campaign"]},"version":{"type":"integer","minimum":1,"description":"The `version` you last read. A save based on an older version is refused (409), so nobody overwrites changes they haven't seen.","examples":[3]}},"required":["version"]}}}},"responses":{"200":{"description":"The saved workflow's summary, with its new `version`.","content":{"application/json":{"schema":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"nodeCount":{"type":"integer","examples":[1]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"version":{"type":"integer","examples":[3]}},"required":["createdAt","id","name","nodeCount","updatedAt","version"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:write"}},"/workflow-runs/{runId}":{"get":{"operationId":"getWorkflowRun","summary":"Get a run","description":"Returns a run with its results so far.\n\nRequires scope `workflows:read`.","tags":["Workflows"],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]}}],"responses":{"200":{"description":"The run.","content":{"application/json":{"schema":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:read"}},"/node-types":{"get":{"operationId":"listNodeTypes","summary":"List node types","description":"Every node type: its handles, its settings (`data.settings`, as JSON Schema) and how it behaves in a run.","tags":["Workflows"],"responses":{"200":{"description":"The node types.","content":{"application/json":{"schema":{"type":"object","properties":{"nodeTypes":{"type":"array","items":{"type":"object","properties":{"behavior":{"enum":["dynamic","static","iterator","splitter","router","none"],"type":"string","description":"`dynamic` (runs and keeps results), `static` (computed from its settings and inputs), `iterator` / `splitter` (a list the node after runs once per item of), `router` (passes its input on) or `none` (canvas only)."},"capability":{"type":"string","description":"The capability its `model` setting picks from (GET /capabilities)."},"category":{"enum":["image","video","audio","text","essentials","video-editing","canvas"],"type":"string","description":"The add menu's section: what it makes or works on."},"description":{"type":"string","examples":["Product shots for the autumn campaign."]},"fannedOutputs":{"type":"array","items":{"type":"string"},"description":"Outputs whose list the node after runs once per item of."},"group":{"enum":["nodes","essentials","video-editing","canvas"],"type":"string"},"hidden":{"type":"boolean","description":"Kept for documents that have it; not offered to add."},"inputs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string"},"limit":{"type":"integer","description":"How many edges it takes: 1 when left out (a new edge replaces the one there), -1 for any number.","examples":[20]},"required":{"type":"boolean"},"type":{"enum":["text","image","video","audio","mask","parameter","file","timing","any"],"type":"string"}},"required":["key","label","type"]},"description":"Input handles (with default settings; some depend on them)."},"modelKinds":{"type":"array","items":{"type":"string"}},"outputs":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string"},"limit":{"type":"integer","description":"How many edges it takes: 1 when left out (a new edge replaces the one there), -1 for any number.","examples":[20]},"required":{"type":"boolean"},"type":{"enum":["text","image","video","audio","mask","parameter","file","timing","any"],"type":"string"}},"required":["key","label","type"]}},"runner":{"enum":["generate","copilot","capability","action","image"],"type":"string"},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"JSON Schema of `data.settings`.","examples":[{}]},"shortcut":{"type":"string","description":"The key that adds it on the canvas."},"title":{"type":"string","examples":["Autumn campaign"]},"toolbarActions":{"type":"array","items":{"type":"object","properties":{"createsType":{"type":"string"},"label":{"type":"string"},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{}]}},"required":["createsType","label"]},"description":"Next steps its toolbar offers: a new node of `createsType`, wired from it."},"type":{"type":"string"}},"required":["behavior","category","description","group","inputs","outputs","settings","title","type"]}}},"required":["nodeTypes"]}}}}}}},"/workflows/{workflowId}/runs":{"get":{"operationId":"listWorkflowRuns","summary":"List runs","description":"A workflow's 100 most recent runs, newest first.\n\nRequires scope `workflows:read`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["2c9a7f10-6b3e-4d21-9f8a-5e7c1b0d4a36"]}}],"responses":{"200":{"description":"The runs.","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{},"format":{}}},{"type":"object","properties":{"content":{},"contentType":{},"durationSeconds":{},"format":{},"height":{},"kind":{},"thumbnail":{},"thumbnailUrl":{},"url":{},"width":{}}}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."}}},"required":["runs"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:read"},"post":{"operationId":"startWorkflowRun","summary":"Run nodes","description":"Runs nodes of a workflow in the background. Each node runs `count` times (per item, when an iterator or a splitter feeds it) and adds that many results to the ones it has; its results show up `pending` at once. Only the nodes asked for run: what's upstream (one hop, and one more past a Router) is read as the result it shows and never run again. Nodes of the run that feed each other run in dependency order.\n\nA run is refused with `409 RUN_REFUSED` when a node asked for is already running, a required input isn't connected, or something upstream is still processing, has failed or has nothing to give (`data.code` says which, `data.nodeIds` names the nodes). An `auto` version of the workflow is saved with every run.\n\nThe response is `202 Accepted` with the run. Follow it with `GET /workflows/{workflowId}/events`, or poll `GET /workflow-runs/{runId}`.\n\nRequires scope `workflows:run`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is `409 CONFLICT`. A request that fails frees its key.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string","examples":["5f0c7e1a-2b8d-4c3e-9a61-7d2f4b8e0c19"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer","minimum":1,"maximum":20,"default":1,"description":"How many results each node makes (per item, when an iterator or a splitter feeds it), 1–20."},"fromDraft":{"type":"object","properties":{"resultId":{"type":"string","minLength":1,"maxLength":128,"examples":["750ab75b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["resultId"],"description":"Render final: run the one Video node in `nodeIds` as the final (1080p, billed in full) of its draft result `resultId`, rather than with its settings. Drafts can be rendered for 7 days."},"idempotencyKey":{"type":"string","minLength":1,"maxLength":200,"description":"Send the same key again (a retry after a timeout) and you get the run the first request started, not a second one.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"nodeIds":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","minLength":1,"maxLength":128},"description":"The nodes to run (`node`, `selection`), or the Sections whose runnable nodes run (`section`)."},"pageId":{"type":"string","minLength":1,"maxLength":128,"description":"The page they're on; the first page when left out.","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"priceVersion":{"type":"integer","minimum":0,"description":"The price book version (`GET /pricing`) your estimate came from. If prices went up since, the run is refused with `409 PRICE_CHANGED` and its new estimate, rather than charged more than you showed.","examples":[3]},"runType":{"enum":["node","selection","section"],"type":"string","default":"node"}},"required":["nodeIds"]}}}},"responses":{"202":{"description":"Accepted: the run is going.","content":{"application/json":{"schema":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["PRICE_CHANGED","RUN_REFUSED","CONFLICT"],"examples":["PRICE_CHANGED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Prices changed since you looked.","The run can't start.","This Idempotency-Key was already used with a different request","A request with this Idempotency-Key is still in progress"],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"type":"object","properties":{"credits":{"type":"integer","minimum":0,"description":"The run's estimate at today's prices.","examples":[12]},"priceVersion":{"type":"integer","description":"The price book version it was priced with: send it as `priceVersion` to run at that price.","examples":[3]}},"required":["credits","priceVersion"],"description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"500":{"description":"Internal error: the request was valid but the server couldn't complete it. Safe to retry.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["INTERNAL_SERVER_ERROR"],"examples":["INTERNAL_SERVER_ERROR"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Something went wrong on our side. Please try again."],"type":"string"},"status":{"const":500,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:run"}},"/workflows/{workflowId}/results/stop-preview":{"post":{"operationId":"previewWorkflowStop","summary":"Preview a stop","description":"What Stop on these open results (`resultIds`, or a run's: `runId`) would still charge, asked of their providers now without changing anything: a result already rendering where its provider can't stop it finishes and is charged. `warning` is what to confirm (\"Already rendering — it will finish and be charged (180 credits).\"), or null when Stop cancels them all for free.\n\nRequires scope `workflows:cancel`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"resultIds":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"string","minLength":1,"maxLength":128}},"runId":{"type":"string","minLength":1,"maxLength":128,"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}}}}},"responses":{"200":{"description":"What Stop would charge.","content":{"application/json":{"schema":{"type":"object","properties":{"warning":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["warning"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:cancel"}},"/workflows/{workflowId}/cover":{"put":{"operationId":"setWorkflowCover","summary":"Set a project's cover","description":"Sets the image a project's card shows (Set as Cover): one of the workspace's images, by storage key. `null` goes back to the canvas preview. Not an edit of the document: its `version` stays.\n\nRequires scope `workflows:write`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"anyOf":[{"type":"string","minLength":1,"maxLength":1024,"examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"Storage key of one of the workspace's images (an upload or a result's file) to show as the project's thumbnail; `null` goes back to the canvas preview.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]}},"required":["key"]}}}},"responses":{"200":{"description":"The cover's download URL, or null.","content":{"application/json":{"schema":{"type":"object","properties":{"coverUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"A short-lived download URL of the cover, or null.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]}},"required":["coverUrl"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:write"}},"/workflows/{workflowId}/events":{"get":{"operationId":"watchWorkflow","summary":"Follow a workflow","description":"Streams a workflow's changes as server-sent events: a `result` event whenever a node's result changes (`{ type, nodeId, result }`, the result as `GET /workflows/{workflowId}` shows it) and a `run` event when a run ends. Nothing is replayed: read the workflow when you connect and again whenever you reconnect. The stream ends after 15 minutes; reconnect to keep following.\n\nRequires scope `workflows:read`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["2c9a7f10-6b3e-4d21-9f8a-5e7c1b0d4a36"]}}],"responses":{"200":{"description":"An event stream of the workflow's changes.","content":{"text/event-stream":{"schema":{"oneOf":[{"type":"object","properties":{"event":{"const":"message"},"data":{"anyOf":[{"type":"object","properties":{"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"result":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]}},"required":["createdAt","id","status"]},"type":{"const":"result"}},"required":["nodeId","result","type"]},{"type":"object","properties":{"run":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{},"format":{}}},{"type":"object","properties":{"content":{},"contentType":{},"durationSeconds":{},"format":{},"height":{},"kind":{},"thumbnail":{},"thumbnailUrl":{},"url":{},"width":{}}}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"type":{"const":"run"}},"required":["run","type"]}]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event","data"]},{"type":"object","properties":{"event":{"const":"done"},"data":{"type":"object","properties":{"reason":{"enum":["closed","timeout"],"type":"string"}},"required":["reason"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event","data"]},{"type":"object","properties":{"event":{"const":"error"},"data":{},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"retry":{"type":"number","examples":[1]}},"required":["event"]}]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:read"}},"/videos":{"get":{"operationId":"listVideos","summary":"List videos","description":"Your workspace's finished videos, newest first: what workflows' Export steps (or the last step of a chain) made, video generations made outside workflows, and the Editor's renders.\n\nRequires scope `workflows:read`.","tags":["Workflows"],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":60,"description":"How many videos to return."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"The videos.","content":{"application/json":{"schema":{"type":"object","properties":{"videos":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"editId":{"anyOf":[{"type":"string","examples":["d8d0d9b1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"The edit, for a render from the Editor.","examples":["d8d0d9b1-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"height":{"anyOf":[{"type":"integer","examples":[1280]},{"type":"null"}],"examples":[1280]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"key":{"type":"string","description":"The file's storage key.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"label":{"type":"string","description":"The workflow step that made it, the model, or `Editor` for a render."},"posterUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},{"type":"null"}],"description":"A still for previews (an Export's thumbnail), if any.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"source":{"enum":["workflow","generation","edit"],"type":"string"},"title":{"type":"string","description":"The workflow's name, the generation's prompt, or the edit's name.","examples":["Autumn campaign"]},"url":{"type":"string","description":"Download URL (presigned).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"anyOf":[{"type":"integer","examples":[1024]},{"type":"null"}],"examples":[1024]},"workflowId":{"anyOf":[{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["contentType","createdAt","editId","height","id","key","label","posterUrl","source","title","url","width","workflowId"],"description":"A finished video."}}},"required":["videos"]}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:read"}},"/workflows/{workflowId}/results/{resultId}":{"delete":{"operationId":"deleteWorkflowResult","summary":"Delete a result","description":"Deletes one of a node's results from its history. One still being made can't be: cancel it first. For 30 days `POST /workflows/{workflowId}/results/{resultId}/restore` brings it back (undo). Its files stay in storage (an asset filed from it keeps them).\n\nRequires scope `workflows:delete`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"name":"resultId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["750ab75b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:delete"}},"/workflow-revisions/{revisionId}":{"delete":{"operationId":"deleteWorkflowRevision","summary":"Delete a version","description":"Deletes a saved version. The workflow itself is unchanged.\n\nRequires scope `workflows:delete`.","tags":["Workflows"],"parameters":[{"name":"revisionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["6c46ebd8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"const":true}},"required":["deleted"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:delete"},"get":{"operationId":"getWorkflowRevision","summary":"Get a version","description":"Reads a version: the workflow as it was then, each node with the results it had by then, to look at read-only.\n\nRequires scope `workflows:read`.","tags":["Workflows"],"parameters":[{"name":"revisionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["6c46ebd8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"The version and the workflow as it was.","content":{"application/json":{"schema":{"type":"object","properties":{"revision":{"type":"object","properties":{"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","image","name"]},{"type":"null"}],"description":"Who saved it (who started the run, for `auto`)."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["auto","manual","restore"],"type":"string"},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"runNodeCount":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"examples":[1]},"title":{"anyOf":[{"type":"string","examples":["Autumn campaign"]},{"type":"null"}],"examples":["Autumn campaign"]}},"required":["createdAt","id","kind","runId","title"]},"workflow":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"nodeCount":{"type":"integer","examples":[1]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"version":{"type":"integer","examples":[3]},"activeRuns":{"type":"array","items":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"anyOf":[{},{}]},{"type":"null"}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"description":"The runs still going."},"creditsSpent":{"type":"integer","description":"The credits all the workflow's runs have spent.","examples":[12]},"document":{"type":"object","properties":{"pages":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","properties":{"edges":{"type":"array","maxItems":2000,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"source":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"sourceHandle":{"type":"string","minLength":1,"maxLength":64},"target":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"targetHandle":{"type":"string","minLength":1,"maxLength":64}},"required":["id","source","sourceHandle","target","targetHandle"]},"default":[]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"nodes":{"type":"array","maxItems":500,"items":{"type":"object","properties":{"data":{"type":"object","properties":{"exposedParameterKeys":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":64}},"label":{"type":"string","maxLength":200},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"examples":[{"seed":42}]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{},"additionalProperties":{},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]}},"required":["createdAt","id","status"]},"default":[]},"selectedResultIndex":{"type":"integer","minimum":0,"examples":[1]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["default","processing","error","success"],"type":"string","default":"default"},"tags":{"type":"array","maxItems":12,"items":{"type":"string","minLength":1,"maxLength":32}},"variables":{"type":"array","maxItems":50,"items":{"type":"object","properties":{"handle":{"type":"string","minLength":1,"maxLength":64},"variableId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["84598e5d-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["handle","variableId"]}}},"default":{"results":[],"settings":{},"status":"default"}},"height":{"type":"number","exclusiveMinimum":0,"examples":[1280]},"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"parentId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["eb290249-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"position":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]}},"required":["x","y"]},"type":{"type":"string","minLength":1,"maxLength":64},"width":{"type":"number","exclusiveMinimum":0,"examples":[1024]}},"required":["id","position","type"]},"default":[]},"viewport":{"type":"object","properties":{"x":{"type":"number","examples":[1]},"y":{"type":"number","examples":[1]},"zoom":{"type":"number","exclusiveMinimum":0,"examples":[1]}},"required":["x","y","zoom"]}},"required":["id","name"]},"default":[{"id":"page-1","name":"Page 1","edges":[],"nodes":[]}]},"schemaVersion":{"const":2,"default":2},"variables":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","minLength":1,"maxLength":100,"examples":["Autumn campaign"]},"options":{"type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":200}},"pageId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"enum":["text","image","video","audio","number","choice"],"type":"string"},"value":{"type":"string","maxLength":100000,"default":""}},"required":["id","name","type"]},"default":[]}},"description":"The document (`schemaVersion: 2`): `pages` of `nodes` and `edges` in React Flow's shape, and the workflow's `variables`. A node's settings are in `data.settings` (see `GET /node-types`); edges join handles by key. Nodes' `results` and `status` are the server's: they're filled in when you read the workflow and ignored when you save it. A node shows and sends on the result at `data.selectedResultIndex`, or its newest when that's left out."},"files":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Download URLs of the workspace's files the document points at (Import files, batch uploads, media variables), by storage key, to show them before anything runs.","examples":[{}]}},"required":["createdAt","id","name","nodeCount","updatedAt","version","activeRuns","creditsSpent","document","files"]}},"required":["revision","workflow"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:read"},"patch":{"operationId":"updateWorkflowRevision","summary":"Name a version","description":"Names a version (or clears its name with an empty title).\n\nRequires scope `workflows:write`.","tags":["Workflows"],"parameters":[{"name":"revisionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["6c46ebd8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":200,"examples":["Autumn campaign"]}},"required":["title"]}}}},"responses":{"200":{"description":"The version.","content":{"application/json":{"schema":{"type":"object","properties":{"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","image","name"]},{"type":"null"}],"description":"Who saved it (who started the run, for `auto`)."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["auto","manual","restore"],"type":"string"},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"runNodeCount":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"examples":[1]},"title":{"anyOf":[{"type":"string","examples":["Autumn campaign"]},{"type":"null"}],"examples":["Autumn campaign"]}},"required":["createdAt","id","kind","runId","title"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:write"}},"/workflows/{workflowId}/results/{resultId}/restore":{"post":{"operationId":"restoreWorkflowResult","summary":"Restore a deleted result","description":"Brings back a result deleted in the last 30 days (undoes `DELETE /workflows/{workflowId}/results/{resultId}`): it's in its node's history again, in its place. Restoring one that isn't deleted changes nothing.\n\nRequires scope `workflows:write`.","tags":["Workflows"],"parameters":[{"name":"workflowId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"name":"resultId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["750ab75b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"responses":{"200":{"description":"Restored.","content":{"application/json":{"schema":{"type":"object","properties":{"restored":{"const":true}},"required":["restored"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:write"}},"/workflow-revisions/{revisionId}/restore":{"post":{"operationId":"restoreWorkflowRevision","summary":"Restore a version","description":"Brings a version back: the workflow's document becomes the version's, saved as a new `restore` version (what it was just before is saved as an `auto` one). Send the workflow `version` you last read; if someone saved since, you get `409`. Results aren't touched.\n\nRequires scope `workflows:write`.","tags":["Workflows"],"parameters":[{"name":"revisionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"examples":["6c46ebd8-5b3d-4f60-8e2a-1d9c6b4f7e05"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"examples":[3]}},"required":["version"]}}}},"responses":{"200":{"description":"The workflow's summary, with its new `version`, and the new version.","content":{"application/json":{"schema":{"type":"object","properties":{"revision":{"type":"object","properties":{"author":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string","examples":["Autumn campaign"]}},"required":["id","image","name"]},{"type":"null"}],"description":"Who saved it (who started the run, for `auto`)."},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"kind":{"enum":["auto","manual","restore"],"type":"string"},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"runNodeCount":{"anyOf":[{"type":"integer","examples":[1]},{"type":"null"}],"examples":[1]},"title":{"anyOf":[{"type":"string","examples":["Autumn campaign"]},{"type":"null"}],"examples":["Autumn campaign"]}},"required":["createdAt","id","kind","runId","title"]},"workflow":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"name":{"type":"string","examples":["Autumn campaign"]},"nodeCount":{"type":"integer","examples":[1]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"version":{"type":"integer","examples":[3]}},"required":["createdAt","id","name","nodeCount","updatedAt","version"]}},"required":["revision","workflow"]}}}},"400":{"description":"Bad request: the input failed validation. `data.issues` lists each failed check.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["BAD_REQUEST"],"examples":["BAD_REQUEST"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Input validation failed"],"type":"string"},"status":{"const":400,"description":"The HTTP status code, repeated.","type":"integer"},"data":{"$ref":"#/components/schemas/ValidationErrorData","description":"Details about the error."}},"required":["defined","code","status","message","data"],"type":"object"}}}},"401":{"description":"Unauthorized: neither a valid session cookie nor a valid API key was sent.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["UNAUTHORIZED"],"examples":["UNAUTHORIZED"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Sign in first, or send an API key: this endpoint needs a session or a key."],"type":"string"},"status":{"const":401,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"404":{"description":"Not found: the resource doesn't exist or belongs to another workspace.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["NOT_FOUND"],"examples":["NOT_FOUND"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["Not found."],"type":"string"},"status":{"const":404,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}},"409":{"description":"Conflict: the resource exists but can't do this (e.g. a clip made before re-exports existed). `message` says why; retrying won't help.","content":{"application/json":{"schema":{"description":"An error.","properties":{"code":{"description":"Machine-readable error code.","enum":["CONFLICT"],"examples":["CONFLICT"],"type":"string"},"defined":{"description":"`true` for the documented errors listed here; `false` for unexpected ones.","examples":[true],"type":"boolean"},"message":{"description":"Human-readable explanation, safe to show to users.","examples":["The resource can't do that in its current state."],"type":"string"},"status":{"const":409,"description":"The HTTP status code, repeated.","type":"integer"}},"required":["defined","code","status","message"],"type":"object"}}}}},"security":[{"apiKey":[]}],"x-required-scope":"workflows:write"}}},"webhooks":{"generation.succeeded":{"post":{"description":"A generation succeeded. Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookGenerationSucceeded","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A generation succeeded.","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"generation.succeeded","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"generation.succeeded","tags":["Webhooks"]}},"generation.failed":{"post":{"description":"A generation failed. Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookGenerationFailed","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A generation failed.","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"generation.failed","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"generation.failed","tags":["Webhooks"]}},"generation.canceled":{"post":{"description":"A generation was cancelled (or stopped). Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookGenerationCanceled","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A generation was cancelled (or stopped).","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-09-30T12:00:00.000Z"]},"createdByUserId":{"anyOf":[{"type":"string","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"description":"Who asked for it; `null` when an API key did (keys belong to the workspace).","examples":["f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"credits":{"type":"integer","description":"Credits this request costs.","examples":[12]},"creditsRefunded":{"type":"boolean","description":"Its credits came back: it failed or was cancelled before its provider billed anything. False while it runs, once it completed, and when a failed one kept them because its provider billed (or may still bill) what it was sent (`error` says so)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why it failed, when `status` is `failed`.","examples":[null]},"id":{"type":"string","examples":["7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The request as accepted, defaults filled in and `@` mentions resolved (their files added to the references, the prompt pointing at them as `@Image1`, `@Video1`, ...).","examples":[{"prompt":"A lighthouse on a cliff at dusk, cinematic"}]},"kind":{"enum":["image","video","speech","sound_effect","music","background_removal"],"type":"string","description":"What the model makes: `image`, `video`, `speech`, `sound_effect`, `music` or `background_removal` (a cutout of an image)."},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Extras from the model, e.g. `seed`, or `timestamps` (word timings) for speech, and the request's `source` when it named one.","examples":[{"seed":42}]},"model":{"type":"string","examples":["google/nano-banana-pro"]},"organizationId":{"type":"string","description":"Id of the workspace that owns it (yours).","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","description":"Audio and video: how long it plays, when its file says (WAV, MP3, MP4).","examples":[5]},"exportOf":{"type":"object","properties":{"format":{"type":"string"},"index":{"type":"integer","examples":[1]}},"required":["format","index"],"description":"An `export`'s source: the output it was cut from (by index) and the thumbnail format."},"height":{"type":"integer","examples":[1280]},"key":{"type":"string","description":"Storage key; pass it as an input (`{ key }`) to another generation.","examples":["generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"kind":{"enum":["image","video","audio"],"type":"string"},"previews":{"type":"array","items":{"type":"object","properties":{"height":{"type":"integer","examples":[1280]},"url":{"type":"string","description":"Presigned, like the file's `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["height","url","width"],"description":"A web-sized WebP of an image."},"description":"Web-sized WebPs of an image `output`, smallest first: its short side at 384px and 768px (only the sizes smaller than the image). Empty for other files, for images made before previews, and for images smaller than 384px. For grids, offer them with the image itself as `srcset` width candidates."},"previewUrl":{"anyOf":[{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},{"type":"null"}],"description":"The smallest of `previews` (presigned like `url`), or `null` when there is none: show it in grids and fall back to `url`.","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"role":{"enum":["output","last_frame","export"],"type":"string","description":"`output` for what you asked for; `last_frame` for a video's final frame (handy as the next shot's first frame); `export` for a thumbnail cut and resized to its format's exact pixels (`metadata.thumbnail.format`)."},"sizeBytes":{"type":"integer","examples":[2457600]},"url":{"type":"string","description":"Download URL (presigned, valid for a while).","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["contentType","key","kind","previews","previewUrl","role","sizeBytes","url"],"description":"A file the generation made."}},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"description":"When it was made public; `null` while it's private.","examples":["2026-10-21T12:00:00.000Z"]},"references":{"type":"array","items":{"type":"object","properties":{"fileIds":{"type":"array","items":{"type":"string"}},"itemId":{"type":"string","examples":["59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"label":{"type":"string"},"version":{"type":"integer","examples":[3]},"versionId":{"type":"string","examples":["772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["fileIds","itemId","label","version","versionId"]},"description":"The Library items the prompt mentioned, pinned to the version and files used."},"status":{"enum":["queued","running","completed","failed","cancelled"],"type":"string","description":"`queued` → `running` → `completed`, or `failed` / `cancelled`."},"stopRequested":{"type":"boolean","description":"It was cancelled while its provider was already rendering it: nothing more is sent for it, and it finishes and is charged (or, should the provider stop it after all, ends `cancelled`)."},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"visibility":{"enum":["private","public"],"type":"string","description":"`private`: your workspace only. `public`: also in Community, for every Remagica user. Always set in responses (optional only for older clients)."}},"required":["completedAt","createdAt","createdByUserId","credits","creditsRefunded","error","id","input","kind","metadata","model","organizationId","outputs","references","status","stopRequested","updatedAt"],"description":"One generation request and its results."},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"generation.canceled","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"generation.canceled","tags":["Webhooks"]}},"workflow_run.succeeded":{"post":{"description":"A workflow run succeeded. Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookWorkflowRunSucceeded","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A workflow run succeeded.","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"workflow_run.succeeded","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"workflow_run.succeeded","tags":["Webhooks"]}},"workflow_run.failed":{"post":{"description":"A workflow run failed. Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookWorkflowRunFailed","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A workflow run failed.","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"workflow_run.failed","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"workflow_run.failed","tags":["Webhooks"]}},"workflow_run.canceled":{"post":{"description":"A workflow run was cancelled (or stopped). Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookWorkflowRunCanceled","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A workflow run was cancelled (or stopped).","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"workflow_run.canceled","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"workflow_run.canceled","tags":["Webhooks"]}},"app_run.succeeded":{"post":{"description":"A app run succeeded. Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookAppRunSucceeded","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A app run succeeded.","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"type":"object","properties":{"appId":{"type":"string","examples":["3106d2f0-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputNodeIds":{"type":"array","items":{"type":"string"}},"run":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"anyOf":[{},{}]},{"type":"null"}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":20000},{"type":"number","examples":[1]},{"type":"boolean"}]},"examples":[{"node_prompt_1:text":"A cozy cabin in the snow"}]},"workflowId":{"type":"string","description":"The workflow the run runs in: follow `GET /workflows/{workflowId}/events` for its results.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["appId","createdAt","id","outputNodeIds","run","values","workflowId"]},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"app_run.succeeded","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"app_run.succeeded","tags":["Webhooks"]}},"app_run.failed":{"post":{"description":"A app run failed. Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookAppRunFailed","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A app run failed.","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"type":"object","properties":{"appId":{"type":"string","examples":["3106d2f0-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputNodeIds":{"type":"array","items":{"type":"string"}},"run":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"anyOf":[{},{}]},{"type":"null"}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":20000},{"type":"number","examples":[1]},{"type":"boolean"}]},"examples":[{"node_prompt_1:text":"A cozy cabin in the snow"}]},"workflowId":{"type":"string","description":"The workflow the run runs in: follow `GET /workflows/{workflowId}/events` for its results.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["appId","createdAt","id","outputNodeIds","run","values","workflowId"]},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"app_run.failed","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"app_run.failed","tags":["Webhooks"]}},"app_run.canceled":{"post":{"description":"A app run was cancelled (or stopped). Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookAppRunCanceled","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A app run was cancelled (or stopped).","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"type":"object","properties":{"appId":{"type":"string","examples":["3106d2f0-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"id":{"type":"string","examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputNodeIds":{"type":"array","items":{"type":"string"}},"run":{"type":"object","properties":{"completedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},{"type":"null"}],"examples":["2026-10-21T12:00:00.000Z"]},"count":{"type":"integer","examples":[1]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","examples":["2026-10-21T12:00:00.000Z"]},"creditsEstimated":{"type":"integer","description":"What the run was estimated to cost when it started: Σ per node of one result's price × `count` × items.","examples":[12]},"creditsSpent":{"type":"integer","description":"What its results have cost so far (refunds taken off).","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","examples":["8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08"]},"nodeIds":{"type":"array","items":{"type":"string"},"description":"The nodes it runs, each after the ones of them it reads."},"pageId":{"type":"string","examples":["c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"results":{"type":"array","items":{"type":"object","properties":{"createdAt":{"type":"string"},"credits":{"type":"integer","examples":[12]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"examples":[null]},"id":{"type":"string","minLength":1,"maxLength":128,"examples":["a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"outputs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"object","properties":{"content":{"type":"string"},"format":{"const":"text"}},"required":["content","format"]},{"type":"object","properties":{"content":{"type":"string","minLength":1},"contentType":{"type":"string","examples":["image/png"]},"durationSeconds":{"type":"number","exclusiveMinimum":0,"examples":[5]},"format":{"const":"url"},"height":{"type":"integer","examples":[1280]},"kind":{"enum":["image","video","audio","file"],"type":"string"},"thumbnail":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.jpg"]},"url":{"type":"string","examples":["https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"]},"width":{"type":"integer","examples":[1024]}},"required":["content","contentType","format","kind"]},{"type":"object","properties":{"content":{"type":"array","items":{"anyOf":[{"anyOf":[{},{}]},{"type":"null"}]}},"format":{"const":"list"}},"required":["content","format"]}]},"default":{}},"provider":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"runId":{"anyOf":[{"type":"string","examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},{"type":"null"}],"examples":["599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"settings":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"default":{}},"status":{"enum":["pending","processing","finished","error"],"type":"string"},"stop":{"anyOf":[{"enum":["kept"],"type":"string"},{"type":"null"}]},"item":{"type":"integer","examples":[1]},"nodeId":{"type":"string","examples":["7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"variation":{"type":"integer","examples":[1]}},"required":["createdAt","id","status","item","nodeId","variation"]},"description":"Its results so far (with the run on its own)."},"runType":{"enum":["node","selection","section"],"type":"string"},"status":{"enum":["running","completed","failed","cancelled","stopped"],"type":"string","description":"`running` → `completed` (every result finished), `failed` (some really failed), `cancelled` (stopped, nothing kept) or `stopped` (stopped, or some results cancelled, with what was kept said in `error`: results already rendering finish and are charged)."},"workflowId":{"type":"string","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["completedAt","count","createdAt","creditsEstimated","creditsSpent","error","id","nodeIds","pageId","runType","status","workflowId"],"description":"One run of nodes of a workflow."},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":20000},{"type":"number","examples":[1]},{"type":"boolean"}]},"examples":[{"node_prompt_1:text":"A cozy cabin in the snow"}]},"workflowId":{"type":"string","description":"The workflow the run runs in: follow `GET /workflows/{workflowId}/events` for its results.","examples":["cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},"required":["appId","createdAt","id","outputNodeIds","run","values","workflowId"]},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"app_run.canceled","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"app_run.canceled","tags":["Webhooks"]}},"clip_job.succeeded":{"post":{"description":"A clip job succeeded. Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookClipJobSucceeded","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A clip job succeeded.","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"$ref":"#/components/schemas/ClipJob"},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"clip_job.succeeded","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"clip_job.succeeded","tags":["Webhooks"]}},"clip_job.failed":{"post":{"description":"A clip job failed. Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookClipJobFailed","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A clip job failed.","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"$ref":"#/components/schemas/ClipJob"},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"clip_job.failed","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"clip_job.failed","tags":["Webhooks"]}},"clip_export.succeeded":{"post":{"description":"A clip export succeeded. Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookClipExportSucceeded","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A clip export succeeded.","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"$ref":"#/components/schemas/ClipExport"},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"clip_export.succeeded","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"clip_export.succeeded","tags":["Webhooks"]}},"clip_export.failed":{"post":{"description":"A clip export failed. Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookClipExportFailed","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A clip export failed.","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"$ref":"#/components/schemas/ClipExport"},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"clip_export.failed","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"clip_export.failed","tags":["Webhooks"]}},"webhook.test":{"post":{"description":"A test event, sent by Send test event. Answer 2xx within 10 seconds; anything else is retried for about a day.","operationId":"webhookWebhookTest","parameters":[{"description":"`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, keyed with the endpoint's secret.","in":"header","name":"Remagica-Signature","required":true,"schema":{"type":"string"}},{"description":"The event's id: the same in every retry and redelivery.","in":"header","name":"Remagica-Event-Id","required":true,"schema":{"type":"string","examples":["f602728b-5b3d-4f60-8e2a-1d9c6b4f7e05"]}},{"description":"The event's type, as in the body.","in":"header","name":"Remagica-Event-Type","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"description":"A test event, sent by Send test event.","properties":{"createdAt":{"description":"When it happened.","format":"date-time","type":"string","examples":["2026-10-21T12:00:00.000Z"]},"data":{"properties":{"endpointId":{"type":"string","examples":["2ecb03ae-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"message":{"type":"string"}},"required":["endpointId","message"],"type":"object"},"id":{"description":"The event's id (`evt_...`).","examples":["evt_3f1c9a0b2d4e6f8a1b3c5d7e"],"type":"string"},"organizationId":{"description":"The workspace it happened in.","type":"string","examples":["9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05"]},"type":{"const":"webhook.test","type":"string"}},"required":["id","type","createdAt","organizationId","data"],"type":"object"}}},"required":true},"responses":{"2XX":{"description":"Received. Any 2xx acknowledges the event."}},"summary":"webhook.test","tags":["Webhooks"]}}}}