[{"data":1,"prerenderedAt":217},["ShallowReactive",2],{"reference-detail-en-create_ai_video_api_v1_ai_video_post":3,"developer-code-nnra5b":215,"developer-code-2cu7l8":216},{"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":125,"security":202,"codeSamples":205},"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 any account with an active paid subscription. 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 any account with an active paid subscription. 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":118},"application\u002Fjson",{"type":26,"description":27,"nullable":28,"properties":29},"CreateAiVideoRequest","",false,[30,35,39,44,70,83,88,92,96,114],{"name":31,"required":28,"type":32,"description":33,"nullable":19,"properties":34},"aspect_ratio","string | null","Aspect ratio such as `16:9` \u002F `9:16` \u002F `1:1`, or `adaptive` to let the model follow the input material. Allowed values vary by model; defaults to the model default. `wan-3.0` always follows the references when `refs` is set, so passing both is a 400.",[],{"name":36,"required":28,"type":32,"description":37,"nullable":19,"properties":38},"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":40,"required":28,"type":41,"description":42,"nullable":19,"properties":43},"duration_sec","integer | null","Clip length in seconds. Allowed values vary by model (see GET \u002Fapi\u002Fv1\u002Fai_video\u002Fmodels); defaults to the model default. Longer clips cost more credits.",[],{"name":45,"required":28,"type":46,"description":47,"nullable":19,"properties":48},"end_frame","MediaRef | null","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).",[49,53,66],{"name":50,"required":28,"type":32,"description":51,"nullable":19,"properties":52},"asset_id","Asset ID from POST \u002Fapi\u002Fv1\u002Fasset; use for materials reused across requests.",[],{"name":54,"required":28,"type":55,"description":56,"nullable":19,"properties":57},"inline_data","InlineDataModel | null","Inline base64 media data for one-off use; not added to your asset library. Images: image\u002Fjpeg, image\u002Fjpg, image\u002Fpng, image\u002Fwebp, image\u002Fbmp, image\u002Ftiff, image\u002Fgif; audio: audio\u002Fwav, audio\u002Fx-wav, audio\u002Fwave, audio\u002Fmpeg, audio\u002Fmp3; video: video\u002Fmp4, video\u002Fquicktime, video\u002Fmov.",[58,62],{"name":59,"required":19,"type":21,"description":60,"nullable":28,"properties":61},"data","The file's raw bytes encoded as a base64 string (no `data:` URI prefix).",[],{"name":63,"required":19,"type":21,"description":64,"nullable":28,"properties":65},"mime_type","MIME type of the inline data; the gateway uses it to tell image \u002F audio \u002F video apart. The accepted set depends on the endpoint — see the field carrying this object. Talking video accepts audio ['audio\u002Favi', 'audio\u002Fmpeg', 'audio\u002Fmp3', 'audio\u002Fmp4', 'audio\u002Fm4a', 'audio\u002Fwav'] and images ['image\u002Fjpeg', 'image\u002Fjpg', 'image\u002Fpng', 'image\u002Fwebp', 'image\u002Fheic'].",[],{"name":67,"required":28,"type":32,"description":68,"nullable":19,"properties":69},"url","Publicly accessible media URL for one-off use; not added to your asset library.",[],{"name":71,"required":28,"type":46,"description":47,"nullable":19,"properties":72},"first_frame",[73,75,81],{"name":50,"required":28,"type":32,"description":51,"nullable":19,"properties":74},[],{"name":54,"required":28,"type":55,"description":56,"nullable":19,"properties":76},[77,79],{"name":59,"required":19,"type":21,"description":60,"nullable":28,"properties":78},[],{"name":63,"required":19,"type":21,"description":64,"nullable":28,"properties":80},[],{"name":67,"required":28,"type":32,"description":68,"nullable":19,"properties":82},[],{"name":84,"required":28,"type":85,"description":86,"nullable":19,"properties":87},"generate_audio","boolean | null","Whether to generate a native audio track; defaults to true on every model and never changes the price. `kling-3.0-omni` cannot combine it with a video reference (400).",[],{"name":89,"required":19,"type":21,"description":90,"nullable":28,"properties":91},"model_id","Model to generate with. Use an id from GET \u002Fapi\u002Fv1\u002Fai_video\u002Fmodels, e.g. `seedance-2.0`.",[],{"name":93,"required":19,"type":21,"description":94,"nullable":28,"properties":95},"prompt","Text description of the video to generate. For image-to-video it describes the motion applied to `first_frame`.",[],{"name":97,"required":28,"type":98,"description":99,"nullable":19,"properties":100,"items":101},"refs","MediaRef[] | null","Multimodal reference materials (image\u002Fvideo\u002Faudio) that guide text-to-video. Only models whose `refs.max` is greater than 0 in GET \u002Fapi\u002Fv1\u002Fai_video\u002Fmodels accept it; `refs.max_per_kind` and `refs.total_duration_sec_max` there give the per-type limits. References never change the price. Mutually exclusive with `first_frame`.",[],{"type":102,"description":47,"nullable":28,"properties":103},"MediaRef",[104,106,112],{"name":50,"required":28,"type":32,"description":51,"nullable":19,"properties":105},[],{"name":54,"required":28,"type":55,"description":56,"nullable":19,"properties":107},[108,110],{"name":59,"required":19,"type":21,"description":60,"nullable":28,"properties":109},[],{"name":63,"required":19,"type":21,"description":64,"nullable":28,"properties":111},[],{"name":67,"required":28,"type":32,"description":68,"nullable":19,"properties":113},[],{"name":115,"required":28,"type":32,"description":116,"nullable":19,"properties":117},"resolution","Output resolution such as `480p` \u002F `720p` \u002F `1080p` \u002F `4k`. Allowed values vary by model (4K is `kling-3.0` only; 480p is available on every Seedance and Wan model but not on Kling); defaults to the model default — `kling-3.0-omni` is the only model that defaults to 1080p, every other model defaults to 720p. Higher resolutions cost more credits.",[],{"model_id":119,"prompt":120,"duration_sec":121,"aspect_ratio":122,"resolution":123,"generate_audio":19,"client_request_id":124},"seedance-2.0","A corgi surfing at sunset, cinematic lighting",8,"9:16","1080p","request_20260824_001",[126,173],{"status":127,"description":128,"contentType":24,"schema":129,"example":161,"examples":166,"headers":172},"200","Successful Response",{"type":130,"description":27,"nullable":28,"properties":131},"BaseSuccessResponse_CreateAiVideoResponse_",[132,151,156],{"name":59,"required":19,"type":133,"description":134,"nullable":19,"properties":135},"CreateAiVideoResponse | null","The endpoint-specific payload. See this endpoint's response schema for its fields; null only when the operation returns no payload.",[136,142,147],{"name":137,"required":28,"type":138,"description":139,"nullable":28,"default":140,"properties":141},"cost_credit","integer","Credits charged for this task on submission; auto-refunded if generation fails.",0,[],{"name":143,"required":28,"type":21,"description":144,"nullable":28,"default":145,"properties":146},"status","Initial task status; always `queued` right after creation.","queued",[],{"name":148,"required":19,"type":21,"description":149,"nullable":28,"properties":150},"video_id","Identifier of the created task. Poll GET \u002Fapi\u002Fv1\u002Fai_video with it to track progress.",[],{"name":152,"required":28,"type":21,"description":153,"nullable":28,"default":154,"properties":155},"message","Human-readable status message; `\"success\"` on a successful call.","success",[],{"name":157,"required":19,"type":158,"description":159,"nullable":28,"properties":160},"server_time","string · date-time","Server-side timestamp when the response was produced, in ISO 8601 format (UTC).",[],{"data":162,"message":154,"server_time":165},{"cost_credit":163,"status":145,"video_id":164},16,"example_ai_video_id","2026-09-04T00:00:00Z",[167],{"name":154,"description":168,"summary":169,"value":170},"Examples illustrate the response structure, not live account data or a pricing quote. IDs and URLs are placeholders. Query model discovery and cost endpoints for current availability and prices.","Successful response",{"data":171,"message":154,"server_time":165},{"cost_credit":163,"status":145,"video_id":164},[],{"status":174,"description":175,"contentType":24,"schema":176,"example":198,"headers":201},"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":177,"description":27,"nullable":28,"properties":178},"ErrorResponse",[179],{"name":180,"required":19,"type":181,"description":27,"nullable":28,"properties":182},"error","ErrorDetail",[183,187,191,195],{"name":184,"required":19,"type":138,"description":185,"nullable":28,"properties":186},"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":188,"required":28,"type":32,"description":189,"nullable":19,"properties":190},"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":192,"required":28,"type":32,"description":193,"nullable":19,"properties":194},"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":152,"required":19,"type":21,"description":196,"nullable":28,"properties":197},"Human-readable explanation of what went wrong. Safe to log or surface to end users; not localized.",[],{"error":199},{"code":200,"message":21,"details":21,"hint":21},1,[],[203],{"APIKeyHeader":204},[],[206,209,212],{"lang":207,"source":208},"SDK","from visionstory import VisionStoryClient\n\nclient = VisionStoryClient.from_env()\nvideo = client.create_ai_video({\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})\nprint(video)",{"lang":210,"source":211},"REST","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":213,"source":214},"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\">from\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> visionstory \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> VisionStoryClient\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">client \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> VisionStoryClient.from_env()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">video \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> client.create_ai_video({\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\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">True\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\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>\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:#79C0FF\">print\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(video)\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\">    \"cost_credit\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">16\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>\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\">\"example_ai_video_id\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\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>\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-09-04T00:00:00Z\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">}\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",1790231924523]