Skip to main content
POST
Python (SDK)

Authorizations

Authorization
string
header
required

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Headers

X-On-Behalf-Of
string

Optional external end-user identifier forwarded by the API gateway.

Body

application/json

Request parameters for generating a LiveKit room token with LLM configuration, optional STT settings, and optional language.

llm
object
required

LLM configuration for the voice session. Uses a subset of the responses create schema — fields like input, stream, background, webhooks, and store are excluded since the voice agent manages those. WARNING: This object is serialized into the LiveKit JWT metadata which is transmitted via HTTP headers. Keep payloads small — large tools arrays can exceed the ~8KB header size limit imposed by most servers and proxies.

stt
object

Optional STT (speech-to-text) VAD configuration.

language
enum<string>

Optional ISO 639-1 language code (for example 'en' or 'uk') for the voice session; must be one of the languages supported by text-to-speech. Carried in the participant metadata so the voice agent uses it for speech recognition and synthesis instead of auto-detecting. Omit to let the agent auto-detect.

Available options:
en,
zh,
hi,
es,
ar,
bn,
pt,
ru,
ja,
pa,
de,
ko,
fr,
tr,
it,
th,
pl,
nl,
id,
vi,
ur,
uk

Response

200 - application/json

OK

Response containing a LiveKit access token, server URL, and the generated room name.

token
string
required

JWT access token for authenticating with the LiveKit room

url
string<uri>
required

LiveKit server WebSocket URL to connect to (e.g., wss://apigw.mka1.com/api/v1/livekit)

room_name
string
required

Auto-generated UUID room name assigned to this session