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

# Talk to an AI Assistant over WebSocket

> Real-time voice conversation with a Telnyx AI Assistant. The client streams PCM16 audio to Telnyx and receives lifecycle, transcription, and assistant-audio frames in return.

## Authentication
Requires authentication via a Bearer token (Telnyx API v2 key).




## AsyncAPI

````yaml openapi/asyncapi/assistant-conversation/assistant-conversation.yml assistant-conversation-websocket
id: assistant-conversation-websocket
title: Talk to an AI Assistant over WebSocket
description: >
  Real-time voice conversation with a Telnyx AI Assistant. The client streams
  PCM16 audio to Telnyx and receives lifecycle, transcription, and
  assistant-audio frames in return.


  ## Authentication

  Requires authentication via a Bearer token (Telnyx API v2 key).
servers:
  - id: assistant-conversation-websocket
    protocol: wss
    host: api.telnyx.com
    bindings:
      - protocol: ws
        version: 0.1.0
        value: {}
        schemaProperties: []
    variables: []
address: /v2/ai/assistants/{assistant_id}/conversation
parameters:
  - id: assistant_id
    jsonSchema:
      type: string
      description: Identifier of the AI Assistant to converse with.
    description: Identifier of the AI Assistant to converse with.
    type: string
    required: true
    deprecated: false
bindings:
  - protocol: ws
    version: 0.1.0
    value:
      query:
        type: object
        description: Query parameters passed when opening the WebSocket connection.
        properties:
          input_sample_rate:
            type: integer
            description: >-
              Sample rate, in Hz, of the PCM16 audio the client streams to
              Telnyx.
            default: 16000
            enum:
              - 8000
              - 16000
              - 24000
              - 44100
              - 48000
          input_format:
            type: string
            description: >-
              Encoding of the audio the client streams to Telnyx. Only PCM16 is
              supported.
            default: pcm16
            enum:
              - pcm16
          output_format:
            type: string
            description: >-
              Encoding of the assistant audio Telnyx streams back. Only PCM16 is
              supported.
            default: pcm16
            enum:
              - pcm16
          output_sample_rate:
            type: integer
            description: >
              Preferred sample rate, in Hz, for the assistant audio.

              Advisory only: the effective output rate is determined by the
              assistant's voice and is reported in the `session.created` frame.
    schemaProperties:
      - name: query
        type: object
        description: Query parameters passed when opening the WebSocket connection.
        required: false
        properties:
          - name: input_sample_rate
            type: integer
            description: >-
              Sample rate, in Hz, of the PCM16 audio the client streams to
              Telnyx.
            enumValues:
              - 8000
              - 16000
              - 24000
              - 44100
              - 48000
            required: false
          - name: input_format
            type: string
            description: >-
              Encoding of the audio the client streams to Telnyx. Only PCM16 is
              supported.
            enumValues:
              - pcm16
            required: false
          - name: output_format
            type: string
            description: >-
              Encoding of the assistant audio Telnyx streams back. Only PCM16 is
              supported.
            enumValues:
              - pcm16
            required: false
          - name: output_sample_rate
            type: integer
            description: >
              Preferred sample rate, in Hz, for the assistant audio.

              Advisory only: the effective output rate is determined by the
              assistant's voice and is reported in the `session.created` frame.
            required: false
