[{"data":1,"prerenderedAt":114},["ShallowReactive",2],{"reference-detail-get_ai_video_cost_api_v1_ai_video_cost_get":3,"developer-code-qym60z":112,"developer-code-b1r5c2":113},{"tag":4,"sourceTag":5,"tagSlug":6,"method":7,"path":8,"slug":9,"summary":10,"description":11,"operationId":12,"groupOrder":13,"descriptionHtml":14,"parameters":15,"responses":43,"security":102,"codeSamples":105},"AI Video","AI Videos","ai-videos","GET","\u002Fapi\u002Fv1\u002Fai_video\u002Fcost","get-ai-video-cost","Estimate cost","Estimate the credits a generation will cost before submitting, using the same formula as the actual\ncharge. Omit `resolution` to price the model default.\n\nBeta: available to allowlisted API keys; standard per-key rate limits apply.","get_ai_video_cost_api_v1_ai_video_cost_get",60,"\u003Cp>Estimate the credits a generation will cost before submitting, using the same formula as the actual charge. Omit \u003Ccode>resolution\u003C\u002Fcode> to price the model default.\u003C\u002Fp>\u003Cp>Beta: available to allowlisted API keys; standard per-key rate limits apply.\u003C\u002Fp>",[16,23,28,33,39],{"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",{"name":24,"in":25,"required":19,"description":26,"type":21,"example":27},"model_id","query","Model to price for. Use an id from GET \u002Fapi\u002Fv1\u002Fai_video\u002Fmodels, e.g. `seedance-2.0`.","seedance-2.0",{"name":29,"in":25,"required":19,"description":30,"type":31,"example":32},"duration_sec","Clip length in seconds to price. Must be an allowed value for the model (see GET \u002Fapi\u002Fv1\u002Fai_video\u002Fmodels).","integer",8,{"name":34,"in":25,"required":35,"description":36,"type":37,"example":38},"resolution",false,"Output resolution to price, e.g. `720p` \u002F `1080p`. Allowed values vary by model; omit to use the model default.","string | null","720p",{"name":40,"in":25,"required":35,"description":41,"type":42,"example":19},"generate_audio","Whether the estimate should include a native audio track. Omit to use the model default.","boolean | null",[44,75],{"status":45,"description":46,"contentType":47,"schema":48,"example":71},"200","Successful Response","application\u002Fjson",{"type":49,"description":50,"nullable":35,"properties":51},"BaseSuccessResponse_AiVideoCostResponse_","",[52,61,66],{"name":53,"required":19,"type":54,"description":55,"nullable":19,"properties":56},"data","AiVideoCostResponse | 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.",[57],{"name":58,"required":19,"type":31,"description":59,"nullable":35,"properties":60},"credit","Estimated credits the generation will cost with the given parameters. Uses the same formula as the actual charge.",[],{"name":62,"required":35,"type":21,"description":63,"nullable":35,"default":64,"properties":65},"message","Human-readable status message; `\"success\"` on a successful call.","success",[],{"name":67,"required":19,"type":68,"description":69,"nullable":35,"properties":70},"server_time","string · date-time","Server-side timestamp when the response was produced, in ISO 8601 format (UTC).",[],{"data":72,"server_time":74,"message":64},{"credit":73},1,"2026-08-24T08:00:00Z",{"status":76,"description":77,"contentType":47,"schema":78,"example":100},"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":79,"description":50,"nullable":35,"properties":80},"ErrorResponse",[81],{"name":82,"required":19,"type":83,"description":50,"nullable":35,"properties":84},"error","ErrorDetail",[85,89,93,97],{"name":86,"required":19,"type":31,"description":87,"nullable":35,"properties":88},"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":90,"required":35,"type":37,"description":91,"nullable":19,"properties":92},"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":94,"required":35,"type":37,"description":95,"nullable":19,"properties":96},"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":62,"required":19,"type":21,"description":98,"nullable":35,"properties":99},"Human-readable explanation of what went wrong. Safe to log or surface to end users; not localized.",[],{"error":101},{"code":73,"message":21,"details":21,"hint":21},[103],{"APIKeyHeader":104},[],[106,109],{"lang":107,"source":108},"Python","import os\nimport requests\n\nresponse = requests.get(\n    \"https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Fai_video\u002Fcost\",\n    headers={\"X-API-Key\": os.environ[\"VISIONSTORY_API_KEY\"]},\n    params={\n      \"model_id\": \"seedance-2.0\",\n      \"duration_sec\": 8\n    },\n)\nresponse.raise_for_status()\nprint(response.json())",{"lang":110,"source":111},"cURL","curl --request GET 'https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Fai_video\u002Fcost?model_id=seedance-2.0&duration_sec=8' \\\n  --header 'X-API-Key: $VISIONSTORY_API_KEY'","\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.get(\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#A5D6FF\">    \"https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Fai_video\u002Fcost\"\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\">    params\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\">      \"duration_sec\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">8\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\">    \"credit\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">1\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]