Skip to main content

Avatars

To interact with the API endpoints listed below, you will need to include an API key in the request headers. The API key can be obtained from the project settings under API keys.

List avatars, voices and backgrounds

  • Method: GET
  • Description: Retrieves a list of settings.
  • Request Headers: "Authorization: [api_key]"
  • URL: https://api.scena.ai/backend/api/avatar/options
  • cURL Command:
    curl -H "Authorization: ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD" \
    "https://api.scena.ai/backend/api/avatar/options"

Get current usage

  • Method: GET
  • Description: Fetches usage information and total credit.
  • Request Headers: "Authorization: [api_key]"
  • URL: https://api.scena.ai/backend/api/avatar/usage
  • cURL Command:
    curl -H "Authorization: ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD" \
    "https://api.scena.ai/backend/api/avatar/usage"

Create video

  • Method: POST
  • Description: Create an avatar video.
  • Request Headers: "Authorization: [api_key]"
  • URL: https://api.scena.ai/backend/api/avatar/create
  • JSON key-values settings:
    • background: This can be either the background ID or URL to a background file. It supports webm, mp4, jpg, or png formats.
    • script: This is either the text of the script or the URL to an mp3 file. If it's text, you might need to specify the voice using the voice parameter.
    • voice: If the script is in text form, this parameter specifies the voice ID to be used.
    • avatar: This is the avatar ID. If it's empty, only audio with the background will be generated.
    • file: This is the name of the file that will be generated.
    • parent_folder_id: Use 0 for the root folder in scena.ai storage.
    • scale: This is an optional parameter. 1 is for default size, 0..1 is for smaller (e.g., 0.5 for half size), and values greater than 1 are for larger sizes
    • offset_x: Horizontal alignment. 0 for center, -1..1 for specific alignments.
    • offset_y: Vertical alignment. 0 for center, -1..1 for specific alignments.
    • circle_background: If set, it adds a circle around the avatar.
  • cURL Command:
    curl -H "Authorization: ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD" \
    "https://api.scena.ai/backend/api/avatar/create" \
    -d '{"background": "a90ea90d2e207471c6f06201ba919335d79a91d373849ef9fbd7a742b9cbd43d", "script": "Hello!", "voice": "d5b110dfe554fa78d8c2307a9a49958f0b3387fbbff4597a856da56b7f67e37a", "avatar": "9b820dad5202d048bd6936ef861d090a93d33351853f9602a2739baa15e4d4f8", "file": "API - My test.mp4", "parent_folder_id": 0}'

Get video status

  • Method: GET
  • Description: This API endpoint retrieves details about a video file that is currently being processed. Continuously poll the endpoint using the file ID returned in the /api/avatar/create API call until the processing property in the JSON response becomes false and the download_url becomes available.
  • Request Headers: "Authorization: [api_key]"
  • URL: https://api.scena.ai/backend/api/file/[file_id]
  • cURL Command:
    curl -H "Authorization: ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD" \
    "https://api.scena.ai/backend/api/file/23"

Remember to replace [api_key] with the appropriate values specific to your usage.