[{"data":1,"prerenderedAt":219},["ShallowReactive",2],{"reference-detail-create_ai_video_api_v1_ai_video_post":3,"developer-code-dqq392":217,"developer-code-97j9hq":218},{"tag":4,"sourceTag":5,"tagSlug":6,"method":7,"path":8,"slug":9,"summary":10,"description":11,"operationId":12,"groupOrder":13,"descriptionHtml":14,"parameters":15,"requestBody":23,"responses":139,"security":207,"codeSamples":210},"AI Video","AI Videos","ai-videos","POST","\u002Fapi\u002Fv1\u002Fai_video","create-ai-video","Generate AI video","Generate a video with a frontier AI model. Provide `first_frame` (optionally `end_frame`) for\nimage-to-video, `refs` for multimodal text-to-video, or neither for pure text-to-video. Credits are\ncharged on submission and refunded automatically if generation fails; poll GET \u002Fapi\u002Fv1\u002Fai_video for\nprogress.\n\nBeta: available to allowlisted API keys. Per-key concurrency is limited during beta; submissions\nbeyond the limit are rejected rather than queued.","create_ai_video_api_v1_ai_video_post",60,"\u003Cp>Generate a video with a frontier AI model. Provide \u003Ccode>first_frame\u003C\u002Fcode> (optionally \u003Ccode>end_frame\u003C\u002Fcode>) for image-to-video, \u003Ccode>refs\u003C\u002Fcode> for multimodal text-to-video, or neither for pure text-to-video. Credits are charged on submission and refunded automatically if generation fails; poll GET \u002Fapi\u002Fv1\u002Fai_video for progress.\u003C\u002Fp>\u003Cp>Beta: available to allowlisted API keys. Per-key concurrency is limited during beta; submissions beyond the limit are rejected rather than queued.\u003C\u002Fp>",[16],{"name":17,"in":18,"required":19,"description":20,"type":21,"example":22},"X-API-Key","header",true,"Your VisionStory API key (`sk-vs-...`), kept server-side. Create or manage keys in [API keys](\u002Fapi-keys) (Pro plan and up).","string","sk-vs-your-api-key",{"required":19,"contentType":24,"schema":25,"example":135},"application\u002Fjson",{"type":26,"description":27,"nullable":28,"properties":29},"CreateAiVideoRequest","",false,[30,41,45,50,76,90,96,105,109,128],{"name":31,"required":28,"type":32,"description":33,"nullable":19,"enum":34,"properties":40},"aspect_ratio","string | null","Controls the output frame shape. Text-to-video defaults to `9:16` for 2.5 \u002F 2.0 \u002F fast and `16:9` for mini. Image-to-video defaults to `16:9` for every model.",[35,36,37,38,39],"16:9","9:16","4:3","3:4","1:1",[],{"name":42,"required":28,"type":32,"description":43,"nullable":19,"properties":44},"client_request_id","Optional idempotency key. Resubmitting with the same value within 24h returns the original task instead of creating (and charging) a new one. Safe for retries.",[],{"name":46,"required":28,"type":47,"description":48,"nullable":19,"properties":49},"duration_sec","integer | null","`seedance-2.5`: any whole second from 4–30 (default 15). All `seedance-2.0` variants: any whole second from 4–15 (default 5). Longer clips cost more credits.",[],{"name":51,"required":28,"type":52,"description":53,"nullable":19,"properties":54},"end_frame","MediaRef | null","Optional last-frame image with the same limits as `first_frame`. Requires `first_frame`.",[55,59,72],{"name":56,"required":28,"type":32,"description":57,"nullable":19,"properties":58},"asset_id","Asset ID from POST \u002Fapi\u002Fv1\u002Fasset; use for materials reused across requests.",[],{"name":60,"required":28,"type":61,"description":62,"nullable":19,"properties":63},"inline_data","InlineDataModel | null","Inline base64 media data for one-off use; not added to your asset library.",[64,68],{"name":65,"required":19,"type":21,"description":66,"nullable":28,"properties":67},"data","The file's raw bytes encoded as a base64 string (no `data:` URI prefix).",[],{"name":69,"required":19,"type":21,"description":70,"nullable":28,"properties":71},"mime_type","MIME type of the inline data, used to detect image vs audio. Audio: ['audio\u002Favi', 'audio\u002Fmpeg', 'audio\u002Fmp3', 'audio\u002Fmp4', 'audio\u002Fm4a', 'audio\u002Fwav']; images: ['image\u002Fjpeg', 'image\u002Fjpg', 'image\u002Fpng', 'image\u002Fwebp', 'image\u002Fheic'].",[],{"name":73,"required":28,"type":32,"description":74,"nullable":19,"properties":75},"url","Publicly accessible media URL for one-off use; not added to your asset library.",[],{"name":77,"required":28,"type":52,"description":78,"nullable":19,"properties":79},"first_frame","First-frame image for image-to-video. Accepts JPEG, PNG, WebP, BMP, TIFF, or GIF up to 30 MB, 300–6000 px per side, and aspect ratio 1:2.5–2.5:1. Mutually exclusive with `refs`.",[80,82,88],{"name":56,"required":28,"type":32,"description":57,"nullable":19,"properties":81},[],{"name":60,"required":28,"type":61,"description":62,"nullable":19,"properties":83},[84,86],{"name":65,"required":19,"type":21,"description":66,"nullable":28,"properties":85},[],{"name":69,"required":19,"type":21,"description":70,"nullable":28,"properties":87},[],{"name":73,"required":28,"type":32,"description":74,"nullable":19,"properties":89},[],{"name":91,"required":28,"type":92,"description":93,"nullable":19,"enum":94,"default":19,"properties":95},"generate_audio","boolean | null","Controls whether the generated video includes a native audio track.",[19,28],[],{"name":97,"required":19,"type":21,"description":98,"nullable":28,"enum":99,"properties":104},"model_id","Choose the generation model. The values below are the currently supported IDs; query `GET \u002Fapi\u002Fv1\u002Fai_video\u002Fmodels` for the latest availability.",[100,101,102,103],"seedance-2.5","seedance-2.0","seedance-2.0-fast","seedance-2.0-mini",[],{"name":106,"required":19,"type":21,"description":107,"nullable":28,"properties":108},"prompt","Describe the video or, when `first_frame` is present, the motion to apply. Length: 1–2500 characters.",[],{"name":110,"required":28,"type":111,"description":112,"nullable":19,"properties":113,"items":114},"refs","MediaRef[] | null","Up to 9 reference images, videos, or audio files for text-to-video. Image: ≤30 MB. Video: MP4\u002FMOV, ≤100 MB, 2–15 s, 24–60 fps. Audio: WAV\u002FMP3, ≤15 MB, 2–15 s and cannot be the only reference. Mutually exclusive with `first_frame`.",[],{"type":115,"description":116,"nullable":28,"properties":117},"MediaRef","A media reference — provide exactly one of: `asset_id` (from the asset library, reusable across\nrequests), `url` (one-off public URL), or `inline_data` (one-off base64, not stored).",[118,120,126],{"name":56,"required":28,"type":32,"description":57,"nullable":19,"properties":119},[],{"name":60,"required":28,"type":61,"description":62,"nullable":19,"properties":121},[122,124],{"name":65,"required":19,"type":21,"description":66,"nullable":28,"properties":123},[],{"name":69,"required":19,"type":21,"description":70,"nullable":28,"properties":125},[],{"name":73,"required":28,"type":32,"description":74,"nullable":19,"properties":127},[],{"name":129,"required":28,"type":32,"description":130,"nullable":19,"enum":131,"default":132,"properties":134},"resolution","`1080p` is available only on `seedance-2.0`. Higher resolution costs more credits.",[132,133],"720p","1080p",[],{"model_id":101,"prompt":136,"duration_sec":137,"aspect_ratio":36,"resolution":133,"generate_audio":19,"client_request_id":138},"A corgi surfing at sunset, cinematic lighting",8,"request_20260824_001",[140,179],{"status":141,"description":142,"contentType":24,"schema":143,"example":175},"200","Successful Response",{"type":144,"description":27,"nullable":28,"properties":145},"BaseSuccessResponse_CreateAiVideoResponse_",[146,165,170],{"name":65,"required":19,"type":147,"description":148,"nullable":19,"properties":149},"CreateAiVideoResponse | null","The endpoint payload. Its shape is specific to each endpoint (see that endpoint's response schema); null for operations that return no body, such as delete.",[150,156,161],{"name":151,"required":28,"type":152,"description":153,"nullable":28,"default":154,"properties":155},"cost_credit","integer","Credits charged for this task on submission; auto-refunded if generation fails.",0,[],{"name":157,"required":28,"type":21,"description":158,"nullable":28,"default":159,"properties":160},"status","Initial task status; always `queued` right after creation.","queued",[],{"name":162,"required":19,"type":21,"description":163,"nullable":28,"properties":164},"video_id","Identifier of the created task. Poll GET \u002Fapi\u002Fv1\u002Fai_video with it to track progress.",[],{"name":166,"required":28,"type":21,"description":167,"nullable":28,"default":168,"properties":169},"message","Human-readable status message; `\"success\"` on a successful call.","success",[],{"name":171,"required":19,"type":172,"description":173,"nullable":28,"properties":174},"server_time","string · date-time","Server-side timestamp when the response was produced, in ISO 8601 format (UTC).",[],{"data":176,"server_time":178,"message":168},{"video_id":177,"cost_credit":154,"status":159},"video_123456","2026-08-24T08:00:00Z",{"status":180,"description":181,"contentType":24,"schema":182,"example":204},"default","Error response. All failures share one envelope: an `error` object with a numeric `code`, a human-readable `message`, an optional `details` string, and an optional `hint` giving an actionable next step (useful for AI agents).",{"type":183,"description":27,"nullable":28,"properties":184},"ErrorResponse",[185],{"name":186,"required":19,"type":187,"description":27,"nullable":28,"properties":188},"error","ErrorDetail",[189,193,197,201],{"name":190,"required":19,"type":152,"description":191,"nullable":28,"properties":192},"code","Machine-readable error code. Mirrors the HTTP status for transport-level failures (e.g. 401, 404, 422, 500) and may carry a business-specific code otherwise.",[],{"name":194,"required":28,"type":32,"description":195,"nullable":19,"properties":196},"details","Optional structured detail about the failure, e.g. a JSON string of per-field validation errors on a 422. Absent when there is nothing extra to report.",[],{"name":198,"required":28,"type":32,"description":199,"nullable":19,"properties":200},"hint","Actionable next step for resolving the error, written for both humans and AI agents (e.g. how to fix the request, or where to obtain an API key). May be absent.",[],{"name":166,"required":19,"type":21,"description":202,"nullable":28,"properties":203},"Human-readable explanation of what went wrong. Safe to log or surface to end users; not localized.",[],{"error":205},{"code":206,"message":21,"details":21,"hint":21},1,[208],{"APIKeyHeader":209},[],[211,214],{"lang":212,"source":213},"Python","import os\nimport requests\n\nresponse = requests.post(\n    \"https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Fai_video\",\n    headers={\"X-API-Key\": os.environ[\"VISIONSTORY_API_KEY\"]},\n    json={\n      \"model_id\": \"seedance-2.0\",\n      \"prompt\": \"A corgi surfing at sunset, cinematic lighting\",\n      \"duration_sec\": 8,\n      \"aspect_ratio\": \"9:16\",\n      \"resolution\": \"1080p\",\n      \"generate_audio\": true,\n      \"client_request_id\": \"request_20260824_001\"\n    },\n)\nresponse.raise_for_status()\nprint(response.json())",{"lang":215,"source":216},"cURL","curl --request POST 'https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Fai_video' \\\n  --header 'X-API-Key: $VISIONSTORY_API_KEY' \\\n  --header 'Content-Type: application\u002Fjson' \\\n  --data '{\n  \"model_id\": \"seedance-2.0\",\n  \"prompt\": \"A corgi surfing at sunset, cinematic lighting\",\n  \"duration_sec\": 8,\n  \"aspect_ratio\": \"9:16\",\n  \"resolution\": \"1080p\",\n  \"generate_audio\": true,\n  \"client_request_id\": \"request_20260824_001\"\n}'","\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#FF7B72\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> os\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#FF7B72\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> requests\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">response \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> requests.post(\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#A5D6FF\">    \"https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Fai_video\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#FFA657\">    headers\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">{\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"X-API-Key\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: os.environ[\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"VISIONSTORY_API_KEY\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">]},\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#FFA657\">    json\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#A5D6FF\">      \"model_id\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"seedance-2.0\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#A5D6FF\">      \"prompt\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"A corgi surfing at sunset, cinematic lighting\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#A5D6FF\">      \"duration_sec\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">8\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#A5D6FF\">      \"aspect_ratio\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"9:16\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#A5D6FF\">      \"resolution\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"1080p\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#A5D6FF\">      \"generate_audio\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: true,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#A5D6FF\">      \"client_request_id\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"request_20260824_001\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">    },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">response.raise_for_status()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#79C0FF\">print\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(response.json())\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">{\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">  \"data\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">    \"video_id\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"video_123456\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">    \"cost_credit\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">0\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">    \"status\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"queued\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">  },\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">  \"server_time\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"2026-08-24T08:00:00Z\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">  \"message\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"success\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",1788166855865]