Making authenticated requests

Once you have an access token, you can use it to make authorized API requests to the Lyrebird Vocal Avatar API on behalf of the user. If you lose your access token, or the user revokes your access token, you will have to complete the previous step again to get a new one.

To use the access token, simply specify it in the Authorization header of any requests you make to the API (by prepending it with Bearer and a space). See the API reference for a list of all the API endpoints.

For example, to generate audio from the voice of the user (you must request the voice scope for the request to work):

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

If your access token is invalid, the server will respond with an HTTP 401 error. In that case, for webpages and mobile apps, it is recommended to complete the authorization step again by redirecting the user to the voice consent form webpage.

results matching ""

    No results matching ""