> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://murf.ai/api/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://murf.ai/api/docs/_mcp/server.

# WebSockets

GET /stream-input

The channel for sending TTS requests and receiving audio responses.
Use this WebSocket endpoint to stream text and receive audio in real time.

  Synthesize speech with ultra-low latency over a websocket connection.
  This endpoint serves the Falcon model only.

  Choose the `Base URL` from a table below (Global URL or a Region URL)

  **Note**: Global URL auto-routes to the nearest region. Use it unless you
  have a data-residency requirement. `api.murf.ai` is a
  legacy alias that always resolves to us-east and does not
  geo-route.
  | Region         | URL                                       | Default Concurrency |
  | ------------------------- | ---------------------------------------------- | -------------------- |
  | Global (Routes to the nearest server) | `wss://global.api.murf.ai/v1/speech/stream-input` | Region specific concurrency |
  | US-East                   | `wss://us-east.api.murf.ai/v1/speech/stream-input`    | 5 |
  | US-West                   | `wss://us-west.api.murf.ai/v1/speech/stream-input`    | 2 |
  | India                     | `wss://in.api.murf.ai/v1/speech/stream-input`         | 2 |
  | Canada                    | `wss://ca.api.murf.ai/v1/speech/stream-input`         | 2 |
  | South Korea               | `wss://kr.api.murf.ai/v1/speech/stream-input`         | 2 |
  | UAE                       | `wss://me.api.murf.ai/v1/speech/stream-input`         | 2 |
  | Japan                     | `wss://jp.api.murf.ai/v1/speech/stream-input`         | 2 |
  | Australia                 | `wss://au.api.murf.ai/v1/speech/stream-input`         | 2 |
  | EU (Central)              | `wss://eu-central.api.murf.ai/v1/speech/stream-input` | 2 |
  | UK                        | `wss://uk.api.murf.ai/v1/speech/stream-input`         | 2 |
  | South America (São Paulo) | `wss://sa-east.api.murf.ai/v1/speech/stream-input`    | 2 |


Reference: https://murf.ai/api/docs/api-reference/text-to-speech/stream-input

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: Stream Input
  version: subpackage_streamInput.streamInput
  description: |
    The channel for sending TTS requests and receiving audio responses.
    Use this WebSocket endpoint to stream text and receive audio in real time.

      Synthesize speech with ultra-low latency over a websocket connection.
      This endpoint serves the Falcon model only.

      Choose the `Base URL` from a table below (Global URL or a Region URL)

      **Note**: Global URL auto-routes to the nearest region. Use it unless you
      have a data-residency requirement. `api.murf.ai` is a
      legacy alias that always resolves to us-east and does not
      geo-route.
      | Region         | URL                                       | Default Concurrency |
      | ------------------------- | ---------------------------------------------- | -------------------- |
      | Global (Routes to the nearest server) | `wss://global.api.murf.ai/v1/speech/stream-input` | Region specific concurrency |
      | US-East                   | `wss://us-east.api.murf.ai/v1/speech/stream-input`    | 5 |
      | US-West                   | `wss://us-west.api.murf.ai/v1/speech/stream-input`    | 2 |
      | India                     | `wss://in.api.murf.ai/v1/speech/stream-input`         | 2 |
      | Canada                    | `wss://ca.api.murf.ai/v1/speech/stream-input`         | 2 |
      | South Korea               | `wss://kr.api.murf.ai/v1/speech/stream-input`         | 2 |
      | UAE                       | `wss://me.api.murf.ai/v1/speech/stream-input`         | 2 |
      | Japan                     | `wss://jp.api.murf.ai/v1/speech/stream-input`         | 2 |
      | Australia                 | `wss://au.api.murf.ai/v1/speech/stream-input`         | 2 |
      | EU (Central)              | `wss://eu-central.api.murf.ai/v1/speech/stream-input` | 2 |
      | UK                        | `wss://uk.api.murf.ai/v1/speech/stream-input`         | 2 |
      | South America (São Paulo) | `wss://sa-east.api.murf.ai/v1/speech/stream-input`    | 2 |
