[{"data":1,"prerenderedAt":92},["ShallowReactive",2],{"reference-detail-create_speech_api_v1_tts_post":3,"developer-code-yj165f":90,"developer-code-1ck5pzg":91},{"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":41,"security":80,"codeSamples":83},"Text to Speech","Speech","speech","POST","\u002Fapi\u002Fv1\u002Ftts","create-speech","Create Speech","Convert text to speech with VisionStory smart TTS. Pick a voice from GET \u002Fapi\u002Fv1\u002Fvoices (public or\nyour cloned voices). The service automatically selects the best synthesis strategy for the voice\nand the text language. Billing: 2 credits per 1000 characters (rounded up), only charged on success.\n\nSynchronous — the response body is the MP3 audio itself (`audio\u002Fmpeg`). Duration and billing are\nreturned in the `X-Audio-Duration-Sec`, `X-Usage-Characters` and `X-Cost-Credit` headers. The audio\nis not stored on our side, so save the response body; a repeat call regenerates and bills again. Per-key concurrency is limited during beta; requests beyond the limit are rejected, not queued.","create_speech_api_v1_tts_post",70,"\u003Cp>Convert text to speech with VisionStory smart TTS. Pick a voice from GET \u002Fapi\u002Fv1\u002Fvoices (public or your cloned voices). The service automatically selects the best synthesis strategy for the voice and the text language. Billing: 2 credits per 1000 characters (rounded up), only charged on success.\u003C\u002Fp>\u003Cp>Synchronous — the response body is the MP3 audio itself (\u003Ccode>audio\u002Fmpeg\u003C\u002Fcode>). Duration and billing are returned in the \u003Ccode>X-Audio-Duration-Sec\u003C\u002Fcode>, \u003Ccode>X-Usage-Characters\u003C\u002Fcode> and \u003Ccode>X-Cost-Credit\u003C\u002Fcode> headers. The audio is not stored on our side, so save the response body; a repeat call regenerates and bills again. 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":38},"application\u002Fjson",{"type":26,"description":27,"nullable":28,"properties":29},"CreateSpeechRequest","",false,[30,34],{"name":31,"required":19,"type":21,"description":32,"nullable":28,"properties":33},"text","Text to synthesize, up to 3000 characters",[],{"name":35,"required":19,"type":21,"description":36,"nullable":28,"properties":37},"voice_id","Public or cloned voice id, check GET \u002Fapi\u002Fv1\u002Fvoices",[],{"text":39,"voice_id":40},"Welcome to VisionStory.","voice_123456",[42,49],{"status":43,"description":44,"contentType":45,"schema":46,"example":21},"200","MP3 audio (44.1kHz). Usage metadata is returned in response headers.","audio\u002Fmpeg",{"type":47,"description":27,"nullable":28,"properties":48},"string · binary",[],{"status":50,"description":51,"contentType":24,"schema":52,"example":77},"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":53,"description":27,"nullable":28,"properties":54},"ErrorResponse",[55],{"name":56,"required":19,"type":57,"description":27,"nullable":28,"properties":58},"error","ErrorDetail",[59,64,69,73],{"name":60,"required":19,"type":61,"description":62,"nullable":28,"properties":63},"code","integer","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":65,"required":28,"type":66,"description":67,"nullable":19,"properties":68},"details","string | null","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":70,"required":28,"type":66,"description":71,"nullable":19,"properties":72},"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":74,"required":19,"type":21,"description":75,"nullable":28,"properties":76},"message","Human-readable explanation of what went wrong. Safe to log or surface to end users; not localized.",[],{"error":78},{"code":79,"message":21,"details":21,"hint":21},1,[81],{"APIKeyHeader":82},[],[84,87],{"lang":85,"source":86},"Python","import os\nimport requests\n\nresponse = requests.post(\n    \"https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Ftts\",\n    headers={\"X-API-Key\": os.environ[\"VISIONSTORY_API_KEY\"]},\n    json={\n      \"text\": \"Welcome to VisionStory.\",\n      \"voice_id\": \"voice_123456\"\n    },\n)\nresponse.raise_for_status()\nprint(response.json())",{"lang":88,"source":89},"cURL","curl --request POST 'https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Ftts' \\\n  --header 'X-API-Key: $VISIONSTORY_API_KEY' \\\n  --header 'Content-Type: application\u002Fjson' \\\n  --data '{\n  \"text\": \"Welcome to VisionStory.\",\n  \"voice_id\": \"voice_123456\"\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\u002Ftts\"\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\">      \"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:#A5D6FF\">      \"voice_id\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"voice_123456\"\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:#A5D6FF\">\"string\"\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",1788166855866]