[{"data":1,"prerenderedAt":686},["ShallowReactive",2],{"guide-\u002Fguides\u002Ftext-to-speech":3,"developer-code-zck62e":682,"developer-code-1xjn948":683,"developer-code-19xjzrm":684,"developer-code-1n3btyq":685},{"id":4,"title":5,"body":6,"description":673,"extension":674,"meta":675,"navigation":676,"path":678,"seo":679,"stem":680,"__hash__":681},"guides\u002Fguides\u002Ftext-to-speech.md","Text-to-Speech API",{"type":7,"value":8,"toc":666},"minimark",[9,13,23,28,67,71,98,160,171,215,406,410,435,538,573,591,595,631,635,662],[10,11,12],"p",{},"The VisionStory Text-to-Speech API converts text into natural MP3 audio with any public or cloned voice. The request is synchronous: a successful response returns the generated audio bytes directly.",[14,15,16],"blockquote",{},[10,17,18,22],{},[19,20,21],"strong",{},"Beta."," Any API key backed by an active Pro plan or above can call this endpoint. No separate capability allowlist is required.",[24,25,27],"h2",{"id":26},"text-to-speech-api-endpoint","Text-to-speech API endpoint",[29,30,31,47],"table",{},[32,33,34],"thead",{},[35,36,37,41,44],"tr",{},[38,39,40],"th",{},"Method",[38,42,43],{},"Path",[38,45,46],{},"What it does",[48,49,50],"tbody",{},[35,51,52,59,64],{},[53,54,55],"td",{},[56,57,58],"code",{},"POST",[53,60,61],{},[56,62,63],{},"\u002Fapi\u002Fv1\u002Ftts",[53,65,66],{},"Synthesize speech from text; returns MP3 audio",[24,68,70],{"id":69},"generate-mp3-speech-from-text","Generate MP3 speech from text",[10,72,73,74,77,78,81,82,85,86,89,90,93,94,97],{},"Send ",[56,75,76],{},"text"," and a ",[56,79,80],{},"voice_id"," from ",[56,83,84],{},"GET \u002Fapi\u002Fv1\u002Fvoices",". Add an optional BCP 47 ",[56,87,88],{},"locale",", such as ",[56,91,92],{},"en-GB"," or ",[56,95,96],{},"zh-TW",", to steer pronunciation and accent for multilingual voices. Locale handling is best-effort per speech engine; omit it to use the voice's native locale.",[99,100,105],"pre",{"className":101,"code":102,"language":103,"meta":104,"style":104},"language-bash shiki shiki-themes github-light github-dark","curl -s -X POST -H \"X-API-Key: $VISIONSTORY_API_KEY\" -H \"Content-Type: application\u002Fjson\" -d '{\"text\": \"Hello from VisionStory.\", \"voice_id\": \"YOUR_VOICE_ID\", \"locale\": \"en-GB\"}' https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Ftts --output speech.mp3\n","bash","",[56,106,107],{"__ignoreMap":104},[108,109,112,116,120,123,127,130,133,137,140,142,145,148,151,154,157],"span",{"class":110,"line":111},"line",1,[108,113,115],{"class":114},"sScJk","curl",[108,117,119],{"class":118},"sj4cs"," -s",[108,121,122],{"class":118}," -X",[108,124,126],{"class":125},"sZZnC"," POST",[108,128,129],{"class":118}," -H",[108,131,132],{"class":125}," \"X-API-Key: ",[108,134,136],{"class":135},"sVt8B","$VISIONSTORY_API_KEY",[108,138,139],{"class":125},"\"",[108,141,129],{"class":118},[108,143,144],{"class":125}," \"Content-Type: application\u002Fjson\"",[108,146,147],{"class":118}," -d",[108,149,150],{"class":125}," '{\"text\": \"Hello from VisionStory.\", \"voice_id\": \"YOUR_VOICE_ID\", \"locale\": \"en-GB\"}'",[108,152,153],{"class":125}," https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Ftts",[108,155,156],{"class":118}," --output",[108,158,159],{"class":125}," speech.mp3\n",[10,161,162,163,166,167,170],{},"The response body is the raw MP3 (",[56,164,165],{},"audio\u002Fmpeg",", 44.1 kHz). Usage and billing come back in ",[19,168,169],{},"response headers",", not the body:",[29,172,173,183],{},[32,174,175],{},[35,176,177,180],{},[38,178,179],{},"Header",[38,181,182],{},"Meaning",[48,184,185,195,205],{},[35,186,187,192],{},[53,188,189],{},[56,190,191],{},"X-Audio-Duration-Sec",[53,193,194],{},"Length of the generated audio, in seconds",[35,196,197,202],{},[53,198,199],{},[56,200,201],{},"X-Usage-Characters",[53,203,204],{},"Characters billed",[35,206,207,212],{},[53,208,209],{},[56,210,211],{},"X-Cost-Credit",[53,213,214],{},"Credits charged for this call",[99,216,220],{"className":217,"code":218,"language":219,"meta":104,"style":104},"language-python shiki shiki-themes github-light github-dark","import requests, os\n\nresp = requests.post(\n    \"https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Ftts\",\n    headers={\"X-API-Key\": os.environ[\"VISIONSTORY_API_KEY\"]},\n    json={\"text\": \"Hello from VisionStory.\", \"voice_id\": \"YOUR_VOICE_ID\", \"locale\": \"en-GB\"},\n    timeout=240,\n)\nresp.raise_for_status()\nwith open(\"speech.mp3\", \"wb\") as f:\n    f.write(resp.content)\nprint(\"credits charged:\", resp.headers.get(\"X-Cost-Credit\"))\n","python",[56,221,222,231,238,250,259,283,326,339,345,351,380,386],{"__ignoreMap":104},[108,223,224,228],{"class":110,"line":111},[108,225,227],{"class":226},"szBVR","import",[108,229,230],{"class":135}," requests, os\n",[108,232,234],{"class":110,"line":233},2,[108,235,237],{"emptyLinePlaceholder":236},true,"\n",[108,239,241,244,247],{"class":110,"line":240},3,[108,242,243],{"class":135},"resp ",[108,245,246],{"class":226},"=",[108,248,249],{"class":135}," requests.post(\n",[108,251,253,256],{"class":110,"line":252},4,[108,254,255],{"class":125},"    \"https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Ftts\"",[108,257,258],{"class":135},",\n",[108,260,262,266,268,271,274,277,280],{"class":110,"line":261},5,[108,263,265],{"class":264},"s4XuR","    headers",[108,267,246],{"class":226},[108,269,270],{"class":135},"{",[108,272,273],{"class":125},"\"X-API-Key\"",[108,275,276],{"class":135},": os.environ[",[108,278,279],{"class":125},"\"VISIONSTORY_API_KEY\"",[108,281,282],{"class":135},"]},\n",[108,284,286,289,291,293,296,299,302,305,308,310,313,315,318,320,323],{"class":110,"line":285},6,[108,287,288],{"class":264},"    json",[108,290,246],{"class":226},[108,292,270],{"class":135},[108,294,295],{"class":125},"\"text\"",[108,297,298],{"class":135},": ",[108,300,301],{"class":125},"\"Hello from VisionStory.\"",[108,303,304],{"class":135},", ",[108,306,307],{"class":125},"\"voice_id\"",[108,309,298],{"class":135},[108,311,312],{"class":125},"\"YOUR_VOICE_ID\"",[108,314,304],{"class":135},[108,316,317],{"class":125},"\"locale\"",[108,319,298],{"class":135},[108,321,322],{"class":125},"\"en-GB\"",[108,324,325],{"class":135},"},\n",[108,327,329,332,334,337],{"class":110,"line":328},7,[108,330,331],{"class":264},"    timeout",[108,333,246],{"class":226},[108,335,336],{"class":118},"240",[108,338,258],{"class":135},[108,340,342],{"class":110,"line":341},8,[108,343,344],{"class":135},")\n",[108,346,348],{"class":110,"line":347},9,[108,349,350],{"class":135},"resp.raise_for_status()\n",[108,352,354,357,360,363,366,368,371,374,377],{"class":110,"line":353},10,[108,355,356],{"class":226},"with",[108,358,359],{"class":118}," open",[108,361,362],{"class":135},"(",[108,364,365],{"class":125},"\"speech.mp3\"",[108,367,304],{"class":135},[108,369,370],{"class":125},"\"wb\"",[108,372,373],{"class":135},") ",[108,375,376],{"class":226},"as",[108,378,379],{"class":135}," f:\n",[108,381,383],{"class":110,"line":382},11,[108,384,385],{"class":135},"    f.write(resp.content)\n",[108,387,389,392,394,397,400,403],{"class":110,"line":388},12,[108,390,391],{"class":118},"print",[108,393,362],{"class":135},[108,395,396],{"class":125},"\"credits charged:\"",[108,398,399],{"class":135},", resp.headers.get(",[108,401,402],{"class":125},"\"X-Cost-Credit\"",[108,404,405],{"class":135},"))\n",[24,407,409],{"id":408},"control-speech-rate","Control speech rate",[10,411,412,413,416,417,304,420,423,424,427,428,431,432,434],{},"The optional ",[56,414,415],{},"speech_rate"," accepts ",[56,418,419],{},"slow",[56,421,422],{},"normal",", or ",[56,425,426],{},"fast",". Omit it or send ",[56,429,430],{},"null"," to use normal speed. The setting works with public and cloned voices, but the actual duration change depends on the voice; read ",[56,433,191],{}," rather than assuming a fixed duration. Speed changes preserve pitch, and billing is unchanged.",[99,436,438],{"className":217,"code":437,"language":219,"meta":104,"style":104},"from visionstory import VisionStoryClient\nfrom pathlib import Path\n\nspeech = VisionStoryClient.from_env().create_speech(\n    text=\"Hello from VisionStory.\", voice_id=\"YOUR_VOICE_ID\",\n    locale=\"en-GB\", speech_rate=\"slow\",\n)\nPath(\"speech.mp3\").write_bytes(speech[\"audio\"])\n",[56,439,440,453,465,469,479,498,518,522],{"__ignoreMap":104},[108,441,442,445,448,450],{"class":110,"line":111},[108,443,444],{"class":226},"from",[108,446,447],{"class":135}," visionstory ",[108,449,227],{"class":226},[108,451,452],{"class":135}," VisionStoryClient\n",[108,454,455,457,460,462],{"class":110,"line":233},[108,456,444],{"class":226},[108,458,459],{"class":135}," pathlib ",[108,461,227],{"class":226},[108,463,464],{"class":135}," Path\n",[108,466,467],{"class":110,"line":240},[108,468,237],{"emptyLinePlaceholder":236},[108,470,471,474,476],{"class":110,"line":252},[108,472,473],{"class":135},"speech ",[108,475,246],{"class":226},[108,477,478],{"class":135}," VisionStoryClient.from_env().create_speech(\n",[108,480,481,484,486,488,490,492,494,496],{"class":110,"line":261},[108,482,483],{"class":264},"    text",[108,485,246],{"class":226},[108,487,301],{"class":125},[108,489,304],{"class":135},[108,491,80],{"class":264},[108,493,246],{"class":226},[108,495,312],{"class":125},[108,497,258],{"class":135},[108,499,500,503,505,507,509,511,513,516],{"class":110,"line":285},[108,501,502],{"class":264},"    locale",[108,504,246],{"class":226},[108,506,322],{"class":125},[108,508,304],{"class":135},[108,510,415],{"class":264},[108,512,246],{"class":226},[108,514,515],{"class":125},"\"slow\"",[108,517,258],{"class":135},[108,519,520],{"class":110,"line":328},[108,521,344],{"class":135},[108,523,524,527,529,532,535],{"class":110,"line":341},[108,525,526],{"class":135},"Path(",[108,528,365],{"class":125},[108,530,531],{"class":135},").write_bytes(speech[",[108,533,534],{"class":125},"\"audio\"",[108,536,537],{"class":135},"])\n",[99,539,541],{"className":101,"code":540,"language":103,"meta":104,"style":104},"visionstory tts --text \"Hello from VisionStory.\" --voice-id YOUR_VOICE_ID --speech-rate slow --output speech.mp3\n",[56,542,543],{"__ignoreMap":104},[108,544,545,548,551,554,557,560,563,566,569,571],{"class":110,"line":111},[108,546,547],{"class":114},"visionstory",[108,549,550],{"class":125}," tts",[108,552,553],{"class":118}," --text",[108,555,556],{"class":125}," \"Hello from VisionStory.\"",[108,558,559],{"class":118}," --voice-id",[108,561,562],{"class":125}," YOUR_VOICE_ID",[108,564,565],{"class":118}," --speech-rate",[108,567,568],{"class":125}," slow",[108,570,156],{"class":118},[108,572,159],{"class":125},[10,574,575,576,578,579,582,583,304,585,587,588,590],{},"Local and remote MCP expose the same optional ",[56,577,415],{}," on ",[56,580,581],{},"create_speech",". REST callers put it alongside ",[56,584,76],{},[56,586,80],{},", and ",[56,589,88],{}," in the JSON body. Existing calls that omit it keep working.",[24,592,594],{"id":593},"billing-limits-and-storage","Billing, limits, and storage",[596,597,598,609,615,625],"ul",{},[599,600,601,604,605,608],"li",{},[19,602,603],{},"Synchronous & not stored."," The audio is returned inline and is ",[19,606,607],{},"not"," saved on our side — persist the bytes yourself; a repeat call regenerates and bills again.",[599,610,611,614],{},[19,612,613],{},"Billing:"," 2 credits per 1,000 characters (rounded up), charged only on success. There is no free allowance.",[599,616,617,620,621,624],{},[19,618,619],{},"Character limit:"," long text is supported up to a per-request cap; exceeding it returns ",[56,622,623],{},"400",".",[599,626,627,630],{},[19,628,629],{},"Concurrency:"," synchronous generation is capped at a few concurrent requests per key during beta; excess requests are rejected rather than queued.",[24,632,634],{"id":633},"related-visionstory-api-guides","Related VisionStory API guides",[596,636,637,648,655],{},[599,638,639,644,645,647],{},[640,641,643],"a",{"href":642},"\u002Fguides\u002Fvoices","Voices"," — pick or clone the ",[56,646,80],{}," to speak with.",[599,649,650,654],{},[640,651,653],{"href":652},"\u002Fguides\u002Faudio-understanding","Audio Transcription and Alignment"," — align generated speech to exact word timestamps for subtitles.",[599,656,657,661],{},[640,658,660],{"href":659},"\u002Freference","API reference"," — full request schema and error codes.",[663,664,665],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":104,"searchDepth":233,"depth":233,"links":667},[668,669,670,671,672],{"id":26,"depth":233,"text":27},{"id":69,"depth":233,"text":70},{"id":408,"depth":233,"text":409},{"id":593,"depth":233,"text":594},{"id":633,"depth":233,"text":634},"Convert text to MP3 speech with a public or cloned AI voice, control locale and speech rate, and read duration, usage, and credit headers.","md",{},{"title":677,"order":285},"Text to Speech","\u002Fguides\u002Ftext-to-speech",{"title":5,"description":673},"guides\u002Ftext-to-speech","deWT1kcyVYab2pb2cAW4Hg_pkGIGzQbYCzMO8h7qnZU","\u003Cpre class=\"shiki github-dark-default\" style=\"background-color:#0d1117;color:#e6edf3\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#FFA657\">curl\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> -s\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> -X\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> POST\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> -H\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> \"X-API-Key: \u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">$VISIONSTORY_API_KEY\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> -H\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> \"Content-Type: application\u002Fjson\"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> -d\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> '{\"text\": \"Hello from VisionStory.\", \"voice_id\": \"YOUR_VOICE_ID\", \"locale\": \"en-GB\"}'\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> https:\u002F\u002Fopenapi.visionstory.ai\u002Fapi\u002Fv1\u002Ftts\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> --output\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> speech.mp3\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\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:#FF7B72\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> requests, os\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">resp \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>\u003Cspan style=\"color:#A5D6FF\">\"text\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"Hello from VisionStory.\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"voice_id\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"YOUR_VOICE_ID\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"locale\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">: \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"en-GB\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">},\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#FFA657\">    timeout\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\">240\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:#E6EDF3\">resp.raise_for_status()\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#FF7B72\">with\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> open\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"speech.mp3\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"wb\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">) \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">as\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> f:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">    f.write(resp.content)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#79C0FF\">print\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"credits charged:\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, resp.headers.get(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"X-Cost-Credit\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\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:#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\">\u003Cspan style=\"color:#FF7B72\">from\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> pathlib \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> Path\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E6EDF3\">speech \u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\"> VisionStoryClient.from_env().create_speech(\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\">\"Hello from VisionStory.\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">voice_id\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"YOUR_VOICE_ID\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#FFA657\">    locale\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"en-GB\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFA657\">speech_rate\u003C\u002Fspan>\u003Cspan style=\"color:#FF7B72\">=\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"slow\"\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:#E6EDF3\">Path(\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"speech.mp3\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">).write_bytes(speech[\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\">\"audio\"\u003C\u002Fspan>\u003Cspan style=\"color:#E6EDF3\">])\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\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:#FFA657\">visionstory\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> tts\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> --text\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> \"Hello from VisionStory.\"\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> --voice-id\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> YOUR_VOICE_ID\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> --speech-rate\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> slow\u003C\u002Fspan>\u003Cspan style=\"color:#79C0FF\"> --output\u003C\u002Fspan>\u003Cspan style=\"color:#A5D6FF\"> speech.mp3\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",1790231923840]