> ## Documentation Index
> Fetch the complete documentation index at: https://docs.simli.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Livekit

> Livekit Backed WebRTC

[Compose Session Token](/api-reference/compose-session-token) is sent as query parameter string

No first message is required. However, You must successfully join the livekit room within 30 seconds




## AsyncAPI

````yaml api-reference/asyncapi.yaml livekit
id: livekit
title: Livekit
description: >
  Livekit Backed WebRTC


  [Compose Session Token](/api-reference/compose-session-token) is sent as query
  parameter string


  No first message is required. However, You must successfully join the livekit
  room within 30 seconds
servers:
  - id: Simli WSS
    protocol: wss
    host: api.simli.ai
    bindings: []
    variables:
      - id: session_token
        description: Session token generated by https://api.simli.ai/compose/token
        allowedValues: []
        examples: []
address: /compose/webrtc/livekit
parameters: []
bindings: []
operations:
  - &ref_6
    id: recvLivekitInfo
    title: Recv livekit info
    type: send
    messages:
      - &ref_12
        id: livekit_join_info
        contentType: text/plain
        payload:
          - name: livekit_join_info
            description: >-
              Room info and join token that are used by the client to join a
              livekit room that hosts the avatar session
            type: object
            properties:
              - name: livekit_url
                type: string
                required: false
              - name: livekit_token
                type: string
                required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            properties:
              livekit_url:
                type: string
                x-parser-schema-id: <anonymous-schema-16>
              livekit_token:
                type: string
                x-parser-schema-id: <anonymous-schema-17>
            x-parser-schema-id: <anonymous-schema-15>
        title: Livekit_join_info
        description: >-
          Room info and join token that are used by the client to join a livekit
          room that hosts the avatar session
        example: |-
          {
            "livekit_url": "<string>",
            "livekit_token": "<string>"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: livekit_join_info
          - id: x-parser-message-name
            value: livekit_join_info
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: livekit
  - &ref_3
    id: sendAudioChunk_livekit
    title: Send audio chunk_livekit
    type: receive
    messages:
      - &ref_9
        id: audio_chunk
        contentType: application/octet-stream
        payload:
          - type: string
            format: bytestring
            x-parser-schema-id: <anonymous-schema-7>
            name: audio_chunk
            description: >-
              Binary stream of the audio that the Avatar will lipsync to. Sent
              as a binary stream (in JS/TS UInt8Arr)
        headers: []
        jsonPayloadSchema:
          schema:
            type: string
            format: bytestring
            x-parser-schema-id: <anonymous-schema-7>
        title: Audio_chunk
        description: >-
          Binary stream of the audio that the Avatar will lipsync to. Sent as a
          binary stream (in JS/TS UInt8Arr)
        example: '{}'
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: audio_chunk
          - id: x-parser-message-name
            value: audio_chunk
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: clearBuffer_livekit
    title: Clear buffer_livekit
    type: receive
    messages:
      - &ref_10
        id: clear_buffer
        contentType: text/plain
        payload:
          - type: string
            const: SKIP
            x-parser-schema-id: <anonymous-schema-8>
            name: clear_buffer
            description: >-
              Client Signal to make the avatar stop speaking immediately and
              ignore all previously sent audio
        headers: []
        jsonPayloadSchema:
          schema:
            type: string
            const: SKIP
            x-parser-schema-id: <anonymous-schema-8>
        title: Clear_buffer
        description: >-
          Client Signal to make the avatar stop speaking immediately and ignore
          all previously sent audio
        example: '{}'
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: clear_buffer
          - id: x-parser-message-name
            value: clear_buffer
    bindings: []
    extensions: *ref_0
  - &ref_5
    id: finalMessage_livekit
    title: Final message_livekit
    type: receive
    messages:
      - &ref_11
        id: final_message
        contentType: text/plain
        payload:
          - type: string
            const: DONE
            x-parser-schema-id: <anonymous-schema-9>
            name: final_message
            description: >-
              Client Signal to tell the server that the final segment of audio
              has been already sent and that it should close after playing it
              back
        headers: []
        jsonPayloadSchema:
          schema:
            type: string
            const: DONE
            x-parser-schema-id: <anonymous-schema-9>
        title: Final_message
        description: >-
          Client Signal to tell the server that the final segment of audio has
          been already sent and that it should close after playing it back
        example: '{}'
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: final_message
          - id: x-parser-message-name
            value: final_message
    bindings: []
    extensions: *ref_0
  - &ref_7
    id: event_livekit
    title: Event_livekit
    type: send
    messages:
      - &ref_13
        id: event
        contentType: text/plain
        payload:
          - type: string
            enum: &ref_1
              - START
              - ACK
              - STOP
              - SPEAK
              - SILENT
            x-parser-schema-id: <anonymous-schema-10>
            name: event
            description: Server sent signals
        headers: []
        jsonPayloadSchema:
          schema:
            type: string
            enum: *ref_1
            x-parser-schema-id: <anonymous-schema-10>
        title: Event
        description: Server sent signals
        example: '{}'
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: event
          - id: x-parser-message-name
            value: event
    bindings: []
    extensions: *ref_0
  - &ref_8
    id: error_livekit
    title: Error_livekit
    type: send
    messages:
      - &ref_14
        id: error
        contentType: text/plain
        payload:
          - type: string
            oneOf: &ref_2
              - pattern: ^(?i)ERROR\s+.+$
                description: Matches 'ERROR' regardless of casing.
                x-parser-schema-id: <anonymous-schema-12>
              - pattern: ^(?i)RATE\s+.+$
                description: Matches 'RATE' followed by a space.
                x-parser-schema-id: <anonymous-schema-13>
              - pattern: ^(?i)CLOSING\s+.+$
                description: Matches 'CLOSING' followed by a space.
                x-parser-schema-id: <anonymous-schema-14>
            x-parser-schema-id: <anonymous-schema-11>
            name: error
            description: >-
              Termination messages that specify the reason for immediate
              termination
        headers: []
        jsonPayloadSchema:
          schema:
            type: string
            oneOf: *ref_2
            x-parser-schema-id: <anonymous-schema-11>
          example: 'ERROR: INVALID_API_KEY'
        title: Error
        description: Termination messages that specify the reason for immediate termination
        example: '{}'
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: error
          - id: x-parser-message-name
            value: error
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_3
  - *ref_4
  - *ref_5
receiveOperations:
  - *ref_6
  - *ref_7
  - *ref_8
sendMessages:
  - *ref_9
  - *ref_10
  - *ref_11
receiveMessages:
  - *ref_12
  - *ref_13
  - *ref_14
extensions:
  - id: x-parser-unique-object-id
    value: livekit
securitySchemes: []

````