channels:
  /stream-input:
    description: |
      The channel for sending TTS requests and receiving audio responses.
      Use this WebSocket endpoint to stream text and receive audio in real time.

        Synthesize speech with ultra-low latency over a websocket connection.
        This endpoint serves the Falcon model only.

        Choose the `Base URL` from a table below (Global URL or a Region URL)

        **Note**: Global URL auto-routes to the nearest region. Use it unless you
        have a data-residency requirement. `api.murf.ai` is a
        legacy alias that always resolves to us-east and does not
        geo-route.
        | Region         | URL                                       | Default Concurrency |
        | ------------------------- | ---------------------------------------------- | -------------------- |
        | Global (Routes to the nearest server) | `wss://global.api.murf.ai/v1/speech/stream-input` | Region specific concurrency |
        | US-East                   | `wss://us-east.api.murf.ai/v1/speech/stream-input`    | 5 |
        | US-West                   | `wss://us-west.api.murf.ai/v1/speech/stream-input`    | 2 |
        | India                     | `wss://in.api.murf.ai/v1/speech/stream-input`         | 2 |
        | Canada                    | `wss://ca.api.murf.ai/v1/speech/stream-input`         | 2 |
        | South Korea               | `wss://kr.api.murf.ai/v1/speech/stream-input`         | 2 |
        | UAE                       | `wss://me.api.murf.ai/v1/speech/stream-input`         | 2 |
        | Japan                     | `wss://jp.api.murf.ai/v1/speech/stream-input`         | 2 |
        | Australia                 | `wss://au.api.murf.ai/v1/speech/stream-input`         | 2 |
        | EU (Central)              | `wss://eu-central.api.murf.ai/v1/speech/stream-input` | 2 |
        | UK                        | `wss://uk.api.murf.ai/v1/speech/stream-input`         | 2 |
        | South America (São Paulo) | `wss://sa-east.api.murf.ai/v1/speech/stream-input`    | 2 |
    bindings:
      ws:
        query:
          type: object
          properties:
            api_key:
              type: string
            model:
              $ref: '#/components/schemas/_stream-input_model'
              default: falcon-2
            sample_rate:
              type: integer
              default: 24000
            channel_type:
              type: string
              default: MONO
            format:
              type: string
              default: WAV
        headers:
          type: object
          properties:
            api_key:
              type: string
    publish:
      operationId: subpackage_streamInput.streamInput-publish
      summary: subscribe
      description: Receive messages from the WebSocket (TTS audio response)
      message:
        name: subscribe
        title: subscribe
        description: Receive messages from the WebSocket (TTS audio response)
        payload:
          $ref: '#/components/schemas/StreamInputSubscribe'
    subscribe:
      operationId: subpackage_streamInput.streamInput-subscribe
      summary: publish
      description: Send messages to the WebSocket (TTS request)
      message:
        name: publish
        title: publish
        description: Send messages to the WebSocket (TTS request)
        payload:
          $ref: '#/components/schemas/StreamInputPublish'
servers:
  Default server:
    url: wss://global.api.murf.ai/v1/speech
    protocol: wss
    x-default: true
