{"__v":0,"_id":"5845a4a89f6fbb1b004307cc","category":{"version":"5845a4a89f6fbb1b004307b7","project":"54d3007669578e0d002730c9","_id":"5845a4a89f6fbb1b004307ba","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-30T06:53:33.020Z","from_sync":false,"order":2,"slug":"api-reference","title":"API reference"},"parentDoc":null,"project":"54d3007669578e0d002730c9","user":"55bf6cdcad601c2b00762d13","version":{"__v":1,"_id":"5845a4a89f6fbb1b004307b7","project":"54d3007669578e0d002730c9","createdAt":"2016-12-05T17:32:24.708Z","releaseDate":"2016-12-05T17:32:24.708Z","categories":["5845a4a89f6fbb1b004307b8","5845a4a89f6fbb1b004307b9","5845a4a89f6fbb1b004307ba","5845a4a89f6fbb1b004307bb","5845a4a89f6fbb1b004307bc","5845a4a89f6fbb1b004307bd","5845a4a89f6fbb1b004307be","5845a4a89f6fbb1b004307bf","5845a4a89f6fbb1b004307c0"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"25.0.0","version":"25"},"updates":["57b636e29a8d8c0e00002344"],"next":{"pages":[],"description":""},"createdAt":"2015-08-03T22:59:37.563Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"This endpoint is being deprecated.\",\n  \"title\": \"ATTENTION!\"\n}\n[/block]\nThe **tts** endpoint is used to perform text-to-speech – generate speech (audio file) from text. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"URLs\"\n}\n[/block]\nThe following URLs are available:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"URL\",\n    \"h-1\": \"Definition\",\n    \"0-1\": \"Takes text as query parameter and returns a WAV stream.\",\n    \"0-0\": \"[`GET /tts`](tts#get-tts)\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Headers\"\n}\n[/block]\nA single header `Accept-language` is used to identify TTS language. For example:\n    \n    Accept-language: en-US\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Supported languages and their codes: en-US; en-AU; en-CA; en-GB; en-IN; ru-RU; de-DE; es-ES; pt-PT; pt-BR; zh-CN; zh-TW; zh-HK; ja-JP; fr-FR\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"GET /tts\"\n}\n[/block]\nTakes text and returns generated speech (WAV).\n\n### GET /tts Sample Request\n\nThe following query processes the phrase \"Hello World\" and generates audio from it.\n\n    GET https://api.api.ai/v1/tts?v=20150910&text=Hello+world\n  \n    Headers:\n    Authorization: Bearer YOUR_ACCESS_TOKEN\n    Accept-Language: en-US\n  \n### GET /tts Sample cURL Request\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -k -H \\\"Authorization: Bearer ACCESS_TOKEN\\\" -H \\\"Accept-language: en-US\\\" \\\"https://api.api.ai/v1/tts?v=20150910&text=test\\\" -o output.wav\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"tts","type":"basic","title":"/tts"}
[block:callout] { "type": "warning", "body": "This endpoint is being deprecated.", "title": "ATTENTION!" } [/block] The **tts** endpoint is used to perform text-to-speech – generate speech (audio file) from text. [block:api-header] { "type": "basic", "title": "URLs" } [/block] The following URLs are available: [block:parameters] { "data": { "h-0": "URL", "h-1": "Definition", "0-1": "Takes text as query parameter and returns a WAV stream.", "0-0": "[`GET /tts`](tts#get-tts)" }, "cols": 2, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "Headers" } [/block] A single header `Accept-language` is used to identify TTS language. For example: Accept-language: en-US [block:callout] { "type": "info", "body": "Supported languages and their codes: en-US; en-AU; en-CA; en-GB; en-IN; ru-RU; de-DE; es-ES; pt-PT; pt-BR; zh-CN; zh-TW; zh-HK; ja-JP; fr-FR" } [/block] [block:api-header] { "type": "get", "title": "GET /tts" } [/block] Takes text and returns generated speech (WAV). ### GET /tts Sample Request The following query processes the phrase "Hello World" and generates audio from it. GET https://api.api.ai/v1/tts?v=20150910&text=Hello+world Headers: Authorization: Bearer YOUR_ACCESS_TOKEN Accept-Language: en-US ### GET /tts Sample cURL Request [block:code] { "codes": [ { "code": "curl -k -H \"Authorization: Bearer ACCESS_TOKEN\" -H \"Accept-language: en-US\" \"https://api.api.ai/v1/tts?v=20150910&text=test\" -o output.wav", "language": "curl" } ] } [/block]