Overview

Hi,

Welcome to Lyrebird! We’re excited about sharing our Voice Avatar API with you. Our Vocal Avatar API allows you to integrate the digital voice of your users in your product.

This section gives a quick overview of the Vocal Avatar API flow. For more details, read the next pages.

If you're not familiar with OAuth and want a very easy tutorial to get started, please visit our QuickStart.

To make authorized API calls to the Lyrebird Vocal Avatar API:

  1. Create a Lyrebird Vocal Avatar app. A set of OAuth2 credentials will be generated for your app.
  2. Get an access token. You need to redirect the browser of the user to a page using the credentials generated in the previous step, then, for server-side apps, the API will callback your app with an authorization code, that you will exchange for an access token with an HTTP request.
  3. Make authorized API calls. Use the access token for authorization in your API calls.

1 - Creating a Lyrebird app

On the Developer page page, click on New OAuth App.

After filling the necessary information, click on Save changes.

A set of OAuth2 credentials will be generated for your application OAuth client: the Client ID and the Client Secret.

See Creating a Lyrebird app for details.

2 - Getting an access token

You need to redirect the user to https://myvoice.lyrebird.ai/authorize with some URL query parameters in order to receive a code. Your app will receive a callback from the API, containing the access token (for single page applications and mobile apps). See Getting an access token for details.

For server-side apps, your server will receive an authorization code in its callback, rather than a token, in which case you need to exchange it for an access token, by making an HTTP GET request to https://avatar.lyrebird.ai/api/v0/token. For example with cURL:

CURL
# Request #
curl -H 'Content-Type: application/json'
'https://avatar.lyrebird.ai/api/v0/token' -d
'{
    "grant_type": "authorization_code",
    "client_id": "19qV2jZy1G44ifOxk6kgowAt9F0",
    "client_secret": "19qnfRvIXdmQKhSbLG0CLxng5Mz",
    "code": "19qozJe3hwnPvfl5xyNuR3MJ1NK"
}'
# Response #
{
    "access_token": "18QdNlaDvkzMbgQ5SXmKNGmexWo"
}

Where:

  • client_id: Your Client ID, generated in the first step.
  • client_secret: Your Client Secret, generated in the first step.
  • grant_type: Must be set to authorization_code.
  • code: The code you received in the callback.

3 - Making authorized API calls

Once you have an access token, you can use it to make authorized API calls to the Lyrebird Vocal Avatar API. See Making authenticated requests for details.

For example, to generate audio with the voice of the user:

CURL
curl -H 'Content-Type: application/json'
-H 'Authorization: Bearer 18QdNlaDvkzMbgQ5SXmKNGmexWo'
'https://avatar.lyrebird.ai/api/v0/generate' -d
'{
    "text": "Hello World"
}'

Sample Apps

We have developed a few sample apps to help you get started with Lyrebird Vocal Avatar API:

Additional resources

If you run into problems using the Lyrebird Vocal Avatar API, feel free to reach out to us in the following ways:

Custom voice API

We are no longer maintaining our Custom Voice service. However, you are welcome to try our Vocal Avatar API instead

results matching ""

    No results matching ""