operations:
  - &ref_6
    id: sendClientEvents
    title: Send Client Events
    description: >-
      The client streams microphone audio to Telnyx as base64-encoded PCM16
      frames, and can inject a user turn as text or cancel the in-progress
      assistant response.
    type: receive
    messages:
      - &ref_8
        id: clientInputAudioAppend
        contentType: application/json
        payload:
          - name: Input Audio Append Frame
            description: >
              Client-to-Telnyx frame carrying a chunk of microphone audio.

              The `audio` field is a base64-encoded PCM16 payload at the sample
              rate requested with the `input_sample_rate` query parameter.
              Frames larger than 1 MiB are rejected with a `frame_too_large`
              error.
            type: object
            properties:
              - name: type
                type: string
                description: input_audio_buffer.append
                required: true
              - name: audio
                type: string
                description: Base64-encoded PCM16 audio chunk.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - audio
          properties:
            type:
              type: string
              const: input_audio_buffer.append
              x-parser-schema-id: <anonymous-schema-2>
            audio:
              type: string
              format: byte
              description: Base64-encoded PCM16 audio chunk.
              x-parser-schema-id: <anonymous-schema-3>
          x-parser-schema-id: InputAudioAppendFrame
        title: Input Audio Append Frame
        description: >
          Client-to-Telnyx frame carrying a chunk of microphone audio.

          The `audio` field is a base64-encoded PCM16 payload at the sample rate
          requested with the `input_sample_rate` query parameter. Frames larger
          than 1 MiB are rejected with a `frame_too_large` error.
        example: |-
          {
            "type": "input_audio_buffer.append",
            "audio": "eW91ciBiYXNlNjQgZW5jb2RlZCBwY20xNiBhdWRpbw=="
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: clientInputAudioAppend
      - &ref_9
        id: clientCreateConversationItem
        contentType: application/json
        payload:
          - name: Create Conversation Item Frame
            description: >
              Client-to-Telnyx frame that adds a conversation item. Two item
              types are supported: a user `message` with `input_text` content
              (injects a completed user turn, which the assistant answers
              exactly as it would a spoken one), and a `function_call_output`
              that returns the result of a client-side tool `function_call`
              previously requested by Telnyx. There is no separate frame to
              request a response — the assistant owns turn-taking. An item of
              any other shape is rejected with an `invalid_item` error.
            type: object
            properties:
              - name: type
                type: string
                description: conversation.item.create
                required: true
              - name: item
                type: object
                description: >-
                  The conversation item to add — either a user text message or a
                  client-side tool result.
                required: true
                properties:
                  - name: type
                    type: string
                    description: message
                    required: true
                  - name: role
                    type: string
                    description: user
                    required: true
                  - name: content
                    type: array
                    description: >-
                      Content parts of the user message. Only `input_text` parts
                      are used.
                    required: true
                    properties:
                      - name: type
                        type: string
                        description: input_text
                        required: true
                      - name: text
                        type: string
                        description: User-provided text for the turn.
                        required: true
                  - name: type
                    type: string
                    description: function_call_output
                    required: true
                  - name: call_id
                    type: string
                    description: >-
                      Identifier of a client-side tool call, correlating the
                      `function_call` request with its `function_call_output`
                      result.
                    required: true
                  - name: output
                    type: string
                    description: >-
                      Tool result returned to the assistant, as a string
                      (JSON-encoded when structured).
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - item
          properties:
            type:
              type: string
              const: conversation.item.create
              x-parser-schema-id: <anonymous-schema-4>
            item:
              description: >-
                The conversation item to add — either a user text message or a
                client-side tool result.
              oneOf:
                - type: object
                  additionalProperties: false
                  description: A completed user turn provided as text.
                  required:
                    - type
                    - role
                    - content
                  properties:
                    type:
                      type: string
                      const: message
                      x-parser-schema-id: <anonymous-schema-6>
                    role:
                      type: string
                      const: user
                      x-parser-schema-id: <anonymous-schema-7>
                    content:
                      type: array
                      description: >-
                        Content parts of the user message. Only `input_text`
                        parts are used.
                      items:
                        type: object
                        additionalProperties: false
                        required:
                          - type
                          - text
                        properties:
                          type:
                            type: string
                            const: input_text
                            x-parser-schema-id: <anonymous-schema-10>
                          text:
                            type: string
                            description: User-provided text for the turn.
                            x-parser-schema-id: <anonymous-schema-11>
                        x-parser-schema-id: <anonymous-schema-9>
                      x-parser-schema-id: <anonymous-schema-8>
                  x-parser-schema-id: UserMessageItem
                - type: object
                  additionalProperties: false
                  description: >-
                    The result of a client-side tool `function_call` requested
                    by Telnyx.
                  required:
                    - type
                    - call_id
                    - output
                  properties:
                    type:
                      type: string
                      const: function_call_output
                      x-parser-schema-id: <anonymous-schema-12>
                    call_id: &ref_3
                      type: string
                      description: >-
                        Identifier of a client-side tool call, correlating the
                        `function_call` request with its `function_call_output`
                        result.
                      x-parser-schema-id: CallId
                    output:
                      type: string
                      description: >-
                        Tool result returned to the assistant, as a string
                        (JSON-encoded when structured).
                      x-parser-schema-id: <anonymous-schema-13>
                  x-parser-schema-id: FunctionCallOutputItem
              x-parser-schema-id: <anonymous-schema-5>
          x-parser-schema-id: CreateConversationItemFrame
        title: Create Conversation Item Frame
        description: >
          Client-to-Telnyx frame that adds a conversation item. Two item types
          are supported: a user `message` with `input_text` content (injects a
          completed user turn, which the assistant answers exactly as it would a
          spoken one), and a `function_call_output` that returns the result of a
          client-side tool `function_call` previously requested by Telnyx. There
          is no separate frame to request a response — the assistant owns
          turn-taking. An item of any other shape is rejected with an
          `invalid_item` error.
        example: |-
          {
            "type": "conversation.item.create",
            "item": {
              "type": "message",
              "role": "user",
              "content": [
                {
                  "type": "input_text",
                  "text": "What are your business hours?"
                }
              ]
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: clientCreateConversationItem
      - &ref_10
        id: clientResponseCancel
        contentType: application/json
        payload:
          - name: Response Cancel Frame
            description: >
              Client-to-Telnyx frame that cancels the in-progress assistant
              response (client-initiated barge-in without audio).

              Include `response_id` to target a specific response; omit it to
              cancel the current one. Cancelling flushes playback and Telnyx
              emits a `response.done` frame with status `cancelled`. Cancelling
              a stale or already-finished response is a no-op.
            type: object
            properties:
              - name: type
                type: string
                description: response.cancel
                required: true
              - name: response_id
                type: string
                description: >-
                  Identifier of the response to cancel. When omitted, the
                  current in-progress response is cancelled.
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              type: string
              const: response.cancel
              x-parser-schema-id: <anonymous-schema-14>
            response_id:
              type: string
              description: >-
                Identifier of the response to cancel. When omitted, the current
                in-progress response is cancelled.
              x-parser-schema-id: <anonymous-schema-15>
          x-parser-schema-id: ResponseCancelFrame
        title: Response Cancel Frame
        description: >
          Client-to-Telnyx frame that cancels the in-progress assistant response
          (client-initiated barge-in without audio).

          Include `response_id` to target a specific response; omit it to cancel
          the current one. Cancelling flushes playback and Telnyx emits a
          `response.done` frame with status `cancelled`. Cancelling a stale or
          already-finished response is a no-op.
        example: |-
          {
            "type": "response.cancel",
            "response_id": "resp_9c1f4a2b"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: clientResponseCancel
    bindings: []
    extensions: &ref_5
      - id: x-parser-unique-object-id
        value: assistant-conversation-websocket
  - &ref_7
    id: receiveAssistantEvents
    title: Receive Assistant Events
    description: >-
      Telnyx sends session, speech-detection, transcription, assistant-audio,
      tool-call, and error frames to the client.
    type: send
    messages:
      - &ref_11
        id: serverSessionCreated
        contentType: application/json
        payload:
          - name: Session Created Frame
            description: >-
              First frame sent by Telnyx once the conversation has started.
              Confirms the session and the negotiated input and output audio
              formats.
            type: object
            properties:
              - name: type
                type: string
                description: session.created
                required: true
              - name: session
                type: object
                required: true
                properties:
                  - name: conversation_id
                    type: string
                    description: Identifier of the conversation started for this session.
                    required: true
                  - name: assistant_id
                    type: string
                    description: Identifier of the assistant handling the conversation.
                    required: true
                  - name: audio
                    type: object
                    required: true
                    properties:
                      - name: input
                        type: object
                        required: true
                        properties:
                          - name: format
                            type: object
                            required: true
                            properties:
                              - name: type
                                type: string
                                description: >-
                                  Audio content type. PCM16 audio is reported as
                                  `audio/pcm`.
                                required: true
                              - name: rate
                                type: integer
                                description: Sample rate of the audio in Hz.
                                required: true
                          - name: turn_detection
                            type: object
                            required: true
                            properties:
                              - name: type
                                type: string
                                description: Turn-detection mode used for the session.
                                required: true
                      - name: output
                        type: object
                        required: true
                        properties:
                          - name: format
                            type: object
                            required: true
                            properties:
                              - name: type
                                type: string
                                description: >-
                                  Audio content type. PCM16 audio is reported as
                                  `audio/pcm`.
                                required: true
                              - name: rate
                                type: integer
                                description: Sample rate of the audio in Hz.
                                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - session
          properties:
            type:
              type: string
              const: session.created
              x-parser-schema-id: <anonymous-schema-16>
            session:
              type: object
              additionalProperties: false
              required:
                - conversation_id
                - assistant_id
                - audio
              properties:
                conversation_id:
                  type: string
                  description: Identifier of the conversation started for this session.
                  x-parser-schema-id: <anonymous-schema-18>
                assistant_id:
                  type: string
                  description: Identifier of the assistant handling the conversation.
                  x-parser-schema-id: <anonymous-schema-19>
                audio:
                  type: object
                  additionalProperties: false
                  required:
                    - input
                    - output
                  properties:
                    input:
                      type: object
                      additionalProperties: false
                      required:
                        - format
                        - turn_detection
                      properties:
                        format: &ref_0
                          type: object
                          additionalProperties: false
                          required:
                            - type
                            - rate
                          properties:
                            type:
                              type: string
                              description: >-
                                Audio content type. PCM16 audio is reported as
                                `audio/pcm`.
                              const: audio/pcm
                              x-parser-schema-id: <anonymous-schema-22>
                            rate:
                              type: integer
                              description: Sample rate of the audio in Hz.
                              x-parser-schema-id: <anonymous-schema-23>
                          x-parser-schema-id: AudioFormat
                        turn_detection:
                          type: object
                          additionalProperties: false
                          required:
                            - type
                          properties:
                            type:
                              type: string
                              description: Turn-detection mode used for the session.
                              const: server_vad
                              x-parser-schema-id: <anonymous-schema-25>
                          x-parser-schema-id: <anonymous-schema-24>
                      x-parser-schema-id: <anonymous-schema-21>
                    output:
                      type: object
                      additionalProperties: false
                      required:
                        - format
                      properties:
                        format: *ref_0
                      x-parser-schema-id: <anonymous-schema-26>
                  x-parser-schema-id: <anonymous-schema-20>
              x-parser-schema-id: <anonymous-schema-17>
          x-parser-schema-id: SessionCreatedFrame
        title: Session Created Frame
        description: >-
          First frame sent by Telnyx once the conversation has started. Confirms
          the session and the negotiated input and output audio formats.
        example: |-
          {
            "type": "session.created",
            "session": {
              "conversation_id": "3E6F995F-85F7-4705-9741-53B116D28237",
              "assistant_id": "assistant-0f4e8b2a",
              "audio": {
                "input": {
                  "format": {
                    "type": "audio/pcm",
                    "rate": 16000
                  },
                  "turn_detection": {
                    "type": "server_vad"
                  }
                },
                "output": {
                  "format": {
                    "type": "audio/pcm",
                    "rate": 24000
                  }
                }
              }
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverSessionCreated
      - &ref_12
        id: serverSpeechStarted
        contentType: application/json
        payload:
          - name: Speech Started Frame
            description: >-
              Sent when server-side voice-activity detection determines the user
              has started speaking. Edge-triggered.
            type: object
            properties:
              - name: type
                type: string
                description: input_audio_buffer.speech_started
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              type: string
              const: input_audio_buffer.speech_started
              x-parser-schema-id: <anonymous-schema-27>
          x-parser-schema-id: SpeechStartedFrame
        title: Speech Started Frame
        description: >-
          Sent when server-side voice-activity detection determines the user has
          started speaking. Edge-triggered.
        example: |-
          {
            "type": "input_audio_buffer.speech_started"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverSpeechStarted
      - &ref_13
        id: serverSpeechStopped
        contentType: application/json
        payload:
          - name: Speech Stopped Frame
            description: >-
              Sent when server-side voice-activity detection determines the user
              has stopped speaking. Edge-triggered, and never sent without a
              preceding speech-started.
            type: object
            properties:
              - name: type
                type: string
                description: input_audio_buffer.speech_stopped
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              type: string
              const: input_audio_buffer.speech_stopped
              x-parser-schema-id: <anonymous-schema-28>
          x-parser-schema-id: SpeechStoppedFrame
        title: Speech Stopped Frame
        description: >-
          Sent when server-side voice-activity detection determines the user has
          stopped speaking. Edge-triggered, and never sent without a preceding
          speech-started.
        example: |-
          {
            "type": "input_audio_buffer.speech_stopped"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverSpeechStopped
      - &ref_14
        id: serverInputTranscription
        contentType: application/json
        payload:
          - name: Input Transcription Completed Frame
            description: Transcript of the audio the user streamed for the current turn.
            type: object
            properties:
              - name: type
                type: string
                description: conversation.item.input_audio_transcription.completed
                required: true
              - name: transcript
                type: string
                description: Transcribed text of the user''s audio for the turn.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - transcript
          properties:
            type:
              type: string
              const: conversation.item.input_audio_transcription.completed
              x-parser-schema-id: <anonymous-schema-29>
            transcript:
              type: string
              description: Transcribed text of the user''s audio for the turn.
              x-parser-schema-id: <anonymous-schema-30>
          x-parser-schema-id: InputTranscriptionCompletedFrame
        title: Input Transcription Completed Frame
        description: Transcript of the audio the user streamed for the current turn.
        example: |-
          {
            "type": "conversation.item.input_audio_transcription.completed",
            "transcript": "What are your business hours?"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverInputTranscription
      - &ref_15
        id: serverResponseCreated
        contentType: application/json
        payload:
          - name: Response Created Frame
            description: >-
              Marks the start of an assistant turn. The `response.id` correlates
              the audio and transcript deltas that follow.
            type: object
            properties:
              - name: type
                type: string
                description: response.created
                required: true
              - name: response
                type: object
                required: true
                properties:
                  - name: id
                    type: string
                    description: >-
                      Identifier of the assistant response, correlating the
                      frames of a single turn.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - response
          properties:
            type:
              type: string
              const: response.created
              x-parser-schema-id: <anonymous-schema-31>
            response:
              type: object
              additionalProperties: false
              required:
                - id
              properties:
                id: &ref_1
                  type: string
                  description: >-
                    Identifier of the assistant response, correlating the frames
                    of a single turn.
                  x-parser-schema-id: ResponseId
              x-parser-schema-id: <anonymous-schema-32>
          x-parser-schema-id: ResponseCreatedFrame
        title: Response Created Frame
        description: >-
          Marks the start of an assistant turn. The `response.id` correlates the
          audio and transcript deltas that follow.
        example: |-
          {
            "type": "response.created",
            "response": {
              "id": "resp_9c1f4a2b"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverResponseCreated
      - &ref_16
        id: serverResponseAudioDelta
        contentType: application/json
        payload:
          - name: Response Audio Delta Frame
            description: >-
              A chunk of the assistant''s synthesized speech, as base64-encoded
              PCM16 at the output rate announced in `session.created`.
            type: object
            properties:
              - name: type
                type: string
                description: response.output_audio.delta
                required: true
              - name: response_id
                type: string
                description: >-
                  Identifier of the assistant response, correlating the frames
                  of a single turn.
                required: true
              - name: item_id
                type: string
                description: Identifier of the output item within a response.
                required: true
              - name: delta
                type: string
                description: >-
                  Base64-encoded PCM16 chunk of the assistant''s synthesized
                  speech.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - response_id
            - item_id
            - delta
          properties:
            type:
              type: string
              const: response.output_audio.delta
              x-parser-schema-id: <anonymous-schema-33>
            response_id: *ref_1
            item_id: &ref_2
              type: string
              description: Identifier of the output item within a response.
              x-parser-schema-id: ItemId
            delta:
              type: string
              format: byte
              description: >-
                Base64-encoded PCM16 chunk of the assistant''s synthesized
                speech.
              x-parser-schema-id: <anonymous-schema-34>
          x-parser-schema-id: ResponseAudioDeltaFrame
        title: Response Audio Delta Frame
        description: >-
          A chunk of the assistant''s synthesized speech, as base64-encoded
          PCM16 at the output rate announced in `session.created`.
        example: |-
          {
            "type": "response.output_audio.delta",
            "response_id": "resp_9c1f4a2b",
            "item_id": "item_5d2e7f10",
            "delta": "eW91ciBiYXNlNjQgZW5jb2RlZCBwY20xNiBhdWRpbw=="
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverResponseAudioDelta
      - &ref_17
        id: serverResponseAudioTranscriptDelta
        contentType: application/json
        payload:
          - name: Response Audio Transcript Delta Frame
            description: >-
              A chunk of the text transcript of the assistant''s spoken
              response, streamed alongside the audio deltas.
            type: object
            properties:
              - name: type
                type: string
                description: response.output_audio_transcript.delta
                required: true
              - name: response_id
                type: string
                description: >-
                  Identifier of the assistant response, correlating the frames
                  of a single turn.
                required: true
              - name: item_id
                type: string
                description: Identifier of the output item within a response.
                required: true
              - name: delta
                type: string
                description: >-
                  Chunk of the text transcript of the assistant''s spoken
                  response.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - response_id
            - item_id
            - delta
          properties:
            type:
              type: string
              const: response.output_audio_transcript.delta
              x-parser-schema-id: <anonymous-schema-35>
            response_id: *ref_1
            item_id: *ref_2
            delta:
              type: string
              description: >-
                Chunk of the text transcript of the assistant''s spoken
                response.
              x-parser-schema-id: <anonymous-schema-36>
          x-parser-schema-id: ResponseAudioTranscriptDeltaFrame
        title: Response Audio Transcript Delta Frame
        description: >-
          A chunk of the text transcript of the assistant''s spoken response,
          streamed alongside the audio deltas.
        example: |-
          {
            "type": "response.output_audio_transcript.delta",
            "response_id": "resp_9c1f4a2b",
            "item_id": "item_5d2e7f10",
            "delta": "We are open from 9am "
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverResponseAudioTranscriptDelta
      - &ref_18
        id: serverResponseAudioDone
        contentType: application/json
        payload:
          - name: Response Audio Done Frame
            description: Sent when the assistant has finished streaming audio for the turn.
            type: object
            properties:
              - name: type
                type: string
                description: response.output_audio.done
                required: true
              - name: response_id
                type: string
                description: >-
                  Identifier of the assistant response, correlating the frames
                  of a single turn.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - response_id
          properties:
            type:
              type: string
              const: response.output_audio.done
              x-parser-schema-id: <anonymous-schema-37>
            response_id: *ref_1
          x-parser-schema-id: ResponseAudioDoneFrame
        title: Response Audio Done Frame
        description: Sent when the assistant has finished streaming audio for the turn.
        example: |-
          {
            "type": "response.output_audio.done",
            "response_id": "resp_9c1f4a2b"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverResponseAudioDone
      - &ref_19
        id: serverResponseDone
        contentType: application/json
        payload:
          - name: Response Done Frame
            description: Marks the end of an assistant turn, including its final status.
            type: object
            properties:
              - name: type
                type: string
                description: response.done
                required: true
              - name: response
                type: object
                required: true
                properties:
                  - name: id
                    type: string
                    description: >-
                      Identifier of the assistant response, correlating the
                      frames of a single turn.
                    required: true
                  - name: status
                    type: string
                    description: Final status of the assistant turn.
                    enumValues:
                      - completed
                      - cancelled
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - response
          properties:
            type:
              type: string
              const: response.done
              x-parser-schema-id: <anonymous-schema-38>
            response:
              type: object
              additionalProperties: false
              required:
                - id
                - status
              properties:
                id: *ref_1
                status:
                  type: string
                  description: Final status of the assistant turn.
                  enum:
                    - completed
                    - cancelled
                  x-parser-schema-id: <anonymous-schema-40>
              x-parser-schema-id: <anonymous-schema-39>
          x-parser-schema-id: ResponseDoneFrame
        title: Response Done Frame
        description: Marks the end of an assistant turn, including its final status.
        example: |-
          {
            "type": "response.done",
            "response": {
              "id": "resp_9c1f4a2b",
              "status": "completed"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverResponseDone
      - &ref_20
        id: serverConversationItemCreated
        contentType: application/json
        payload:
          - name: Conversation Item Created Frame
            description: >
              Telnyx-to-client frame requesting a client-side tool call.

              When the assistant invokes a `client_side_tool`, Telnyx sends a
              `function_call` item that the client executes locally. The client
              returns the result with a `conversation.item.create` frame
              carrying a `function_call_output` item that references the same
              `call_id`. The assistant continues once the result arrives, or
              after the tool times out.
            type: object
            properties:
              - name: type
                type: string
                description: conversation.item.created
                required: true
              - name: item
                type: object
                description: The client-side tool call requested by Telnyx.
                required: true
                properties:
                  - name: type
                    type: string
                    description: function_call
                    required: true
                  - name: call_id
                    type: string
                    description: >-
                      Identifier of a client-side tool call, correlating the
                      `function_call` request with its `function_call_output`
                      result.
                    required: true
                  - name: name
                    type: string
                    description: Name of the client-side tool to invoke.
                    required: true
                  - name: arguments
                    type: string
                    description: Tool call arguments as a JSON-encoded string.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - item
          properties:
            type:
              type: string
              const: conversation.item.created
              x-parser-schema-id: <anonymous-schema-41>
            item:
              type: object
              additionalProperties: false
              description: The client-side tool call requested by Telnyx.
              required:
                - type
                - call_id
                - name
                - arguments
              properties:
                type:
                  type: string
                  const: function_call
                  x-parser-schema-id: <anonymous-schema-43>
                call_id: *ref_3
                name:
                  type: string
                  description: Name of the client-side tool to invoke.
                  x-parser-schema-id: <anonymous-schema-44>
                arguments:
                  type: string
                  description: Tool call arguments as a JSON-encoded string.
                  x-parser-schema-id: <anonymous-schema-45>
              x-parser-schema-id: <anonymous-schema-42>
          x-parser-schema-id: ConversationItemCreatedFrame
        title: Conversation Item Created Frame
        description: >
          Telnyx-to-client frame requesting a client-side tool call.

          When the assistant invokes a `client_side_tool`, Telnyx sends a
          `function_call` item that the client executes locally. The client
          returns the result with a `conversation.item.create` frame carrying a
          `function_call_output` item that references the same `call_id`. The
          assistant continues once the result arrives, or after the tool times
          out.
        example: |-
          {
            "type": "conversation.item.created",
            "item": {
              "type": "function_call",
              "call_id": "call_4b8e12a7",
              "name": "get_weather",
              "arguments": "{\"city\":\"Chicago\"}"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverConversationItemCreated
      - &ref_21
        id: serverToolCallStarted
        contentType: application/json
        payload:
          - name: Tool Call Started Frame
            description: >
              Informational frame sent when the assistant invokes a server-side
              tool (for example a webhook or MCP integration).

              Telnyx executes tools server-side, so these frames are
              observational only: the client displays tool activity but does not
              execute or respond to the call.
            type: object
            properties:
              - name: type
                type: string
                description: response.tool_call.started
                required: true
              - name: tool_call
                type: object
                required: true
                properties:
                  - name: id
                    type: string
                    description: >-
                      Identifier of the tool call, correlating its started and
                      completed frames.
                    required: true
                  - name: name
                    type: string
                    description: Name of the invoked tool.
                    required: true
                  - name: arguments
                    type: string
                    description: Tool call arguments as a JSON-encoded string.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - tool_call
          properties:
            type:
              type: string
              const: response.tool_call.started
              x-parser-schema-id: <anonymous-schema-46>
            tool_call:
              type: object
              additionalProperties: false
              required:
                - id
                - name
                - arguments
              properties:
                id: &ref_4
                  type: string
                  description: >-
                    Identifier of the tool call, correlating its started and
                    completed frames.
                  x-parser-schema-id: ToolCallId
                name:
                  type: string
                  description: Name of the invoked tool.
                  x-parser-schema-id: <anonymous-schema-48>
                arguments:
                  type: string
                  description: Tool call arguments as a JSON-encoded string.
                  x-parser-schema-id: <anonymous-schema-49>
              x-parser-schema-id: <anonymous-schema-47>
          x-parser-schema-id: ToolCallStartedFrame
        title: Tool Call Started Frame
        description: >
          Informational frame sent when the assistant invokes a server-side tool
          (for example a webhook or MCP integration).

          Telnyx executes tools server-side, so these frames are observational
          only: the client displays tool activity but does not execute or
          respond to the call.
        example: |-
          {
            "type": "response.tool_call.started",
            "tool_call": {
              "id": "call_7a3f21b8",
              "name": "get_business_hours",
              "arguments": "{\"location\":\"downtown\"}"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverToolCallStarted
      - &ref_22
        id: serverToolCallCompleted
        contentType: application/json
        payload:
          - name: Tool Call Completed Frame
            description: >-
              Informational frame sent when a server-side tool invocation
              finishes, with its outcome.
            type: object
            properties:
              - name: type
                type: string
                description: response.tool_call.completed
                required: true
              - name: tool_call
                type: object
                required: true
                properties:
                  - name: id
                    type: string
                    description: >-
                      Identifier of the tool call, correlating its started and
                      completed frames.
                    required: true
                  - name: name
                    type: string
                    description: Name of the invoked tool.
                    required: true
              - name: status
                type: string
                description: Outcome of the tool invocation.
                enumValues:
                  - success
                  - error
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - tool_call
            - status
          properties:
            type:
              type: string
              const: response.tool_call.completed
              x-parser-schema-id: <anonymous-schema-50>
            tool_call:
              type: object
              additionalProperties: false
              required:
                - id
                - name
              properties:
                id: *ref_4
                name:
                  type: string
                  description: Name of the invoked tool.
                  x-parser-schema-id: <anonymous-schema-52>
              x-parser-schema-id: <anonymous-schema-51>
            status:
              type: string
              description: Outcome of the tool invocation.
              enum:
                - success
                - error
              x-parser-schema-id: <anonymous-schema-53>
          x-parser-schema-id: ToolCallCompletedFrame
        title: Tool Call Completed Frame
        description: >-
          Informational frame sent when a server-side tool invocation finishes,
          with its outcome.
        example: |-
          {
            "type": "response.tool_call.completed",
            "tool_call": {
              "id": "call_7a3f21b8",
              "name": "get_business_hours"
            },
            "status": "success"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverToolCallCompleted
      - &ref_23
        id: serverError
        contentType: application/json
        payload:
          - name: Error Frame
            description: >-
              Sent when an error occurs. Some errors are non-fatal and leave the
              session open; others close the connection after the frame is sent.
            type: object
            properties:
              - name: type
                type: string
                description: error
                required: true
              - name: error
                type: object
                required: true
                properties:
                  - name: code
                    type: string
                    description: Machine-readable error code.
                    enumValues:
                      - session_not_ready
                      - frame_too_large
                      - unsupported_event
                      - invalid_json
                      - invalid_audio
                      - invalid_item
                      - ingress_budget_exceeded
                      - unsupported_voice_output_format
                      - conversation_start_failed
                      - conversation_ended
                      - session_idle_timeout
                      - session_max_duration_exceeded
                    required: true
                  - name: message
                    type: string
                    description: Human-readable error detail.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          additionalProperties: false
          required:
            - type
            - error
          properties:
            type:
              type: string
              const: error
              x-parser-schema-id: <anonymous-schema-54>
            error:
              type: object
              additionalProperties: false
              required:
                - code
                - message
              properties:
                code:
                  type: string
                  description: Machine-readable error code.
                  enum:
                    - session_not_ready
                    - frame_too_large
                    - unsupported_event
                    - invalid_json
                    - invalid_audio
                    - invalid_item
                    - ingress_budget_exceeded
                    - unsupported_voice_output_format
                    - conversation_start_failed
                    - conversation_ended
                    - session_idle_timeout
                    - session_max_duration_exceeded
                  x-parser-schema-id: <anonymous-schema-56>
                message:
                  type: string
                  description: Human-readable error detail.
                  x-parser-schema-id: <anonymous-schema-57>
              x-parser-schema-id: <anonymous-schema-55>
          x-parser-schema-id: ErrorFrame
        title: Error Frame
        description: >-
          Sent when an error occurs. Some errors are non-fatal and leave the
          session open; others close the connection after the frame is sent.
        example: |-
          {
            "type": "error",
            "error": {
              "code": "invalid_audio",
              "message": "Invalid base64-encoded audio payload"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: serverError
    bindings: []
    extensions: *ref_5
sendOperations:
  - *ref_6
receiveOperations:
  - *ref_7
sendMessages:
  - *ref_8
  - *ref_9
  - *ref_10
receiveMessages:
  - *ref_11
  - *ref_12
  - *ref_13
  - *ref_14
  - *ref_15
  - *ref_16
  - *ref_17
  - *ref_18
  - *ref_19
  - *ref_20
  - *ref_21
  - *ref_22
  - *ref_23
extensions:
  - id: x-parser-unique-object-id
    value: assistant-conversation-websocket
securitySchemes:
  - id: bearerAuth
    name: bearerAuth
    type: http
    description: Telnyx API v2 Bearer token authentication.
    scheme: bearer
    extensions: []

````