[{"data":1,"prerenderedAt":182},["ShallowReactive",2],{"reference-detail-create_image_api_v1_image_post":3,"developer-code-198pxew":180,"developer-code-punkkr":181},{"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":97,"security":170,"codeSamples":173},"Image Generation","Images","images","POST","\u002Fapi\u002Fv1\u002Fimage","create-image","Create Image","Generate an image from a text prompt, optionally guided by up to 4 reference images\n(asset_id \u002F url \u002F inline_data). Editing works through instructions in the prompt plus reference\nimages — no mask needed. Synchronous: the response contains the image URL directly, and you can\npass that URL straight into other endpoints (video `refs`, `first_frame`\u002F`end_frame`). It is not added\nto your asset library — use POST \u002Fapi\u002Fv1\u002Fasset if you want to keep it there. Credits are charged\nper image, only on success. Per-key concurrency is limited during beta; requests beyond the limit are rejected, not queued.","create_image_api_v1_image_post",80,"\u003Cp>Generate an image from a text prompt, optionally guided by up to 4 reference images (asset_id \u002F url \u002F inline_data). Editing works through instructions in the prompt plus reference images — no mask needed. Synchronous: the response contains the image URL directly, and you can pass that URL straight into other endpoints (video \u003Ccode>refs\u003C\u002Fcode>, \u003Ccode>first_frame\u003C\u002Fcode>\u002F\u003Ccode>end_frame\u003C\u002Fcode>). It is not added to your asset library — use POST \u002Fapi\u002Fv1\u002Fasset if you want to keep it there. Credits are charged per image, only on success. Per-key concurrency is limited during beta; requests beyond the limit are rejected, not 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":95},"application\u002Fjson",{"type":26,"description":27,"nullable":28,"properties":29},"CreateImageRequest","",false,[30,46,54,58,88],{"name":31,"required":28,"type":32,"description":33,"nullable":19,"enum":34,"default":35,"properties":45},"aspect_ratio","string | null","Output frame shape. Supported values are listed below; defaults to `1:1`.",[35,36,37,38,39,40,41,42,43,44],"1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9",[],{"name":47,"required":19,"type":21,"description":48,"nullable":28,"enum":49,"properties":53},"model_id","Choose an image model. The values below are the currently supported IDs; query `GET \u002Fapi\u002Fv1\u002Fimage\u002Fmodels` for live availability and credit cost.",[50,51,52],"nano-banana","nano-banana-2","nano-banana-pro",[],{"name":55,"required":19,"type":21,"description":56,"nullable":28,"properties":57},"prompt","Describe the image to generate, or the edits to apply when `refs` are present. Length: 1–5000 characters.",[],{"name":59,"required":28,"type":60,"description":61,"nullable":19,"properties":62,"items":63},"refs","MediaRef[] | null","Up to 4 reference images for image editing. Each item must provide exactly one of `asset_id`, `url`, or `inline_data`.",[],{"type":64,"description":65,"nullable":28,"properties":66},"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).",[67,71,84],{"name":68,"required":28,"type":32,"description":69,"nullable":19,"properties":70},"asset_id","Asset ID from POST \u002Fapi\u002Fv1\u002Fasset; use for materials reused across requests.",[],{"name":72,"required":28,"type":73,"description":74,"nullable":19,"properties":75},"inline_data","InlineDataModel | null","Inline base64 media data for one-off use; not added to your asset library.",[76,80],{"name":77,"required":19,"type":21,"description":78,"nullable":28,"properties":79},"data","The file's raw bytes encoded as a base64 string (no `data:` URI prefix).",[],{"name":81,"required":19,"type":21,"description":82,"nullable":28,"properties":83},"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":85,"required":28,"type":32,"description":86,"nullable":19,"properties":87},"url","Publicly accessible media URL for one-off use; not added to your asset library.",[],{"name":89,"required":28,"type":32,"description":90,"nullable":19,"enum":91,"default":92,"properties":94},"resolution","Output resolution tier. `2K` costs more credits; defaults to `1K`.",[92,93],"1K","2K",[],{"model_id":50,"prompt":96,"aspect_ratio":35,"resolution":92},"A red panda barista in a cozy cafe, warm lighting",[98,142],{"status":99,"description":100,"contentType":24,"schema":101,"example":138},"200","Successful Response",{"type":102,"description":27,"nullable":28,"properties":103},"BaseSuccessResponse_CreateImageResponse_",[104,128,133],{"name":77,"required":19,"type":105,"description":106,"nullable":19,"properties":107},"CreateImageResponse | 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.",[108,114,118,121,124],{"name":109,"required":28,"type":110,"description":111,"nullable":28,"default":112,"properties":113},"cost_credit","integer","Credits charged for this image",0,[],{"name":115,"required":28,"type":110,"description":116,"nullable":28,"default":112,"properties":117},"height","Pixel height",[],{"name":47,"required":28,"type":21,"description":119,"nullable":28,"default":27,"properties":120},"Model id used",[],{"name":85,"required":19,"type":21,"description":122,"nullable":28,"properties":123},"CDN URL of the generated PNG; pass it directly as a ref or first\u002Flast frame elsewhere",[],{"name":125,"required":28,"type":110,"description":126,"nullable":28,"default":112,"properties":127},"width","Pixel width",[],{"name":129,"required":28,"type":21,"description":130,"nullable":28,"default":131,"properties":132},"message","Human-readable status message; `\"success\"` on a successful call.","success",[],{"name":134,"required":19,"type":135,"description":136,"nullable":28,"properties":137},"server_time","string · date-time","Server-side timestamp when the response was produced, in ISO 8601 format (UTC).",[],{"data":139,"server_time":141,"message":131},{"url":140,"cost_credit":112,"height":112,"model_id":27,"width":112},"https:\u002F\u002Fexample.com\u002Fmedia\u002Finput.mp4","2026-08-24T08:00:00Z",{"status":143,"description":144,"contentType":24,"schema":145,"example":167},"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":146,"description":27,"nullable":28,"properties":147},"ErrorResponse",[148],{"name":149,"required":19,"type":150,"description":27,"nullable":28,"properties":151},"error","ErrorDetail",[152,156,160,164],{"name":153,"required":19,"type":110,"description":154,"nullable":28,"properties":155},"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":157,"required":28,"type":32,"description":158,"nullable":19,"properties":159},"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":161,"required":28,"type":32,"description":162,"nullable":19,"properties":163},"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":129,"required":19,"type":21,"description":165,"nullable":28,"properties":166},"Human-readable explanation of what went wrong. Safe to log or surface to end users; not localized.",[],{"error":168},{"code":169,"message":21,"details":21,"hint":21},1,[171],{"APIKeyHeader":172},[],[174,177],{"lang":175,"source":176},"Python","import os\nimport requests\n\nresponse = requests.post(\n    \"https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Fimage\",\n    headers={\"X-API-Key\": os.environ[\"VISIONSTORY_API_KEY\"]},\n    json={\n      \"model_id\": \"nano-banana\",\n      \"prompt\": \"A red panda barista in a cozy cafe, warm lighting\",\n      \"aspect_ratio\": \"1:1\",\n      \"resolution\": \"1K\"\n    },\n)\nresponse.raise_for_status()\nprint(response.json())",{"lang":178,"source":179},"cURL","curl --request POST 'https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Fimage' \\\n  --header 'X-API-Key: $VISIONSTORY_API_KEY' \\\n  --header 'Content-Type: application\u002Fjson' \\\n  --data '{\n  \"model_id\": \"nano-banana\",\n  \"prompt\": \"A red panda barista in a cozy cafe, warm lighting\",\n  \"aspect_ratio\": \"1:1\",\n  \"resolution\": \"1K\"\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\u002Fimage\"\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\">\"nano-banana\"\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 red panda barista in a cozy cafe, warm lighting\"\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\">\"1:1\"\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\">\"1K\"\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\">    \"url\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"https:\u002F\u002Fexample.com\u002Fmedia\u002Finput.mp4\"\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\">    \"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\">    \"model_id\"\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]