{"openapi":"3.1.0","info":{"title":"agent-media API","version":"1.0.0","description":"AI UGC video production API. Generate video, images and audio with the v2 loose surface (/v2/generate/{kind}), selfie and product clips with the fixed generators, and styled subtitles.","contact":{"url":"https://agent-media.ai"},"license":{"name":"Apache-2.0"},"termsOfService":"https://agent-media.ai/terms"},"servers":[{"url":"https://api.agent-media.ai","description":"Production"}],"paths":{"/v1/generate/subtitle":{"post":{"operationId":"subtitle","summary":"Add styled subtitles to an existing video","tags":["generate"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"video_url":{"type":"string","format":"uri"},"style":{"type":"string","enum":["hormozi","minimal","bold","karaoke","clean","tiktok","neon","fire","glow","pop","aesthetic","impact","pastel","electric","boxed","gradient","spotlight"]}},"required":["video_url"],"additionalProperties":false}}}},"responses":{"201":{"description":"Job submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSubmitted"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"429":{"description":"Rate limited","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/generate/show_your_app":{"post":{"operationId":"show_your_app","summary":"Generate a video showing your app with an AI actor holding a phone","tags":["generate"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"app_screenshot_url":{"type":"string","format":"uri"},"actor_slug":{"type":"string","minLength":1,"maxLength":100},"script":{"type":"string","minLength":5,"maxLength":3000},"duration":{"type":"number","default":5},"subtitle_style":{"type":"string","enum":["hormozi","none"],"default":"hormozi"},"webhook_url":{"type":"string","format":"uri"}},"required":["app_screenshot_url","script"],"additionalProperties":false}}}},"responses":{"201":{"description":"Job submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSubmitted"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"429":{"description":"Rate limited","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/generate/product_acting_ugc":{"post":{"operationId":"product_acting_ugc","summary":"Generate a product-in-hand UGC video from a product image and actor reference","tags":["generate"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"product_image_url":{"type":"string","format":"uri","description":"Public URL of the product image to place in the actor scene. PNG, JPEG, or WebP recommended."},"actor_slug":{"type":"string","minLength":1,"maxLength":100,"description":"Actor slug from GET /v1/actors. This actor is used as the creator reference. Required unless actor_image_url is given."},"actor_image_url":{"type":"string","format":"uri","description":"Your own person instead of a stock actor: a photo uploaded to agent-media (or a generated character image)."},"actor_variant_id":{"type":"string","format":"uuid","description":"Optional actor variant UUID for a specific outfit, framing, expression, or background."},"product_name":{"type":"string","minLength":1,"maxLength":120,"description":"Optional product name used for prompt/script context."},"product_description":{"type":"string","minLength":1,"maxLength":1000,"description":"Product context used to generate a short script when script is omitted. Required when script is omitted."},"script":{"type":"string","minLength":5,"maxLength":3000,"description":"Exact words the actor should say. If omitted, the API generates a short script from product_description."},"template":{"type":"string","enum":["product-in-hand","mirror-selfie","bathroom-reaction","kitchen-counter","car-selfie","couch-review","expert-interview","product-closeup"],"default":"product-in-hand","description":"UGC scenario template for the generated frame and motion."},"acting_style":{"type":"string","enum":["raw-selfie","shocked","angry","excited","dramatic","weird-hook","casual-demo","honest-review"],"default":"raw-selfie","description":"Acting energy and delivery style."},"visual_style":{"type":"string","maxLength":200,"description":"Extra camera, pose, environment, or framing direction."},"duration":{"type":"number","default":5,"description":"Video duration in seconds. Valid values: 5, 10, or 15."},"subtitles":{"type":"boolean","default":true,"description":"Whether to burn word-level synced subtitles into the final video."},"subtitle_style":{"type":"string","enum":["hormozi","none"],"default":"hormozi","description":"Subtitle style. Use none to disable subtitle rendering."},"webhook_url":{"type":"string","format":"uri","description":"HTTPS URL to receive a callback when the job completes or fails."}},"required":["product_image_url"],"additionalProperties":false}}}},"responses":{"201":{"description":"Job submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSubmitted"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"429":{"description":"Rate limited","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/generate/laptop_ugc":{"post":{"operationId":"laptop_ugc","summary":"Generate a 3-scene laptop-UGC ad: actor holds laptop showing your app, scrolling B-roll, then a face-only selfie close","tags":["generate"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"app_screen_recording_url":{"type":"string","format":"uri","description":"Public URL of a screen recording of your app (mp4 or mov). Max 10 MB, max 10 seconds. Provide this OR app_screen_image_url, not both."},"app_screen_image_url":{"type":"string","format":"uri","description":"Public URL of a static screenshot of your app (png, jpeg, or webp). Max 5 MB. Provide this OR app_screen_recording_url, not both."},"actor_slug":{"type":"string","minLength":1,"maxLength":100,"description":"Actor slug from GET /v1/actors. Random actor if omitted."},"script":{"type":"string","minLength":5,"maxLength":3000,"description":"Full voiceover script. Auto-split at sentence boundary into two halves for the two face shots."},"duration":{"type":"number","default":20},"subtitle_style":{"type":"string","enum":["hormozi","none"],"default":"hormozi"},"webhook_url":{"type":"string","format":"uri"}},"required":["script"],"additionalProperties":false}}}},"responses":{"201":{"description":"Job submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSubmitted"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"429":{"description":"Rate limited","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/generate/character_video":{"post":{"operationId":"character_video","summary":"Generate a video of a character. Pick an actor by slug, OR pass a short description and we generate a character sheet via gpt-image-2 behind the scenes. Then Seedance 2.0 animates the reference image with your storyboard text.","tags":["generate"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"character_sheet_url":{"type":"string","format":"uri","description":"Public HTTPS URL of the character reference sheet PNG. Generate one via POST /v1/character/sheet-generate or upload your own."},"storyboard_url":{"type":"string","format":"uri","description":"Public HTTPS URL of the storyboard panels PNG. Generate one via POST /v1/character/storyboard-generate or upload your own."},"action_prompt":{"type":"string","minLength":1,"maxLength":2000,"description":"Optional scene/action description sent to Seedance as the primary scene driver (e.g. \"Marco the chef in his Brooklyn kitchen at golden hour, takes a bite of fresh bread\"). When omitted, the api-v2 server backstops it from the same session's storyboard job (script or beats) — without a real scene description Seedance picks the location arbitrarily."},"duration":{"type":"number","default":10,"description":"Video duration in seconds. Valid values: 5 or 10. Max 10s — Seedance i2v quality degrades past 10s with multimodal inputs."},"aspect_ratio":{"type":"string","enum":["9:16","16:9","1:1"],"default":"9:16","description":"Output aspect ratio. Default 9:16."},"generate_audio":{"type":"boolean","default":true,"description":"Whether Seedance synthesizes synchronized audio (ambient sounds, breath, etc.)."},"session_id":{"type":"string","format":"uuid","description":"Optional UUID linking the three pipeline steps (sheet → storyboard → video) into one wizard session. Same value across calls makes inserts idempotent and lets api-v2 backstop action_prompt from the storyboard step."},"webhook_url":{"type":"string","format":"uri","description":"HTTPS URL to receive a callback when the job completes or fails."}},"required":["character_sheet_url","storyboard_url"],"additionalProperties":false}}}},"responses":{"201":{"description":"Job submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSubmitted"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"429":{"description":"Rate limited","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/generate/text_to_video":{"post":{"operationId":"text_to_video","summary":"Pure text-to-video via Seedance 2.0 — no character, no storyboard, no actor. The prompt IS the whole creative (style, subject, mood, composition). Best for stylistic / scene-driven content where you want the model to invent everything from the prompt text alone.","tags":["generate"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":20,"maxLength":1000,"description":"The full video prompt. Style, subject, mood, composition, lighting, lens, motion — all in one string. Seedance reads this verbatim. Min 20 / max 1000 chars."},"duration":{"type":"number","default":10,"description":"Video duration in seconds. Valid: 5, 10, or 15."},"aspect_ratio":{"type":"string","enum":["9:16","16:9","1:1"],"default":"9:16","description":"Output aspect ratio. 9:16 portrait (TikTok / Reels / Shorts), 1:1 square (feed posts), 16:9 landscape (YouTube / X / LinkedIn). Default 9:16."},"generate_audio":{"type":"boolean","default":true,"description":"Whether Seedance synthesizes synchronized audio. No extra charge."},"webhook_url":{"type":"string","format":"uri","description":"HTTPS URL to receive a callback when the job completes or fails."},"postiz_integration_ids":{"type":"array","items":{"type":"string"},"description":"Postiz integration IDs to auto-publish to once the video is rendered. Get them from GET /v1/integrations/postiz/accounts."},"caption_mode":{"type":"string","enum":["ai","static"],"default":"static","description":"Caption mode for auto-publish. 'static' (default) uses the literal `caption` string. 'ai' has Claude Opus generate one each time, biased by `caption_guidance`."},"caption":{"type":"string","minLength":1,"maxLength":2000,"description":"Literal caption text for the social post. Only used when caption_mode is omitted or \"static\"."},"caption_guidance":{"type":"string","minLength":1,"maxLength":1000,"description":"Tone / hashtag / length hints for the AI caption writer. Only used when caption_mode is \"ai\"."}},"required":["prompt"],"additionalProperties":false}}}},"responses":{"201":{"description":"Job submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSubmitted"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"429":{"description":"Rate limited","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/actors":{"get":{"operationId":"listActors","summary":"List actors, or look up a single actor by slug. Public endpoint.","tags":["actors"],"parameters":[{"name":"gender","in":"query","schema":{"type":"string","enum":["female","male"]},"description":"Filter by gender"},{"name":"age_range","in":"query","schema":{"type":"string","enum":["18-25","26-35","36-50","51+"]},"description":"Filter by age range"},{"name":"actor_type","in":"query","schema":{"type":"string","enum":["Young Adult","Professional","Mom","Elder","Casual"]},"description":"Filter by persona type"},{"name":"preset","in":"query","schema":{"type":"string"},"description":"Filter by preset tag (e.g. show_your_app)"},{"name":"search","in":"query","schema":{"type":"string"},"description":"Case-insensitive substring search on name"},{"name":"slug","in":"query","schema":{"type":"string"},"description":"Exact slug lookup. Returns a single actor or 404 with suggestions."},{"name":"limit","in":"query","schema":{"type":"integer","default":500,"minimum":1,"maximum":500},"description":"Page size. Default 500 — large enough to return the full active library in one call."},{"name":"offset","in":"query","schema":{"type":"integer","default":0,"minimum":0},"description":"Page offset."}],"responses":{"200":{"description":"Actor list (when slug is omitted) or single actor (when slug is given).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ActorList"},{"$ref":"#/components/schemas/ActorSingle"}]}}}},"404":{"description":"Actor not found (slug lookup only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","headers":{"Retry-After":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/videos/{jobId}":{"get":{"operationId":"getVideoStatus","summary":"Get video status","tags":["videos"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Job status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatus"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Status lookup unavailable; retry the same job without resubmitting generation.","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before checking the same job again."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tooling/contracts":{"get":{"operationId":"getToolContracts","summary":"List Tooling-First V1 contracts","tags":["tooling"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Tool contracts"}}}},"/v1/tooling/runs":{"post":{"operationId":"createToolingRun","summary":"Start a tooling runtime graph run","tags":["tooling"],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Run queued"}}}},"/v1/tooling/runs/{runId}":{"get":{"operationId":"getToolingRun","summary":"Get tooling run state","tags":["tooling"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Run state"},"404":{"description":"Not found"}}}},"/v1/tooling/runs/{runId}/stream":{"get":{"operationId":"streamToolingRun","summary":"SSE tooling run events with fallback","tags":["tooling"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Event stream"}}}},"/v1/tooling/marketplace/publish":{"post":{"operationId":"publishToolingSkillLegacy","summary":"Publish skill package (legacy alias; use /v1/tooling/marketplace/skills/publish)","tags":["tooling-marketplace"],"security":[{"bearerAuth":[]}],"deprecated":true,"responses":{"201":{"description":"Package submitted"}}}},"/v1/tooling/marketplace/skills/publish":{"post":{"operationId":"publishToolingSkill","summary":"Publish skill package (review-gated)","tags":["tooling-marketplace"],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Package submitted"}}}},"/v1/tooling/marketplace/skills":{"get":{"operationId":"listToolingSkills","summary":"List marketplace skill packages","tags":["tooling-marketplace"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Skill packages"}}}},"/v1/tooling/marketplace/install":{"post":{"operationId":"installToolingSkill","summary":"Install approved skill package with version pin","tags":["tooling-marketplace"],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Installed"}}}},"/v1/tooling/marketplace/rollback":{"post":{"operationId":"rollbackToolingSkill","summary":"Rollback latest installed skill version","tags":["tooling-marketplace"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Rollback applied"}}}},"/v1/primitives/portrait_gpt2":{"post":{"operationId":"runPortraitGpt2","summary":"Submit one realistic portrait generation via the vNext primitive runtime","tags":["vnext-primitives"],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Workflow submitted"},"400":{"description":"Invalid input"},"401":{"description":"Unauthorized"},"502":{"description":"Temporal dispatch failed"},"503":{"description":"Temporal not configured"}}}},"/v1/primitives/character_sheet_gpt2":{"post":{"operationId":"runCharacterSheetGpt2","summary":"Submit a character-sheet generation from an R2-hosted portrait","tags":["vnext-primitives"],"security":[{"bearerAuth":[]}],"responses":{"202":{"description":"Workflow submitted"},"400":{"description":"Invalid input"},"401":{"description":"Unauthorized"}}}},"/v1/primitives/runs/{run_id}":{"get":{"operationId":"getPrimitiveRun","summary":"Get vNext primitive run status + artifacts","tags":["vnext-primitives"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Run details"},"404":{"description":"Not found"}}}},"/v1/skills":{"get":{"operationId":"listVnextSkills","summary":"List registered vNext micro-skills with their input schemas","tags":["vnext-skills"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Skill list"}}}},"/v1/me/readiness":{"get":{"operationId":"getAccountReadiness","summary":"Read authenticated account and credit readiness without spending or refilling credits","tags":["account"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Balance snapshot and next step; no credits reserved or provider health guarantee"},"401":{"description":"Reconnect to authenticate"},"503":{"description":"Balance unknown; retry instead of treating it as zero"}}}},"/v1/me/gallery":{"get":{"operationId":"getMyGallery","summary":"List the user's recent generations (legacy + vNext, merged)","tags":["vnext-skills"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":40,"maximum":100}}],"responses":{"200":{"description":"Recent generations"}}}},"/v1/characters":{"get":{"operationId":"listMyCharacters","summary":"List the user's saved, reusable characters (with image URLs)","tags":["vnext-skills"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"maximum":100}}],"responses":{"200":{"description":"Saved characters with character_sheet_url + thumbnails"}}}},"/v1/skills/runs/{skill_run_id}":{"get":{"operationId":"getSkillRun","summary":"Get composed-skill run status + per-step artifacts","tags":["vnext-skills"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"skill_run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Composed skill run"},"404":{"description":"Not found"}}}},"/v1/skills/{slug}/run":{"post":{"operationId":"runVnextSkill","summary":"Run a vNext micro-skill (e.g. make_portrait, make_character_sheet)","tags":["vnext-skills"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"202":{"description":"Workflow submitted"},"400":{"description":"Invalid input"},"404":{"description":"Unknown skill"}}}},"/v2/generate/video":{"post":{"operationId":"generate_video","summary":"Render a video from your prompt on the model you choose (or \"auto\"). Credits are deducted at submit; poll GET /v1/videos/{job_id}.","tags":["loose-surface"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Persist one identity per intended generation. Retry identical inputs with the same key to recover the original job without another debit. A new key means a new paid generation.","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":3,"maxLength":4000,"description":"The shot, as a director would say it: who (age, look), where (setting, light), what happens, camera (phone framing), and, if anyone speaks, the exact words in quotes. About 2.3 words per second. With references, address them as @image1, @video1, @audio1."},"model":{"type":"string","description":"A live video model id from list_models, or \"auto\" to let agent-media pick from recent results. Omit for the default. Call list_models for what each model is good for, its modes, limits and price."},"first_frame":{"type":"string","format":"uri","description":"IMAGE-TO-VIDEO: an https image that becomes frame one of the clip (a still you want animated, a product shot, a portrait). Cannot be combined with refs, video_refs or audio_refs on Seedance."},"last_frame":{"type":"string","format":"uri","description":"Optional with first_frame: the image the clip ends on; the model animates from first to last."},"refs":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":30,"description":"REFERENCE-TO-VIDEO: image references (https URLs): a portrait, a character sheet from list_characters, a product photo. The model keeps that identity/look. Address them in the prompt as @image1, @image2..."},"video_refs":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"description":"Reference clips (https mp4/mov) whose motion, framing or look the model should follow; @video1... in the prompt. Their seconds are billed like output seconds."},"audio_refs":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"description":"Reference audio (https wav/mp3): a voice or a sound the clip should carry; @audio1... in the prompt."},"seconds":{"type":"integer","minimum":1,"maximum":60,"default":5,"description":"Clip length in seconds (the model sets the range; seedance 2.0: 4 to 15, seedance 2.5: 4 to 30). Credits = seconds x the per-second rate at the chosen quality."},"aspect":{"type":"string","enum":["9:16","16:9","1:1","4:3","3:4","3:2","2:3","21:9","adaptive"],"description":"9:16 (default for text and reference), 16:9, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9, or adaptive (follows the first frame or reference; the default and the only option in image mode on seedance-2.5)."},"quality":{"type":"string","enum":["480p","720p","1080p","4k"],"description":"One of 480p, 720p, 1080p, 4k where the selected model supports it. Omit for the model default. Price per second differs; see list_models."},"audio":{"type":"boolean","default":true,"description":"Render native audio when the model supports an audio toggle (speech from the quoted words, ambience). false = silent clip on models that support silence."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Only for models whose mode lists seed support (none of the live Seedance modes). Refused elsewhere."},"voiceover":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":1000,"description":"Every word the person says, nothing else."},"language":{"type":"string","pattern":"^[a-z]{2}$","description":"ISO 639-1 code of the words (he for Hebrew). Omit to take it from the letters."},"voice":{"type":"string","minLength":1,"maxLength":64,"description":"sulafat (female) or achird (male) for the Gemini voice, or an ElevenLabs stock voice name (sarah, roger, ...). Omit to match the speaker: the gender field, the prompt, or the person in the image. A cloned voice cannot speak Hebrew: the Gemini voice of the same gender speaks instead."},"gender":{"type":"string","enum":["female","male"],"description":"Who speaks, when no voice is named."}},"required":["text"],"additionalProperties":false,"description":"Speech in a language the video models cannot speak (Hebrew): the line is spoken by Gemini TTS and a front-facing still (first_frame, or a keyframe made from the prompt and refs) is lip-synced to it by OmniHuman 1.5. Hebrew lines in quotes get this automatically. 9:16 or 1:1, up to 35 s; not with video_refs or audio_refs. Priced as the voice + the keyframe (when there is no first_frame) + the lip-sync seconds, not the model's per-second rate."},"captions":{"type":"string","enum":["hormozi","minimal","bold","karaoke","clean","tiktok","neon","fire","glow","pop","aesthetic","impact","pastel","electric","boxed","gradient","spotlight"],"description":"Optional: burn word-timed captions in this style into the finished clip (a second step after the render, the subtitle price added). Leave out for no captions."}},"required":["prompt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Existing job recovered; credits_deducted is zero and replayed is true"},"201":{"description":"Job submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LooseSubmitted"}}}},"202":{"description":"Job and debit saved; worker acknowledgement uncertain. Poll the returned job_id, do not create a new request."},"400":{"description":"Validation error (unknown field, non-live model — the message lists the live ones)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"409":{"description":"Idempotency key already used with different inputs"},"429":{"description":"Too many active jobs or rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Submission or dispatch could not be confirmed; preserve request_id and job_id when returned. Refund status is explicit when known."}}}},"/v2/quote/video":{"post":{"operationId":"quote_video","summary":"Price a generate_video call without running it (resolves \"auto\").","tags":["loose-surface"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":3,"maxLength":4000,"description":"The shot, as a director would say it: who (age, look), where (setting, light), what happens, camera (phone framing), and, if anyone speaks, the exact words in quotes. About 2.3 words per second. With references, address them as @image1, @video1, @audio1."},"model":{"type":"string","description":"A live video model id from list_models, or \"auto\" to let agent-media pick from recent results. Omit for the default. Call list_models for what each model is good for, its modes, limits and price."},"first_frame":{"type":"string","format":"uri","description":"IMAGE-TO-VIDEO: an https image that becomes frame one of the clip (a still you want animated, a product shot, a portrait). Cannot be combined with refs, video_refs or audio_refs on Seedance."},"last_frame":{"type":"string","format":"uri","description":"Optional with first_frame: the image the clip ends on; the model animates from first to last."},"refs":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":30,"description":"REFERENCE-TO-VIDEO: image references (https URLs): a portrait, a character sheet from list_characters, a product photo. The model keeps that identity/look. Address them in the prompt as @image1, @image2..."},"video_refs":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"description":"Reference clips (https mp4/mov) whose motion, framing or look the model should follow; @video1... in the prompt. Their seconds are billed like output seconds."},"audio_refs":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10,"description":"Reference audio (https wav/mp3): a voice or a sound the clip should carry; @audio1... in the prompt."},"seconds":{"type":"integer","minimum":1,"maximum":60,"default":5,"description":"Clip length in seconds (the model sets the range; seedance 2.0: 4 to 15, seedance 2.5: 4 to 30). Credits = seconds x the per-second rate at the chosen quality."},"aspect":{"type":"string","enum":["9:16","16:9","1:1","4:3","3:4","3:2","2:3","21:9","adaptive"],"description":"9:16 (default for text and reference), 16:9, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9, or adaptive (follows the first frame or reference; the default and the only option in image mode on seedance-2.5)."},"quality":{"type":"string","enum":["480p","720p","1080p","4k"],"description":"One of 480p, 720p, 1080p, 4k where the selected model supports it. Omit for the model default. Price per second differs; see list_models."},"audio":{"type":"boolean","default":true,"description":"Render native audio when the model supports an audio toggle (speech from the quoted words, ambience). false = silent clip on models that support silence."},"seed":{"type":"integer","minimum":0,"maximum":2147483647,"description":"Only for models whose mode lists seed support (none of the live Seedance modes). Refused elsewhere."},"voiceover":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":1000,"description":"Every word the person says, nothing else."},"language":{"type":"string","pattern":"^[a-z]{2}$","description":"ISO 639-1 code of the words (he for Hebrew). Omit to take it from the letters."},"voice":{"type":"string","minLength":1,"maxLength":64,"description":"sulafat (female) or achird (male) for the Gemini voice, or an ElevenLabs stock voice name (sarah, roger, ...). Omit to match the speaker: the gender field, the prompt, or the person in the image. A cloned voice cannot speak Hebrew: the Gemini voice of the same gender speaks instead."},"gender":{"type":"string","enum":["female","male"],"description":"Who speaks, when no voice is named."}},"required":["text"],"additionalProperties":false,"description":"Speech in a language the video models cannot speak (Hebrew): the line is spoken by Gemini TTS and a front-facing still (first_frame, or a keyframe made from the prompt and refs) is lip-synced to it by OmniHuman 1.5. Hebrew lines in quotes get this automatically. 9:16 or 1:1, up to 35 s; not with video_refs or audio_refs. Priced as the voice + the keyframe (when there is no first_frame) + the lip-sync seconds, not the model's per-second rate."},"captions":{"type":"string","enum":["hormozi","minimal","bold","karaoke","clean","tiktok","neon","fire","glow","pop","aesthetic","impact","pastel","electric","boxed","gradient","spotlight"],"description":"Optional: burn word-timed captions in this style into the finished clip (a second step after the render, the subtitle price added). Leave out for no captions."}},"required":["prompt"],"additionalProperties":false}}}},"responses":{"200":{"description":"The quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LooseQuote"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v2/generate/image":{"post":{"operationId":"generate_image","summary":"Render a image from your prompt on the model you choose (or \"auto\"). Credits are deducted at submit; poll GET /v1/videos/{job_id}.","tags":["loose-surface"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Persist one identity per intended generation. Retry identical inputs with the same key to recover the original job without another debit. A new key means a new paid generation.","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":3,"maxLength":4000,"description":"What to paint. Be concrete: subject, age, framing, light, lens, mood, what the hands do."},"model":{"type":"string","description":"A live image model id from list_models, or \"auto\" to let agent-media pick from recent results. Omit for the default (gpt-image-2.5)."},"refs":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":4,"description":"Reference images (https URLs, up to 4). With refs the model EDITS/composes from them (a product into a hand, a portrait re-lit); without, it paints from the prompt alone."},"size":{"type":"string","enum":["1024x1024","1024x1536","1536x1024"],"default":"1024x1536","description":"1024x1536 portrait (default, for 9:16 video), 1024x1024 square, 1536x1024 landscape."}},"required":["prompt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Existing job recovered; credits_deducted is zero and replayed is true"},"201":{"description":"Job submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LooseSubmitted"}}}},"202":{"description":"Job and debit saved; worker acknowledgement uncertain. Poll the returned job_id, do not create a new request."},"400":{"description":"Validation error (unknown field, non-live model — the message lists the live ones)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"409":{"description":"Idempotency key already used with different inputs"},"429":{"description":"Too many active jobs or rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Submission or dispatch could not be confirmed; preserve request_id and job_id when returned. Refund status is explicit when known."}}}},"/v2/quote/image":{"post":{"operationId":"quote_image","summary":"Price a generate_image call without running it (resolves \"auto\").","tags":["loose-surface"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":3,"maxLength":4000,"description":"What to paint. Be concrete: subject, age, framing, light, lens, mood, what the hands do."},"model":{"type":"string","description":"A live image model id from list_models, or \"auto\" to let agent-media pick from recent results. Omit for the default (gpt-image-2.5)."},"refs":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":4,"description":"Reference images (https URLs, up to 4). With refs the model EDITS/composes from them (a product into a hand, a portrait re-lit); without, it paints from the prompt alone."},"size":{"type":"string","enum":["1024x1024","1024x1536","1536x1024"],"default":"1024x1536","description":"1024x1536 portrait (default, for 9:16 video), 1024x1024 square, 1536x1024 landscape."}},"required":["prompt"],"additionalProperties":false}}}},"responses":{"200":{"description":"The quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LooseQuote"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v2/generate/audio":{"post":{"operationId":"generate_audio","summary":"Render speech from your prompt on the model you choose (or \"auto\"). Credits are deducted at submit; poll GET /v1/videos/{job_id}.","tags":["loose-surface"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Persist one identity per intended generation. Retry identical inputs with the same key to recover the original job without another debit. A new key means a new paid generation.","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":4000,"description":"Required for TTS; forbidden for elevenlabs-sts. The words to speak. Emotion tags like [excited] or [whispers] are honoured."},"model":{"type":"string","description":"A live audio model id from list_models, or \"auto\". Omit for the default (elevenlabs-tts)."},"voice":{"type":"string","minLength":1,"description":"Stock voice name or raw ElevenLabs voice id. Required for STS; TTS defaults to sarah. TTS cloned voices cannot speak Hebrew: a stock voice of the same gender speaks a Hebrew line."},"tone":{"type":"string","enum":["energetic","calm","confident","dramatic"],"description":"energetic | calm | confident | dramatic."},"audio_url":{"type":"string","format":"uri","description":"Required only for elevenlabs-sts: public audio URL, at most 15 seconds. Duration is measured by the server."},"stability":{"type":"number","minimum":0,"maximum":1,"description":"STS only: voice stability, 0..1."},"similarity_boost":{"type":"number","minimum":0,"maximum":1,"description":"STS only: voice similarity, 0..1."},"style":{"type":"number","minimum":0,"maximum":1,"description":"STS only: style exaggeration, 0..1."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"STS only: best-effort deterministic seed."},"remove_background_noise":{"type":"boolean","description":"STS only: remove background noise from the input."}},"additionalProperties":false}}}},"responses":{"200":{"description":"Existing job recovered; credits_deducted is zero and replayed is true"},"201":{"description":"Job submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LooseSubmitted"}}}},"202":{"description":"Job and debit saved; worker acknowledgement uncertain. Poll the returned job_id, do not create a new request."},"400":{"description":"Validation error (unknown field, non-live model — the message lists the live ones)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"409":{"description":"Idempotency key already used with different inputs"},"429":{"description":"Too many active jobs or rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Submission or dispatch could not be confirmed; preserve request_id and job_id when returned. Refund status is explicit when known."}}}},"/v2/quote/audio":{"post":{"operationId":"quote_audio","summary":"Price a generate_audio call without running it (resolves \"auto\").","tags":["loose-surface"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":4000,"description":"Required for TTS; forbidden for elevenlabs-sts. The words to speak. Emotion tags like [excited] or [whispers] are honoured."},"model":{"type":"string","description":"A live audio model id from list_models, or \"auto\". Omit for the default (elevenlabs-tts)."},"voice":{"type":"string","minLength":1,"description":"Stock voice name or raw ElevenLabs voice id. Required for STS; TTS defaults to sarah. TTS cloned voices cannot speak Hebrew: a stock voice of the same gender speaks a Hebrew line."},"tone":{"type":"string","enum":["energetic","calm","confident","dramatic"],"description":"energetic | calm | confident | dramatic."},"audio_url":{"type":"string","format":"uri","description":"Required only for elevenlabs-sts: public audio URL, at most 15 seconds. Duration is measured by the server."},"stability":{"type":"number","minimum":0,"maximum":1,"description":"STS only: voice stability, 0..1."},"similarity_boost":{"type":"number","minimum":0,"maximum":1,"description":"STS only: voice similarity, 0..1."},"style":{"type":"number","minimum":0,"maximum":1,"description":"STS only: style exaggeration, 0..1."},"seed":{"type":"integer","minimum":0,"maximum":4294967295,"description":"STS only: best-effort deterministic seed."},"remove_background_noise":{"type":"boolean","description":"STS only: remove background noise from the input."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LooseQuote"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models":{"get":{"operationId":"listModels","summary":"The model catalog: live models with price, limits, best/avoid-for, recent 30-day results, and the auto policy. Public, no key.","tags":["loose-surface"],"parameters":[{"name":"include","in":"query","schema":{"type":"string","enum":["candidates"]},"description":"Also return planned models (no price, not selectable)."}],"responses":{"200":{"description":"Catalog","content":{"application/json":{"schema":{"type":"object","properties":{"models":{"type":"array","items":{"type":"object"}},"defaults":{"type":"object"},"auto_policy":{"type":"string"}}}}}}}}},"/v1/runs/{job_id}/rate":{"post":{"operationId":"rateRun","summary":"Rate a finished loose-surface run 1–5 with an optional note. Feeds per-model stats and model:\"auto\".","tags":["loose-surface"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["score"],"properties":{"score":{"type":"integer","minimum":1,"maximum":5},"note":{"type":"string","maxLength":1000}}}}}},"responses":{"200":{"description":"Recorded"},"404":{"description":"No such run on this account"},"409":{"description":"Run not finished yet"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key (ma_xxx) or Supabase JWT"}},"schemas":{"LooseSubmitted":{"type":"object","properties":{"job_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["submitted"]},"kind":{"type":"string","enum":["video","image","audio"]},"model":{"type":"string"},"credits_deducted":{"type":"integer"},"breakdown":{"type":"string"},"auto":{"type":"object","properties":{"model":{"type":"string"},"reason":{"type":"string"}}},"status_url":{"type":"string"}}},"LooseQuote":{"type":"object","properties":{"kind":{"type":"string"},"model":{"type":"string"},"credits":{"type":"integer"},"usd":{"type":"number"},"breakdown":{"type":"string"},"auto":{"type":"object","properties":{"model":{"type":"string"},"reason":{"type":"string"}}}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}},"required":["code","message"]}},"required":["error"]},"InsufficientCredits":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"},"credits_required":{"type":"integer"},"credits_available":{"type":"integer"}},"required":["error","credits_required","credits_available"]},"JobSubmitted":{"type":"object","properties":{"job_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["submitted"]},"estimated_duration":{"type":"integer"},"credits_deducted":{"type":"integer"},"selected_voice":{"type":"string"},"voice_auto_detected":{"type":"boolean"},"word_count":{"type":"integer"},"pacing_warning":{"type":"string","nullable":true}},"required":["job_id","status"]},"JobStatus":{"type":"object","properties":{"job_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["submitted","processing","completed","failed"]},"progress":{"type":"object"},"video_url":{"type":"string","format":"uri","nullable":true},"error_message":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["job_id","status"]},"Actor":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"gender":{"type":"string","enum":["female","male"]},"age":{"type":"integer"},"age_range":{"type":"string"},"nationality":{"type":"string"},"actor_type":{"type":"string"},"style":{"type":"string","description":"On-camera style descriptor."},"portrait_url":{"type":"string","format":"uri"},"green_screen_url":{"type":"string","format":"uri","nullable":true},"voice_id":{"type":"string","description":"ElevenLabs voice id used by default for this actor."},"voice_gender":{"type":"string"},"lip_sync_engine":{"type":"string"},"preset":{"type":"string","nullable":true},"presets":{"type":"array","items":{"type":"string"}},"bio_occupation":{"type":"string"},"bio_story":{"type":"string"},"bio_hobbies":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","slug","name","portrait_url","gender"]},"ActorList":{"type":"object","properties":{"actors":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["actors","total","limit","offset"]},"ActorSingle":{"type":"object","properties":{"actor":{"$ref":"#/components/schemas/Actor"}},"required":["actor"]}}}}