---
title: "Generate canvas images, stickers, and animations"
method: POST
path: "/v1/canvases/{canvasId}/generate-all"
tags: ["Canvases"]
---

# Generate canvas images, stickers, and animations

`POST /v1/canvases/{canvasId}/generate-all`

## Request

- Base URL: `https://api.masko.ai`
- URL: `https://api.masko.ai/v1/canvases/{canvasId}/generate-all`
- Auth: HTTP bearer

Kicks off generation for pending canvas node images, sticker derivatives, and/or edge animations. Pass animation_model=standard (2 credits/sec, 2–15s) or premium (6 credits/sec, 4–30s); both default to 5s. Omit the field for legacy generation (5 credits/sec, 4–10s, default 4s). Model choice is included in plan approval and idempotent replay checks. Requires a write key in the mascot workspace and project access, including for dry runs. Cross-workspace mascots return 404. Use `dry_run=true` first to preview planned work, prompts, skipped items, and estimated credits without creating jobs/assets or spending credits. Dry-run returns `plan_id` and `graph_content_hash`; send them as `approved_plan_id` and `expected_graph_hash` on execution so a changed graph, prompt, option, or selection returns 409 before spending. Use `targets="images"` to generate poses, `targets="stickers"` to backfill transparent sticker derivatives for completed node images, `targets="animations"` for edge videos, or `include_stickers=true` to create stickers alongside newly generated images.

## Path parameters

- `canvasId` string, uuid, required

## Headers

- `Idempotency-Key` string

## Request body

- GenerateAllBody
  - `animation_model` 'standard' | 'premium': Same choices as Studio: standard costs 2 credits/sec (2–15s); premium costs 6 credits/sec (4–30s). Both default to 5s. Omit to preserve legacy generation at 5 credits/sec (4–10s, default 4s).
  - `duration` integer: Whole seconds. Standard: 2–15; Premium: 4–30; default 5 with either explicit model. Without animation_model: 4–10, default 4. An additional image costs 1 credit only when a source image must be generated.
  - `max_credits` number: Hard server-side credit ceiling. Execution fails before billing when the current work exceeds this limit.
  - `skip_completed` boolean: Deprecated compatibility flag. Canvas generate-all only dispatches missing work and always skips edges that already have assigned generated assets.
  - `include_stickers` boolean: When true, generate sticker_image derivatives for generated image nodes.
  - `dry_run` boolean: When true, only returns the planned work, prompts, skipped items, and estimated credit cost. Does not deduct credits, create jobs/assets/items, mutate the canvas graph, or start workflows.
  - `targets` 'all' | 'images' | 'stickers' | 'animations': Which work to dispatch. "images" only generates skeleton node images. "stickers" backfills sticker_image derivatives for completed node images. "animations" only dispatches edge videos. "all" does both images and animations.
  - `node_ids` string[]: Optional exact node selection. When present, only these nodes are considered for image or sticker work. Omit to consider every node.
  - `edge_ids` string[]: Optional exact edge selection. When present, only these edges are considered for animation work. Omit to consider every edge.
  - `expected_graph_hash` string: Optional graph revision returned by the dry-run plan. Execution returns 409 if the canvas changed after approval.
  - `approved_plan_id` string: Optional generation plan identity returned by dry_run. Execution returns 409 unless the current graph, scope, prompts, duration, and generation options still match that approved plan.

## Response `200`

Generation plan returned or jobs started

- CanvasGenerateAllResponse
  - `data` CanvasGenerateAllData, required
    - `plan_id` string: Stable identity of the exact graph, scope, prompts, and generation options. Return it as approved_plan_id when executing an approved dry-run plan.
    - `graph_content_hash` string: Canvas revision used by this plan. Return it as expected_graph_hash when executing an approved dry-run plan.
    - `dry_run` boolean
    - `can_dispatch` boolean
    - `targets` 'all' | 'images' | 'stickers' | 'animations'
    - `duration` number
    - `include_stickers` boolean
    - `skip_completed` boolean
    - `selection` object
      - `node_ids` string[], nullable, required
      - `edge_ids` string[], nullable, required
    - `jobs` object[], required
      - `job_id` string, uuid, required
      - `edge_id` string
      - `node_id` string
      - `type` 'image' | 'edit' | 'sticker' | 'loop' | 'transition', required
      - `source` string
      - `target` string
      - `item_name` string
      - `cost` number, required
      - `urls` object
      - `poll_url` string: Follow this link to poll the job. On /v1/canvases routes it selects the mascot contract, so the job reports mascot_id.
    - `generated` object[], required
    - `planned_jobs` object[]
    - `planned_job_count` number
    - `planned_nodes` object[]
    - `planned_edges` object[]
    - `planned_stickers` object[]
    - `skipped` number, required
    - `skipped_items` object[], required
      - `kind` 'node' | 'edge', required
      - `id` string, required
      - `reason` string, required
      - `asset_id` string, nullable
      - `asset_status` string
    - `reverse_free` object[], required
      - `kind` 'edge', required
      - `id` string, required
      - `reason` 'reverse_edge_free', required
      - `reverse_of_edge_id` string, nullable, required
    - `already_complete` object[], required
      - `kind` 'node' | 'edge', required
      - `id` string, required
      - `asset_id` string, required
    - `estimated_cost` number, required
    - `actual_cost` number, required
    - `would_charge_credits` number
    - `refunded_credits` number
    - `total_jobs` number, required
    - `total_cost` number, required

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `409`: Conflict

---

[API](https://skmtc.dev/masko/apis/masko-api.md) · [All operations](https://skmtc.dev/masko/apis/masko-api/llms.txt) · [OpenAPI document](https://skmtc.dev/masko/apis/masko-api/revisions/84832e255613?raw)
