API
Learn how to connect your CMS to BeyondWords using our text-to-speech API.
Before you start using our API, you will need to create a project in BeyondWords. This will give you access to a Project ID and API key. You can also set your default voices in the 'Settings (General)' section of the project dashboard.
The BeyondWords API is organized around REST. Our API returns JSON-encoded responses and uses standard HTTP response codes, authentication, and verbs.
Requests should include
content-type: application/json
.Prior to using the API to create audio, you should make sure that your content is in a suitable format to be processed.
We recommend submitting
title
and body
content in HTML. This is because HTML provides additional context that enables better conversion into speech synthesis markup language (SSML) and therefore better conversion into audio.The HTML markup is submitted via a JSON request, so make sure it is valid JSON by escaping quotation marks and forward slashes:
<h4 class=\"line\" data-line=\"0\">h4 Heading<\/h4>
<p class=\"line\" data-line=\"2\"><strong>This is bold text<\/strong><\/p>
<p class=\"line\" data-line=\"4\"><em>This is italic text<\/em><\/p>
You can also submit content in markdown.
#### Heading
**This is bold text**
_This is italic text_
For plain text, use \n\n to signify a new paragraph.
Heading
This is bold text
This is italic text
The BeyondWords API uses API keys to authenticate requests. You can view the API key for your project by going to the 'Settings (General)' section of your project dashboard.
️Do not share your API keys in publicly accessible areas such as GitHub, client-side code, etc.
API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
You can create audios using multiple voices by adding a
data-speechkit-voice=*
data attribute to a <p>
element (when using HTML), where the *
is a Voice ID from our list of voices.For example, the following HTML, BeyondWords data attributes, and voice IDs would produce the following audio:
<p data-speechkit-voice="492" class="line" data-line="1" >This is the first paragraph.</p>
<p data-speechkit-voice="453" class="line" data-line="2" >This is a sub heading.</p>
<p data-speechkit-voice="492" class="line" data-line="3" >This is the second paragraph.</p>
Last modified 7mo ago