Generate image or animation
Starts an async generation job. Returns 202 with data.job_id - poll via GET /v1/jobs/{id} (or pass ?wait=true for long-polling). Cost by type: image=1, animation=2/sec with animation_model=standard (2–15s) or 6/sec with animation_model=premium (4–30s), default 5s for either choice (+1 if no source image); omitting animation_model preserves legacy 5/sec, 4–10s, default 4s, logo=5, edit=1 for images, scene=3, reverse=0. For type: animation, you can skip providing a source image: pass only animation_prompt (and optionally image_prompt) and the system generates a fresh source image first, then animates it. To animate an uploaded image directly, pass its POST /v1/upload asset_id as source_image_asset_id with type=animation. The upload is imported into the mascot without changing references; no image-generation credits are charged. Existing mascot assets preserve their saved context. Before video generation, non-square starting and ending images are center-cropped to square; square images are reused unchanged. Optional source_image_crop and end_image_crop specify integer x, y, width and height in pixels after image orientation. Cropped copies preserve the originals and incur no extra credits. Invalid crops return 400 before charging. If you have an existing item, pass item_id to animate/edit its current image. For image generation and image edits, pass optional visual_references for one-time pose, expression, motion, prop, style, or scene cues; these references do not become collection mascot references. Scene generation and scene editing also use this endpoint with type: "scene". For a new scene, optional source_asset_id selects its character reference and saved variant context. For scene edits use source_image_asset_id with edit_instructions; the two source fields are mutually exclusive. Talking animations: pass speech with type: animation and the mascot says the line in its voice (see the Voice endpoints). The length follows the speech, 5 seconds to 5 minutes at 2 credits per second; the receipt charges the longest the line could need and unused seconds are refunded once the voice is recorded. Talking adds audio (MP3) and transcript (JSON) assets. With dry_run: true it returns 200 with the estimate instead. Returns 409 with details.reason voice_required when the mascot has no voice yet. Returns 402 if credits are insufficient.
Request
- Base URL: https://api.masko.ai
- URL: https://api.masko.ai/v1/collections/{id}/generate
- Auth: HTTP bearer
Path parameters
Headers
Account-scoped key (1 to 255 characters, ideally a UUID). Retries must preserve the credential workspace, effective API version, URL, content type and exact body bytes, including multipart boundaries; different inputs return 409 idempotency_key_reused. Completed responses, including 500 errors, replay for 24 hours after completion with current resource access checked again. Running or unconfirmed executions return 409 idempotency_request_in_progress and do not expire automatically. A receipt persistence failure returns 503 idempotency_persistence_failed: retry only with the same key and inspect the operation outcome before starting a new request.
Request body
Response
Talking estimate (speech with dry_run)
Changes
No recorded changes to this operation across all 1 revision of this API.