[{"data":1,"prerenderedAt":166},["ShallowReactive",2],{"reference-detail-align_audio_api_v1_audio_align_post":3,"developer-code-wi7nsr":164,"developer-code-lbqxoc":165},{"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":63,"security":151,"codeSamples":154},"Audio","audio","POST","\u002Fapi\u002Fv1\u002Faudio\u002Falign","align-audio","Align text with audio","Force-align known `text` against its spoken audio and get word-level timestamps — e.g. align a\nscript with the MP3 from POST \u002Fapi\u002Fv1\u002Ftts to build accurate subtitles for any voice. Billing:\n1 credit per started 5 minutes of audio, charged only on success. Synchronous — audio up to 30\nminutes. Per-key concurrency is limited during beta; requests beyond the limit are rejected, not\nqueued.","align_audio_api_v1_audio_align_post",999,"\u003Cp>Force-align known \u003Ccode>text\u003C\u002Fcode> against its spoken audio and get word-level timestamps — e.g. align a script with the MP3 from POST \u002Fapi\u002Fv1\u002Ftts to build accurate subtitles for any voice. Billing: 1 credit per started 5 minutes of audio, charged only on success. Synchronous — audio up to 30 minutes. Per-key concurrency is limited during beta; requests beyond the limit are rejected, not queued.\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":59},"application\u002Fjson",{"type":25,"description":26,"nullable":27,"properties":28},"AlignRequest","",false,[29,55],{"name":5,"required":18,"type":30,"description":31,"nullable":27,"properties":32},"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).",[33,38,51],{"name":34,"required":27,"type":35,"description":36,"nullable":18,"properties":37},"asset_id","string | null","Asset ID from POST \u002Fapi\u002Fv1\u002Fasset; use for materials reused across requests.",[],{"name":39,"required":27,"type":40,"description":41,"nullable":18,"properties":42},"inline_data","InlineDataModel | null","Inline base64 media data for one-off use; not added to your asset library.",[43,47],{"name":44,"required":18,"type":20,"description":45,"nullable":27,"properties":46},"data","The file's raw bytes encoded as a base64 string (no `data:` URI prefix).",[],{"name":48,"required":18,"type":20,"description":49,"nullable":27,"properties":50},"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":52,"required":27,"type":35,"description":53,"nullable":18,"properties":54},"url","Publicly accessible media URL for one-off use; not added to your asset library.",[],{"name":56,"required":18,"type":20,"description":57,"nullable":27,"properties":58},"text","The exact text spoken in the audio (e.g. the script you synthesized with POST \u002Fapi\u002Fv1\u002Ftts). Timestamps are aligned against this text.",[],{"audio":60,"text":62},{"asset_id":61},"asset_audio_123456","Welcome to VisionStory.",[64,124],{"status":65,"description":66,"contentType":23,"schema":67,"example":118},"200","Successful Response",{"type":68,"description":26,"nullable":27,"properties":69},"BaseSuccessResponse_AlignResponse_",[70,108,113],{"name":44,"required":18,"type":71,"description":72,"nullable":18,"properties":73},"AlignResponse | 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.",[74,80,85],{"name":75,"required":27,"type":76,"description":77,"nullable":27,"default":78,"properties":79},"cost_credit","integer","Credits charged for this request.",0,[],{"name":81,"required":27,"type":82,"description":83,"nullable":27,"default":78,"properties":84},"duration_sec","number","Duration of the input audio in seconds.",[],{"name":86,"required":27,"type":87,"description":88,"nullable":27,"properties":89,"items":90},"words","WordDto[]","Word-level timestamps for the given text.",[],{"type":91,"description":26,"nullable":27,"properties":92},"WordDto",[93,97,101,105],{"name":94,"required":18,"type":82,"description":95,"nullable":27,"properties":96},"end_sec","Word end time in seconds.",[],{"name":98,"required":27,"type":35,"description":99,"nullable":18,"properties":100},"speaker","Speaker label, present only when `diarize` was requested.",[],{"name":102,"required":18,"type":82,"description":103,"nullable":27,"properties":104},"start_sec","Word start time in seconds.",[],{"name":56,"required":18,"type":20,"description":106,"nullable":27,"properties":107},"The word as written.",[],{"name":109,"required":27,"type":20,"description":110,"nullable":27,"default":111,"properties":112},"message","Human-readable status message; `\"success\"` on a successful call.","success",[],{"name":114,"required":18,"type":115,"description":116,"nullable":27,"properties":117},"server_time","string · date-time","Server-side timestamp when the response was produced, in ISO 8601 format (UTC).",[],{"data":119,"server_time":123,"message":111},{"cost_credit":78,"duration_sec":78,"words":120},[121],{"end_sec":122,"start_sec":122,"text":62,"speaker":20},1,"2026-08-24T08:00:00Z",{"status":125,"description":126,"contentType":23,"schema":127,"example":149},"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":128,"description":26,"nullable":27,"properties":129},"ErrorResponse",[130],{"name":131,"required":18,"type":132,"description":26,"nullable":27,"properties":133},"error","ErrorDetail",[134,138,142,146],{"name":135,"required":18,"type":76,"description":136,"nullable":27,"properties":137},"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":139,"required":27,"type":35,"description":140,"nullable":18,"properties":141},"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":143,"required":27,"type":35,"description":144,"nullable":18,"properties":145},"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":109,"required":18,"type":20,"description":147,"nullable":27,"properties":148},"Human-readable explanation of what went wrong. Safe to log or surface to end users; not localized.",[],{"error":150},{"code":122,"message":20,"details":20,"hint":20},[152],{"APIKeyHeader":153},[],[155,158,161],{"lang":156,"source":157},"SDK","from visionstory import VisionStoryClient\n\nclient = VisionStoryClient.from_env()\nalignment = client.align_audio(\n    text=\"Welcome to VisionStory.\",\n    asset_id=\"asset_audio_123456\",\n)\nprint(alignment)",{"lang":159,"source":160},"REST","import os\nimport requests\n\nresponse = requests.post(\n    \"https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Faudio\u002Falign\",\n    headers={\"X-API-Key\": os.environ[\"VISIONSTORY_API_KEY\"]},\n    json={\n      \"audio\": {\n        \"asset_id\": \"asset_audio_123456\"\n      },\n      \"text\": \"Welcome to VisionStory.\"\n    },\n)\nresponse.raise_for_status()\nprint(response.json())",{"lang":162,"source":163},"cURL","curl --request POST 'https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Faudio\u002Falign' \\\n  --header 'X-API-Key: $VISIONSTORY_API_KEY' \\\n  --header 'Content-Type: application\u002Fjson' \\\n  --data '{\n  \"audio\": {\n    \"asset_id\": \"asset_audio_123456\"\n  },\n  \"text\": \"Welcome to VisionStory.\"\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\">alignment \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> client.align_audio(\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#FFA657\">    text\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Welcome to VisionStory.\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#FFA657\">    asset_id\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"asset_audio_123456\"\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\">(alignment)\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\">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\">    \"words\"\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:#7EE787\">        \"end_sec\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">1\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">        \"start_sec\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">1\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">        \"text\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Welcome to VisionStory.\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#7EE787\">        \"speaker\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"string\"\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\">  },\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>",1788337170752]