[{"data":1,"prerenderedAt":145},["ShallowReactive",2],{"reference-detail-create_asset_api_v1_asset_post":3,"developer-code-1snptr2":143,"developer-code-l638to":144},{"tag":4,"sourceTag":4,"tagSlug":5,"method":6,"path":7,"slug":8,"summary":9,"description":10,"operationId":11,"groupOrder":12,"descriptionHtml":13,"parameters":14,"requestBody":22,"responses":49,"security":133,"codeSamples":136},"Assets","assets","POST","\u002Fapi\u002Fv1\u002Fasset","create-asset","Upload asset","Upload a reusable media asset (image \u002F video \u002F audio) from a public URL or inline base64, and get an\n`asset_id` to reference across generation requests. Re-uploading identical content returns the\nexisting asset. Limits: image ≤30MB, audio ≤15MB, video ≤100MB.","create_asset_api_v1_asset_post",90,"\u003Cp>Upload a reusable media asset (image \u002F video \u002F audio) from a public URL or inline base64, and get an \u003Ccode>asset_id\u003C\u002Fcode> to reference across generation requests. Re-uploading identical content returns the existing asset. Limits: image ≤30MB, audio ≤15MB, video ≤100MB.\u003C\u002Fp>",[15],{"name":16,"in":17,"required":18,"description":19,"type":20,"example":21},"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":18,"contentType":23,"schema":24,"example":47},"application\u002Fjson",{"type":25,"description":26,"nullable":27,"properties":28},"CreateAssetRequest","",false,[29,42],{"name":30,"required":27,"type":31,"description":32,"nullable":18,"properties":33},"inline_data","InlineDataModel | null","Media as inline base64 data. Provide either this or `url`.",[34,38],{"name":35,"required":18,"type":20,"description":36,"nullable":27,"properties":37},"data","The file's raw bytes encoded as a base64 string (no `data:` URI prefix).",[],{"name":39,"required":18,"type":20,"description":40,"nullable":27,"properties":41},"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":43,"required":27,"type":44,"description":45,"nullable":18,"properties":46},"url","string | null","Publicly reachable media URL (image\u002Fvideo\u002Faudio). Provide either this or `inline_data`.",[],{"url":48},"https:\u002F\u002Fexample.com\u002Fmedia\u002Freference.jpg",[50,105],{"status":51,"description":52,"contentType":23,"schema":53,"example":101},"200","Successful Response",{"type":54,"description":26,"nullable":27,"properties":55},"BaseSuccessResponse_CreateAssetResponse_",[56,91,96],{"name":35,"required":18,"type":57,"description":58,"nullable":18,"properties":59},"CreateAssetResponse | 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.",[60,64,70,75,79,83,87],{"name":61,"required":18,"type":20,"description":62,"nullable":27,"properties":63},"asset_id","Unique identifier of the asset; reference it as `asset_id` in generation requests.",[],{"name":65,"required":27,"type":66,"description":67,"nullable":27,"default":68,"properties":69},"created_at","integer","Unix timestamp (seconds) when the asset was uploaded.",0,[],{"name":71,"required":27,"type":72,"description":73,"nullable":27,"default":68,"properties":74},"duration_sec","number","Duration in seconds for video\u002Faudio assets; 0 for images.",[],{"name":76,"required":27,"type":66,"description":77,"nullable":27,"default":68,"properties":78},"height","Pixel height for image\u002Fvideo assets; 0 when not applicable.",[],{"name":80,"required":18,"type":20,"description":81,"nullable":27,"properties":82},"kind","Detected media kind: one of `image` \u002F `video` \u002F `audio`.",[],{"name":84,"required":27,"type":20,"description":85,"nullable":27,"default":26,"properties":86},"mime","Detected MIME type of the asset, e.g. `image\u002Fpng`.",[],{"name":88,"required":27,"type":66,"description":89,"nullable":27,"default":68,"properties":90},"width","Pixel width for image\u002Fvideo assets; 0 when not applicable.",[],{"name":92,"required":27,"type":20,"description":93,"nullable":27,"default":94,"properties":95},"message","Human-readable status message; `\"success\"` on a successful call.","success",[],{"name":97,"required":18,"type":98,"description":99,"nullable":27,"properties":100},"server_time","string · date-time","Server-side timestamp when the response was produced, in ISO 8601 format (UTC).",[],{"data":102,"server_time":104,"message":94},{"asset_id":103,"kind":20,"created_at":68,"duration_sec":68,"height":68,"mime":26,"width":68},"asset_123456","2026-08-24T08:00:00Z",{"status":106,"description":107,"contentType":23,"schema":108,"example":130},"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":109,"description":26,"nullable":27,"properties":110},"ErrorResponse",[111],{"name":112,"required":18,"type":113,"description":26,"nullable":27,"properties":114},"error","ErrorDetail",[115,119,123,127],{"name":116,"required":18,"type":66,"description":117,"nullable":27,"properties":118},"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":120,"required":27,"type":44,"description":121,"nullable":18,"properties":122},"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":124,"required":27,"type":44,"description":125,"nullable":18,"properties":126},"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":92,"required":18,"type":20,"description":128,"nullable":27,"properties":129},"Human-readable explanation of what went wrong. Safe to log or surface to end users; not localized.",[],{"error":131},{"code":132,"message":20,"details":20,"hint":20},1,[134],{"APIKeyHeader":135},[],[137,140],{"lang":138,"source":139},"Python","import os\nimport requests\n\nresponse = requests.post(\n    \"https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Fasset\",\n    headers={\"X-API-Key\": os.environ[\"VISIONSTORY_API_KEY\"]},\n    json={\n      \"url\": \"https:\u002F\u002Fexample.com\u002Fmedia\u002Freference.jpg\"\n    },\n)\nresponse.raise_for_status()\nprint(response.json())",{"lang":141,"source":142},"cURL","curl --request POST 'https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Fasset' \\\n  --header 'X-API-Key: $VISIONSTORY_API_KEY' \\\n  --header 'Content-Type: application\u002Fjson' \\\n  --data '{\n  \"url\": \"https:\u002F\u002Fexample.com\u002Fmedia\u002Freference.jpg\"\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\u002Fasset\"\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\">      \"url\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"https:\u002F\u002Fexample.com\u002Fmedia\u002Freference.jpg\"\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\">    \"asset_id\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"asset_123456\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">    \"kind\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"string\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">    \"created_at\"\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\">    \"duration_sec\"\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\">    \"height\"\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\">    \"mime\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">    \"width\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">0\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>",1788166855866]