Skip to main content
POST
/
v1
/
sessions
Create LiveKit Audio-to-Video Session
curl --request POST \
  --url https://api.bey.dev/v1/sessions \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "avatar_id": "<string>",
  "url": "<string>",
  "token": "<string>",
  "transport": "livekit"
}
'
import requests

url = "https://api.bey.dev/v1/sessions"

payload = {
    "avatar_id": "<string>",
    "url": "<string>",
    "token": "<string>",
    "transport": "livekit"
}
headers = {
    "x-api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    avatar_id: '<string>',
    url: '<string>',
    token: '<string>',
    transport: 'livekit'
  })
};

fetch('https://api.bey.dev/v1/sessions', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "<string>",
  "avatar_id": "<string>",
  "status": {
    "type": "to_start"
  },
  "url": "<string>",
  "transport": "livekit"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

x-api-key
string
header
required

Your Beyond Presence API Key.

Body

application/json

Request body to create a LiveKit speech-to-video session.

avatar_id
string
required

ID of avatar to use.

Example:

"01234567-89ab-cdef-0123-456789abcdef"

url
string
required

URL of LiveKit server the avatar worker should connect to.

Example:

"wss://<your-domain>.livekit.cloud"

token
string<password>
required
write-only

The token used to join your LiveKit room.

Example:

"<your-livekit-token>"

transport
string
default:livekit
Allowed value: "livekit"

Response

Created LiveKit Audio-to-Video Session with ID

Response body for a LiveKit speech-to-video session.

id
string
required

Unique identifier of the object in the database.

Example:

"01234567-89ab-cdef-0123-456789abcdef"

avatar_id
string
required

ID of avatar to use.

Example:

"01234567-89ab-cdef-0123-456789abcdef"

status
SessionStatusToStart · object
required

Session that has not yet started.

url
string
required

URL of LiveKit server the avatar worker should connect to.

Example:

"wss://<your-domain>.livekit.cloud"

transport
string
default:livekit
Allowed value: "livekit"