components:
  schemas:
    _stream-input_model:
      type: string
      enum:
        - falcon-2
      default: falcon-2
      description: >
        Only `falcon-2` is served over WebSocket (aliases `falcon2`,

        `falcon` are accepted, case-insensitive). Gen2 is not available on this
        endpoint.
      title: /stream-input_model
    audioOutput:
      type: object
      properties:
        audio:
          type: string
          description: >
            Base64 encoded audio data. With `format=WAV`, the FIRST chunk of a
            context

            starts with a 44-byte header whose size fields are `0xFFFFFFFF`
            ("length

            unknown, read to end of stream"). Only the first chunk has it: skip
            those

            bytes when concatenating and write a correct header once the length
            is

            known, or request `format=PCM` to avoid the header entirely.
        context_id:
          type:
            - string
            - 'null'
          description: Optional context identifier
        trace_id:
          type: string
          description: Request trace identifier. Quote this in support requests.
      required:
        - audio
      title: audioOutput
    WordTimestamp:
      type: object
      properties:
        word:
          type: string
          description: The spoken word.
        start_s:
          type: number
          format: double
          description: Start time in seconds on the context clock.
        end_s:
          type: number
          format: double
          description: End time in seconds on the context clock.
        start_frame:
          type: integer
          description: >
            Optional. Present when the engine sends them. Shifted with the
            seconds

            so frame position still matches `start_s`.
        end_frame:
          type: integer
          description: >
            Optional. Present when the engine sends them. Shifted with the
            seconds

            so frame position still matches `end_s`.
      required:
        - word
        - start_s
        - end_s
      title: WordTimestamp
    MessagesTimestampOutputTimestamps:
      type: object
      properties:
        words:
          type: array
          items:
            $ref: '#/components/schemas/WordTimestamp'
          description: Word-level timing entries for the current frame.
      required:
        - words
      description: Word-level timing data for the current context.
      title: MessagesTimestampOutputTimestamps
    timestampOutput:
      type: object
      properties:
        timestamps:
          $ref: '#/components/schemas/MessagesTimestampOutputTimestamps'
          description: Word-level timing data for the current context.
        context_id:
          type:
            - string
            - 'null'
          description: Same context as the audio frames.
        trace_id:
          type: string
          description: Same request id as the audio frames.
      required:
        - timestamps
      description: |
        Word timestamps arrive in their own JSON frame, separate from audio.
        Branch on `timestamps` the same way you branch on `audio`, `final`,
        `error`, and `warning`. Frames may arrive between audio chunks. A word
        that does not yet have both a start and an end is omitted; a later frame
        can carry it once it is complete. Several frames may arrive for the same
        stretch of speech. Held words are flushed before that context's `final`
        frame.
      title: timestampOutput
    finalOutput:
      type: object
      properties:
        final:
          type: boolean
          description: >-
            Indicates if the audio is final, you will not receive audio param in
            this message
        context_id:
          type:
            - string
            - 'null'
          description: Optional context identifier
        trace_id:
          type: string
          description: Request trace identifier. Quote this in support requests.
      required:
        - final
      title: finalOutput
    MessagesWarningOutputWarningCode:
      type: string
      enum:
        - INVALID_BUFFER_SIZE
        - INVALID_BUFFER_DELAY
        - INVALID_PREDICTIVE_CHUNKING
        - INVALID_FIELD_TYPE
        - NO_VOICE_CONFIG
        - NO_VOICE_ID
        - TOO_MANY_GENERATION_REQUESTS
        - TEXT_IGNORED_WITH_CLEAR
      description: Stable identifier. Branch on this.
      title: MessagesWarningOutputWarningCode
    warningOutput:
      type: object
      properties:
        warning:
          type: string
          description: Human-readable message. Do not branch on this.
        warning_code:
          $ref: '#/components/schemas/MessagesWarningOutputWarningCode'
          description: Stable identifier. Branch on this.
        context_id:
          type:
            - string
            - 'null'
          description: Optional context identifier
        trace_id:
          type: string
          description: Request trace identifier. Quote this in support requests.
      required:
        - warning
      title: warningOutput
    MessagesErrorOutputErrorCode:
      type: string
      enum:
        - INVALID_VOICE
        - ACTIVE_CONTEXT_LIMIT_EXCEEDED
        - INVALID_JSON
        - INTERNAL_ERROR
      description: Stable identifier. Branch on this.
      title: MessagesErrorOutputErrorCode
    errorOutput:
      type: object
      properties:
        error:
          type: string
          description: Human-readable message. Do not branch on this.
        error_code:
          $ref: '#/components/schemas/MessagesErrorOutputErrorCode'
          description: Stable identifier. Branch on this.
        fatal:
          type: boolean
          description: >
            When true, nothing further will arrive for this context — stop
            waiting.

            Absent means the stream may continue.
        context_id:
          type:
            - string
            - 'null'
          description: Optional context identifier
        trace_id:
          type: string
          description: Request trace identifier. Quote this in support requests.
      required:
        - error
      title: errorOutput
    StreamInputSubscribe:
      oneOf:
        - $ref: '#/components/schemas/audioOutput'
        - $ref: '#/components/schemas/timestampOutput'
        - $ref: '#/components/schemas/finalOutput'
        - $ref: '#/components/schemas/warningOutput'
        - $ref: '#/components/schemas/errorOutput'
      title: StreamInputSubscribe
    MessagesSetVoiceConfigurationOrInitializeContextVoiceConfig:
      type: object
      properties:
        voice_id:
          type: string
          description: |
            Voice to use for TTS. Use
            `GET /v1/speech/voices?model=FALCON` to list supported voices.
        style:
          type: string
          default: Conversational
          description: The style of speech (optional)
        rate:
          type: integer
          default: 0
          description: Speech rate (optional)
        pitch:
          type: integer
          default: 0
          description: Speech pitch (optional)
        volumeOffset:
          type: integer
          minimum: -50
          maximum: 50
          default: 0
          description: |
            Relative loudness adjustment; 0 leaves audio as generated.
        locale:
          type: string
          description: >-
            Specifies the language for the generated audio, enabling a voice to
            speak in multiple languages natively. Valid values: "en-US",
            "en-UK", "es-ES", etc. Use the GET /v1/speed/voices endpoint to
            retrieve the list of available voices and languages.
      title: MessagesSetVoiceConfigurationOrInitializeContextVoiceConfig
    setVoiceConfigurationOrInitializeContext:
      type: object
      properties:
        voice_config:
          $ref: >-
            #/components/schemas/MessagesSetVoiceConfigurationOrInitializeContextVoiceConfig
        context_id:
          type: string
          description: >
            Optional identifier for the context being configured. Use the same
            value

            on subsequent text frames for that context. If omitted,
            `voice_config`

            applies only to text that also omits `context_id` (the default
            context).

            A named context does not inherit this default configuration; text
            sent to

            an unconfigured named context uses the default voice and produces a

            `NO_VOICE_CONFIG` warning.
      required:
        - voice_config
      description: >
        Configures one context. A `context_id` does not alter the voice
        settings;

        it scopes them to the matching context. Named contexts do not inherit
        the

        default context's configuration.
      title: setVoiceConfigurationOrInitializeContext
    MessagesSendTextVoiceConfig:
      type: object
      properties:
        voice_id:
          type: string
          description: |
            Voice to use for TTS. Use
            `GET /v1/speech/voices?model=FALCON` to list supported voices.
        style:
          type: string
          default: Conversational
          description: The style of speech (optional)
        rate:
          type: integer
          default: 0
          description: Speech rate (optional)
        pitch:
          type: integer
          default: 0
          description: Speech pitch (optional)
        volumeOffset:
          type: integer
          minimum: -50
          maximum: 50
          default: 0
          description: |
            Relative loudness adjustment; 0 leaves audio as generated.
        locale:
          type: string
          description: >-
            Specifies the language for the generated audio, enabling a voice to
            speak in multiple languages natively. Valid values: "en-US",
            "en-UK", "es-ES", etc. Use the GET /v1/speed/voices endpoint to
            retrieve the list of available voices and languages.
      title: MessagesSendTextVoiceConfig
    sendText:
      type: object
      properties:
        text:
          type: string
          description: The text to convert to speech
        context_id:
          type: string
          description: >
            Optional identifier for the context receiving this text. Before
            sending

            text to a named context, configure it with a `voice_config` frame
            carrying

            the same value. Named contexts do not inherit voice settings from
            the

            default context or another context. If omitted, the text belongs to
            the

            default context.
        end:
          type: boolean
          default: false
          description: Indicates if this is the end of the text stream (optional)
        voice_config:
          $ref: '#/components/schemas/MessagesSendTextVoiceConfig'
      required:
        - text
      title: sendText
    MessagesSetAdvancedSettingsPredictiveChunking:
      type: string
      enum:
        - strict
        - lenient
      default: strict
      description: >
        How eagerly a sentence is judged complete on ambiguous endings such as

        `2 p.m.` or `the U.S.`. `strict` waits for one more character when the

        boundary is genuinely uncertain; `lenient` takes its best guess and
        starts

        sooner. Unambiguous endings are never delayed in either mode.

        Alias: `predictiveChunking`.
      title: MessagesSetAdvancedSettingsPredictiveChunking
    setAdvancedSettings:
      type: object
      properties:
        min_buffer_size:
          type: integer
          minimum: 0
          maximum: 1000
          default: 100
          description: >
            Flush once this many characters are buffered, even mid-sentence.
            Lower

            reduces latency and risks less natural prosody, because the engine
            renders

            a partial sentence as its own utterance. `0` means "do not wait on
            volume":

            whatever is buffered is sent immediately. Alias: `minBufferSize`.
        max_buffer_delay_in_ms:
          type: integer
          minimum: 0
          maximum: 1000
          default: 300
          description: >
            Upper bound on how long buffered text may wait before synthesis. `0`
            means

            "do not wait on time", the same contract as `min_buffer_size: 0`.
            Setting

            both to `0` is the most aggressive configuration.

            Alias: `maxBufferDelayInMs`.
        predictive_chunking:
          $ref: '#/components/schemas/MessagesSetAdvancedSettingsPredictiveChunking'
          default: strict
          description: >
            How eagerly a sentence is judged complete on ambiguous endings such
            as

            `2 p.m.` or `the U.S.`. `strict` waits for one more character when
            the

            boundary is genuinely uncertain; `lenient` takes its best guess and
            starts

            sooner. Unambiguous endings are never delayed in either mode.

            Alias: `predictiveChunking`.
        add_word_timestamps:
          type: boolean
          default: false
          description: >
            When `true`, Falcon sends each spoken word's start and end on the
            same

            WebSocket as the audio, in its own JSON frame. Times are in seconds.
            The first sentence of each context starts at 0. Each later sentence
            picks up where the last word of the previous sentence ended. Applies
            to

            the whole connection. Only Falcon (`model=falcon-2`) returns
            timestamp

            frames. Not available for Chinese, Japanese, or Korean locales.
            Alias: `addWordTimestamps`.
      description: >
        These knobs are top-level siblings of `text`, not members of
        `voice_config`.

        Nesting them inside `voice_config` fails silently. `add_word_timestamps`

        applies to the whole WebSocket connection once set.
      title: setAdvancedSettings
    clearContext:
      type: object
      properties:
        clear:
          type: boolean
        context_id:
          type: string
      required:
        - clear
        - context_id
      title: clearContext
    StreamInputPublish:
      oneOf:
        - $ref: '#/components/schemas/setVoiceConfigurationOrInitializeContext'
        - $ref: '#/components/schemas/sendText'
        - $ref: '#/components/schemas/setAdvancedSettings'
        - $ref: '#/components/schemas/clearContext'
      title: StreamInputPublish

```