[{"data":1,"prerenderedAt":160},["ShallowReactive",2],{"reference-detail-en-create_asset_api_v1_asset_post":3,"developer-code-1k9u1i5":158,"developer-code-x5l7mp":159},{"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":145,"codeSamples":148},"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; 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":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,116],{"status":51,"description":52,"contentType":23,"schema":53,"example":101,"examples":109,"headers":115},"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-specific payload. See this endpoint's response schema for its fields; null only when the operation returns no payload.",[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,"message":94,"server_time":108},{"asset_id":103,"created_at":104,"duration_sec":68,"height":105,"kind":106,"mime":107,"width":105},"example_asset_id",1788480000,1024,"image","image\u002Fpng","2026-09-04T00:00:00Z",[110],{"name":94,"description":111,"summary":112,"value":113},"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":114,"message":94,"server_time":108},{"asset_id":103,"created_at":104,"duration_sec":68,"height":105,"kind":106,"mime":107,"width":105},[],{"status":117,"description":118,"contentType":23,"schema":119,"example":141,"headers":144},"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":120,"description":26,"nullable":27,"properties":121},"ErrorResponse",[122],{"name":123,"required":18,"type":124,"description":26,"nullable":27,"properties":125},"error","ErrorDetail",[126,130,134,138],{"name":127,"required":18,"type":66,"description":128,"nullable":27,"properties":129},"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":131,"required":27,"type":44,"description":132,"nullable":18,"properties":133},"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":135,"required":27,"type":44,"description":136,"nullable":18,"properties":137},"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":139,"nullable":27,"properties":140},"Human-readable explanation of what went wrong. Safe to log or surface to end users; not localized.",[],{"error":142},{"code":143,"message":20,"details":20,"hint":20},1,[],[146],{"APIKeyHeader":147},[],[149,152,155],{"lang":150,"source":151},"SDK","from visionstory import VisionStoryClient\n\nclient = VisionStoryClient.from_env()\nasset = client.upload_asset(url=\"https:\u002F\u002Fexample.com\u002Fmedia\u002Freference.jpg\")\nprint(asset)",{"lang":153,"source":154},"REST","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":156,"source":157},"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\">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\">asset \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> client.upload_asset(\u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">url\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"https:\u002F\u002Fexample.com\u002Fmedia\u002Freference.jpg\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#79C0FF\">print\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(asset)\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\">\"example_asset_id\"\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\">1788480000\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\">1024\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\">\"image\"\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\">\"image\u002Fpng\"\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\">1024\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>",1790231924583]