> This page is for API Reference.

> Sarvam Voice Agents (Samvaad) is a voice AI agent platform for Indian languages: build, test and deploy AI calling agents on your own phone numbers, from ₹3 a minute. Start here: https://docs.sarvam.ai/voice-agents/why-voice-agents.
> For clean Markdown of any page, append `.md` to the page URL.
> For a complete documentation index, see https://docs.sarvam.ai/llms.txt. For a section index, append `/llms.txt` to any section URL (for example https://docs.sarvam.ai/voice-agents/llms.txt).
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# WebSocket

GET /v2/dictate/ws

Live dictation over a WebSocket. For each turn (speech ended by a
pause), Dictate streams the raw transcript while the person speaks, then
sends one finished text (`dictation.final`). For a full example, see the
[Dictate best practices](/api/api-guides-tutorials/dictate/best-practices).

**How a session goes**

1. Connect to `wss://api.sarvam.ai/v2/dictate/ws` with your key in the
   `api-subscription-key` header. A key in the URL query string is refused with
   `403`. Open the socket from your server: a
   browser WebSocket cannot set headers, and a long-lived key must not
   go in a browser or app.
2. Read `session.begin`. If you want, send a `config.update` with
   `style`, `vocabulary`, `context` or `output_rules`.
3. Send audio at about real-time speed. Show `transcript.partial` as a
   preview, then replace the turn with its `dictation.final`.
4. Send `end` and keep reading until `session.end`. If you close the
   socket without `end`, results that are not yet sent are lost.

**Settings**

- `language_code`, `mode`, `model` and the audio settings go in the URL.
  An unknown or wrong URL setting returns HTTP 400 before the upgrade.
- `style`, `vocabulary`, `context` and `output_rules` go in a
  `config.update` message. `keyterms` and `prompt` are refused: use
  `vocabulary` instead.

**Good to know**

- **Turn order:** `utterance_idx` starts at 0 and counts turns. Each kind
  of final message arrives in turn order, but a `transcript.final` for a
  later turn can arrive before the `dictation.final` of an earlier turn.
  Match them by `utterance_idx`. Each turn gets exactly one
  `dictation.final`, also when it fails.
- **Long speech:** with `endpointing=vad`, about 18 to 20 s of speech with
  no pause ends a turn, even inside a word. Each part is finished on its
  own, so a number or URL across the cut is split.
- **No memory between turns:** there is no field for earlier turns. To
  carry a name to later turns, add it to `vocabulary` with
  `config.update` once it is said.
- **Push-to-talk:** use `endpointing=manual` and send `speech_start` and
  `speech_end`.
- **Quiet sockets:** send `ping` during long silences. The socket closes
  after 60 s with no message from you.
- **Recognition:** the socket uses the live recogniser, not the clip
  recogniser, so the same audio can give different words on the two
  routes. A client that reads too slowly can lose `transcript.partial`,
  `vad.*` and `pong` messages, never the final ones.
- **Output:** with `output_rules`, the `output.final` event comes after
  the last `dictation.final` and before `session.end`. The output call can
  take up to 90 s.

**Close codes**

| Code | Meaning |
|---|---|
| `1000` | Normal end, after `end`. |
| `1002` | WebSocket protocol error. |
| `1007` | A text message is not valid UTF-8. |
| `1008` | No message from you for 60 s, or the 3-hour session limit. |
| `1009` | A message is larger than 1 MiB. |
| `1011` | Recognition stopped, or a settings change was not confirmed in 5 s. Also sent with the reason `keepalive ping timeout` when your client stops answering the server's pings, for example because it stopped reading. This happens in under a minute. |
| `1012` | The service is restarting. Dictate finishes your open turns and sends `session.end` when it can. Connect again to continue. |
| `1013` | Recognition is overloaded, or your client did not read messages for 60 s. |

**Note:** This API Reference page is provided for informational purposes only.
The Try It playground may not provide the best experience for streaming audio.
For optimal streaming performance, please use the SDK or implement your own WebSocket client.


Reference: https://docs.sarvam.ai/api-reference/dictate/ws

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: dictateStreaming
  version: subpackage_dictateStreaming.dictateStreaming
  description: >
    Live dictation over a WebSocket. For each turn (speech ended by a

    pause), Dictate streams the raw transcript while the person speaks, then

    sends one finished text (`dictation.final`). For a full example, see the

    [Dictate best practices](/api/api-guides-tutorials/dictate/best-practices).


    **How a session goes**


    1. Connect to `wss://api.sarvam.ai/v2/dictate/ws` with your key in the
       `api-subscription-key` header. A key in the URL query string is refused with
       `403`. Open the socket from your server: a
       browser WebSocket cannot set headers, and a long-lived key must not
       go in a browser or app.
    2. Read `session.begin`. If you want, send a `config.update` with
       `style`, `vocabulary`, `context` or `output_rules`.
    3. Send audio at about real-time speed. Show `transcript.partial` as a
       preview, then replace the turn with its `dictation.final`.
    4. Send `end` and keep reading until `session.end`. If you close the
       socket without `end`, results that are not yet sent are lost.

    **Settings**


    - `language_code`, `mode`, `model` and the audio settings go in the URL.
      An unknown or wrong URL setting returns HTTP 400 before the upgrade.
    - `style`, `vocabulary`, `context` and `output_rules` go in a
      `config.update` message. `keyterms` and `prompt` are refused: use
      `vocabulary` instead.

    **Good to know**


    - **Turn order:** `utterance_idx` starts at 0 and counts turns. Each kind
      of final message arrives in turn order, but a `transcript.final` for a
      later turn can arrive before the `dictation.final` of an earlier turn.
      Match them by `utterance_idx`. Each turn gets exactly one
      `dictation.final`, also when it fails.
    - **Long speech:** with `endpointing=vad`, about 18 to 20 s of speech with
      no pause ends a turn, even inside a word. Each part is finished on its
      own, so a number or URL across the cut is split.
    - **No memory between turns:** there is no field for earlier turns. To
      carry a name to later turns, add it to `vocabulary` with
      `config.update` once it is said.
    - **Push-to-talk:** use `endpointing=manual` and send `speech_start` and
      `speech_end`.
    - **Quiet sockets:** send `ping` during long silences. The socket closes
      after 60 s with no message from you.
    - **Recognition:** the socket uses the live recogniser, not the clip
      recogniser, so the same audio can give different words on the two
      routes. A client that reads too slowly can lose `transcript.partial`,
      `vad.*` and `pong` messages, never the final ones.
    - **Output:** with `output_rules`, the `output.final` event comes after
      the last `dictation.final` and before `session.end`. The output call can
      take up to 90 s.

    **Close codes**


    | Code | Meaning |

    |---|---|

    | `1000` | Normal end, after `end`. |

    | `1002` | WebSocket protocol error. |

    | `1007` | A text message is not valid UTF-8. |

    | `1008` | No message from you for 60 s, or the 3-hour session limit. |

    | `1009` | A message is larger than 1 MiB. |

    | `1011` | Recognition stopped, or a settings change was not confirmed in 5
    s. Also sent with the reason `keepalive ping timeout` when your client stops
    answering the server's pings, for example because it stopped reading. This
    happens in under a minute. |

    | `1012` | The service is restarting. Dictate finishes your open turns and
    sends `session.end` when it can. Connect again to continue. |

    | `1013` | Recognition is overloaded, or your client did not read messages
    for 60 s. |


    **Note:** This API Reference page is provided for informational purposes
    only.

    The Try It playground may not provide the best experience for streaming
    audio.

    For optimal streaming performance, please use the SDK or implement your own
    WebSocket client.
channels:
  /v2/dictate/ws:
    description: >
      Live dictation over a WebSocket. For each turn (speech ended by a

      pause), Dictate streams the raw transcript while the person speaks, then

      sends one finished text (`dictation.final`). For a full example, see the

      [Dictate best
      practices](/api/api-guides-tutorials/dictate/best-practices).


      **How a session goes**


      1. Connect to `wss://api.sarvam.ai/v2/dictate/ws` with your key in the
         `api-subscription-key` header. A key in the URL query string is refused with
         `403`. Open the socket from your server: a
         browser WebSocket cannot set headers, and a long-lived key must not
         go in a browser or app.
      2. Read `session.begin`. If you want, send a `config.update` with
         `style`, `vocabulary`, `context` or `output_rules`.
      3. Send audio at about real-time speed. Show `transcript.partial` as a
         preview, then replace the turn with its `dictation.final`.
      4. Send `end` and keep reading until `session.end`. If you close the
         socket without `end`, results that are not yet sent are lost.

      **Settings**


      - `language_code`, `mode`, `model` and the audio settings go in the URL.
        An unknown or wrong URL setting returns HTTP 400 before the upgrade.
      - `style`, `vocabulary`, `context` and `output_rules` go in a
        `config.update` message. `keyterms` and `prompt` are refused: use
        `vocabulary` instead.

      **Good to know**


      - **Turn order:** `utterance_idx` starts at 0 and counts turns. Each kind
        of final message arrives in turn order, but a `transcript.final` for a
        later turn can arrive before the `dictation.final` of an earlier turn.
        Match them by `utterance_idx`. Each turn gets exactly one
        `dictation.final`, also when it fails.
      - **Long speech:** with `endpointing=vad`, about 18 to 20 s of speech with
        no pause ends a turn, even inside a word. Each part is finished on its
        own, so a number or URL across the cut is split.
      - **No memory between turns:** there is no field for earlier turns. To
        carry a name to later turns, add it to `vocabulary` with
        `config.update` once it is said.
      - **Push-to-talk:** use `endpointing=manual` and send `speech_start` and
        `speech_end`.
      - **Quiet sockets:** send `ping` during long silences. The socket closes
        after 60 s with no message from you.
      - **Recognition:** the socket uses the live recogniser, not the clip
        recogniser, so the same audio can give different words on the two
        routes. A client that reads too slowly can lose `transcript.partial`,
        `vad.*` and `pong` messages, never the final ones.
      - **Output:** with `output_rules`, the `output.final` event comes after
        the last `dictation.final` and before `session.end`. The output call can
        take up to 90 s.

      **Close codes**


      | Code | Meaning |

      |---|---|

      | `1000` | Normal end, after `end`. |

      | `1002` | WebSocket protocol error. |

      | `1007` | A text message is not valid UTF-8. |

      | `1008` | No message from you for 60 s, or the 3-hour session limit. |

      | `1009` | A message is larger than 1 MiB. |

      | `1011` | Recognition stopped, or a settings change was not confirmed in
      5 s. Also sent with the reason `keepalive ping timeout` when your client
      stops answering the server's pings, for example because it stopped
      reading. This happens in under a minute. |

      | `1012` | The service is restarting. Dictate finishes your open turns and
      sends `session.end` when it can. Connect again to continue. |

      | `1013` | Recognition is overloaded, or your client did not read messages
      for 60 s. |


      **Note:** This API Reference page is provided for informational purposes
      only.

      The Try It playground may not provide the best experience for streaming
      audio.

      For optimal streaming performance, please use the SDK or implement your
      own WebSocket client.
    bindings:
      ws:
        query:
          type: object
          properties:
            language_code:
              $ref: '#/components/schemas/dictateStreaming_language_code'
              default: auto
            mode:
              $ref: '#/components/schemas/dictateStreaming_mode'
              default: transcribe
            model:
              type: string
              default: dictate-v1
            endpointing:
              $ref: '#/components/schemas/dictateStreaming_endpointing'
              default: vad
            stream_type:
              $ref: '#/components/schemas/dictateStreaming_stream_type'
              default: balanced
            encoding:
              $ref: '#/components/schemas/dictateStreaming_encoding'
              default: linear16
            sample_rate:
              $ref: '#/components/schemas/dictateStreaming_sample_rate'
              default: 16000
            return_timestamps:
              $ref: '#/components/schemas/dictateStreaming_return_timestamps'
              default: 'false'
            threshold:
              type: string
              default: 0.3
            min_speech_duration_ms:
              type: string
              default: 250
            silence_duration_ms:
              type: string
              default: 1000
            prefix_padding_ms:
              type: string
              default: 300
        headers:
          type: object
          properties:
            Api-Subscription-Key:
              type: string
    publish:
      operationId: subpackage_dictateStreaming.dictateStreaming-publish
      summary: Server messages
      message:
        oneOf:
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-server-0-Dictate
              Session Begin
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-server-1-Dictate
              Config Updated
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-server-2-Dictate
              VAD Events
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-server-3-Dictate
              VAD Events
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-server-4-Dictate
              Partial Transcript
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-server-5-Dictate
              Final Transcript
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-server-6-Dictate
              Final Text
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-server-7-Dictate
              Output Final
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-server-8-Dictate
              Pong
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-server-9-Dictate
              Session End
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-server-10-Dictate
              Error
    subscribe:
      operationId: subpackage_dictateStreaming.dictateStreaming-subscribe
      summary: Client messages
      message:
        oneOf:
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-client-0-Dictate
              Audio Input
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-client-1-Dictate
              Speech Start
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-client-2-Dictate
              Speech End
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-client-3-Dictate
              Flush
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-client-4-Dictate
              Config Update
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-client-5-Dictate
              End Session
          - $ref: >-
              #/components/messages/subpackage_dictateStreaming.dictateStreaming-client-6-Dictate
              Ping
servers:
  Production:
    url: wss://api.sarvam.ai/
    protocol: wss
    x-default: true
components:
  messages:
    subpackage_dictateStreaming.dictateStreaming-server-0-Dictate Session Begin:
      name: Dictate Session Begin
      title: Dictate Session Begin
      description: Receive session.begin after the connection opens
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateSessionBegin'
    subpackage_dictateStreaming.dictateStreaming-server-1-Dictate Config Updated:
      name: Dictate Config Updated
      title: Dictate Config Updated
      description: Receive config.updated after a config.update takes effect
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateConfigUpdated'
    subpackage_dictateStreaming.dictateStreaming-server-2-Dictate VAD Events:
      name: Dictate VAD Events
      title: Dictate VAD Events
      description: Receive speech start and end events (endpointing=vad only)
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateVadSpeechStart'
    subpackage_dictateStreaming.dictateStreaming-server-3-Dictate VAD Events:
      name: Dictate VAD Events
      title: Dictate VAD Events
      description: Receive speech start and end events (endpointing=vad only)
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateVadSpeechEnd'
    subpackage_dictateStreaming.dictateStreaming-server-4-Dictate Partial Transcript:
      name: Dictate Partial Transcript
      title: Dictate Partial Transcript
      description: Receive the live preview of the raw text
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateTranscriptPartial'
    subpackage_dictateStreaming.dictateStreaming-server-5-Dictate Final Transcript:
      name: Dictate Final Transcript
      title: Dictate Final Transcript
      description: Receive the raw text of a turn
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateTranscriptFinal'
    subpackage_dictateStreaming.dictateStreaming-server-6-Dictate Final Text:
      name: Dictate Final Text
      title: Dictate Final Text
      description: Receive the finished text of a turn
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateDictationFinal'
    subpackage_dictateStreaming.dictateStreaming-server-7-Dictate Output Final:
      name: Dictate Output Final
      title: Dictate Output Final
      description: Receive the output made from the whole session
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateOutputFinal'
    subpackage_dictateStreaming.dictateStreaming-server-8-Dictate Pong:
      name: Dictate Pong
      title: Dictate Pong
      description: Receive the answer to a ping
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictatePong'
    subpackage_dictateStreaming.dictateStreaming-server-9-Dictate Session End:
      name: Dictate Session End
      title: Dictate Session End
      description: Receive session.end, the last message after end
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateSessionEnd'
    subpackage_dictateStreaming.dictateStreaming-server-10-Dictate Error:
      name: Dictate Error
      title: Dictate Error
      description: Receive an error
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateError'
    subpackage_dictateStreaming.dictateStreaming-client-0-Dictate Audio Input:
      name: Dictate Audio Input
      title: Dictate Audio Input
      description: Send an audio chunk for live dictation
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateAudioInput'
    subpackage_dictateStreaming.dictateStreaming-client-1-Dictate Speech Start:
      name: Dictate Speech Start
      title: Dictate Speech Start
      description: Start a turn (endpointing=manual only)
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateSpeechStart'
    subpackage_dictateStreaming.dictateStreaming-client-2-Dictate Speech End:
      name: Dictate Speech End
      title: Dictate Speech End
      description: End the turn (endpointing=manual only)
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateSpeechEnd'
    subpackage_dictateStreaming.dictateStreaming-client-3-Dictate Flush:
      name: Dictate Flush
      title: Dictate Flush
      description: End the turn, same as speech_end
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateFlush'
    subpackage_dictateStreaming.dictateStreaming-client-4-Dictate Config Update:
      name: Dictate Config Update
      title: Dictate Config Update
      description: Change style, vocabulary, context or other session settings
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateConfigUpdate'
    subpackage_dictateStreaming.dictateStreaming-client-5-Dictate End Session:
      name: Dictate End Session
      title: Dictate End Session
      description: Finish the open turn and end the session
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictateEnd'
    subpackage_dictateStreaming.dictateStreaming-client-6-Dictate Ping:
      name: Dictate Ping
      title: Dictate Ping
      description: Keep a quiet socket open
      payload:
        $ref: '#/components/schemas/dictateStreaming_dictatePing'
  schemas:
    dictateStreaming_language_code:
      type: string
      enum:
        - auto
        - hi-IN
        - bn-IN
        - kn-IN
        - ml-IN
        - mr-IN
        - or-IN
        - pa-IN
        - ta-IN
        - te-IN
        - en-IN
        - gu-IN
        - as-IN
        - ur-IN
        - ne-IN
        - kok-IN
        - ks-IN
        - sd-IN
        - sa-IN
        - sat-IN
        - mni-IN
        - brx-IN
        - mai-IN
        - doi-IN
      default: auto
      description: |
        Language of the audio. `auto` (default) detects Hindi, Bengali,
        Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, Telugu, English
        and Gujarati. For the other languages, send the code. Codes are
        case-sensitive; Odia is `or-IN`.

        - `auto`: Detect the language
        - `hi-IN`: Hindi
        - `bn-IN`: Bengali
        - `kn-IN`: Kannada
        - `ml-IN`: Malayalam
        - `mr-IN`: Marathi
        - `or-IN`: Odia
        - `pa-IN`: Punjabi
        - `ta-IN`: Tamil
        - `te-IN`: Telugu
        - `en-IN`: English
        - `gu-IN`: Gujarati
        - `as-IN`: Assamese
        - `ur-IN`: Urdu
        - `ne-IN`: Nepali
        - `kok-IN`: Konkani
        - `ks-IN`: Kashmiri
        - `sd-IN`: Sindhi
        - `sa-IN`: Sanskrit
        - `sat-IN`: Santali
        - `mni-IN`: Manipuri
        - `brx-IN`: Bodo
        - `mai-IN`: Maithili
        - `doi-IN`: Dogri
      title: dictateStreaming_language_code
    dictateStreaming_mode:
      type: string
      enum:
        - transcribe
        - verbatim
        - translit
        - codemix
      default: transcribe
      description: >
        Script of the finished text and how literal it is.


        - **transcribe** (default): Keeps the script that speech recognition
        wrote.

        - **verbatim**: Keeps every sound, filler and repeat, and keeps numbers
        as words. Use it for exact records.

        - **translit**: Writes everything in Latin letters. Use it for apps that
        show Latin letters only.

        - **codemix**: Writes the language in its own script, and English words
        and names in Latin letters, the way people type Hinglish or Tanglish.
      title: dictateStreaming_mode
    dictateStreaming_endpointing:
      type: string
      enum:
        - vad
        - manual
      default: vad
      description: |
        How turns end. Fixed for the session.

        - **vad** (default): Dictate finds the end of each turn.
        - **manual**: You send `speech_start` and `speech_end`.
      title: dictateStreaming_endpointing
    dictateStreaming_stream_type:
      type: string
      enum:
        - fast
        - balanced
        - simulated
      default: balanced
      description: >
        Latency of the live preview.


        - **fast**: Partials at low latency. Each audio message can hold at most
        0.5 s.

        - **balanced** (default): Partials with better accuracy.

        - **simulated**: No partials.
      title: dictateStreaming_stream_type
    dictateStreaming_encoding:
      type: string
      enum:
        - linear16
        - linear32
        - mulaw
        - alaw
      default: linear16
      description: |
        Encoding of the raw audio you send. **Mono only**, with no file
        header. `linear16` is signed 16-bit little-endian.
      title: dictateStreaming_encoding
    dictateStreaming_sample_rate:
      type: string
      enum:
        - '16000'
        - '8000'
      description: >-
        Sample rate of the audio in Hz. Must match the audio. Dictate does not
        check it and measures the audio at the rate you declare, so 16 kHz audio
        sent as 8000 raises no error, the text is wrong, and the billed seconds
        double. Other values are refused when you connect (400).
      title: dictateStreaming_sample_rate
    dictateStreaming_return_timestamps:
      type: string
      enum:
        - 'true'
        - 'false'
      default: 'false'
      description: When `true`, adds `start_s` and `end_s` to `transcript.final`.
      title: dictateStreaming_return_timestamps
    ChannelsDictateStreamingMessagesDictateSessionBeginEvent:
      type: string
      enum:
        - session.begin
      title: ChannelsDictateStreamingMessagesDictateSessionBeginEvent
    dictateStreaming_dictateSessionBegin:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateSessionBeginEvent
        request_id:
          type: string
          description: ID for this session. Send it to support when you report a problem.
        config:
          type: object
          additionalProperties:
            description: Any type
          description: The settings in effect for the session, including `model`
      required:
        - event
        - request_id
      description: First message after the connection opens.
      title: dictateStreaming_dictateSessionBegin
    ChannelsDictateStreamingMessagesDictateConfigUpdatedEvent:
      type: string
      enum:
        - config.updated
      title: ChannelsDictateStreamingMessagesDictateConfigUpdatedEvent
    dictateStreaming_dictateConfigUpdated:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateConfigUpdatedEvent
        applied:
          type: array
          items:
            type: string
          description: The fields that were changed
        config:
          type: object
          additionalProperties:
            description: Any type
          description: The settings now in effect, including `model`
      required:
        - event
        - applied
      description: Sent after a `config.update` takes effect.
      title: dictateStreaming_dictateConfigUpdated
    ChannelsDictateStreamingMessagesDictateVadSpeechStartEvent:
      type: string
      enum:
        - vad.speech_start
      title: ChannelsDictateStreamingMessagesDictateVadSpeechStartEvent
    dictateStreaming_dictateVadSpeechStart:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateVadSpeechStartEvent
        utterance_idx:
          type: integer
          description: Zero-based turn counter
        confidence:
          type: string
          title: float
      required:
        - event
        - utterance_idx
      description: Speech started (endpointing=vad only).
      title: dictateStreaming_dictateVadSpeechStart
    ChannelsDictateStreamingMessagesDictateVadSpeechEndEvent:
      type: string
      enum:
        - vad.speech_end
      title: ChannelsDictateStreamingMessagesDictateVadSpeechEndEvent
    dictateStreaming_dictateVadSpeechEnd:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateVadSpeechEndEvent
        utterance_idx:
          type: integer
          description: Zero-based turn counter
        confidence:
          type: string
          title: float
      required:
        - event
        - utterance_idx
      description: Speech ended (endpointing=vad only).
      title: dictateStreaming_dictateVadSpeechEnd
    ChannelsDictateStreamingMessagesDictateTranscriptPartialEvent:
      type: string
      enum:
        - transcript.partial
      title: ChannelsDictateStreamingMessagesDictateTranscriptPartialEvent
    dictateStreaming_dictateTranscriptPartial:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateTranscriptPartialEvent
        utterance_idx:
          type: integer
          description: Zero-based turn counter
        text:
          type: string
          description: Raw text so far
        language_code:
          type: string
          description: >-
            The detected language. Sent with `endpointing=vad` and
            `language_code=auto`.
        confidence:
          type: string
          title: float
          description: >-
            Detection confidence, when known. Sent with `endpointing=vad` and
            `language_code=auto`.
      required:
        - event
        - utterance_idx
        - text
      description: |
        Live preview of the raw text of the current turn. Dictate can drop
        partials when your client reads too slowly.
      title: dictateStreaming_dictateTranscriptPartial
    ChannelsDictateStreamingMessagesDictateTranscriptFinalEvent:
      type: string
      enum:
        - transcript.final
      title: ChannelsDictateStreamingMessagesDictateTranscriptFinalEvent
    dictateStreaming_dictateTranscriptFinal:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateTranscriptFinalEvent
        utterance_idx:
          type: integer
          description: Zero-based turn counter
        text:
          type: string
          description: Raw transcript of the turn
        language_code:
          type: string
          description: The language of the turn
        language_confidence:
          type: string
          title: float
          description: >-
            Detection confidence, from 0 to 1. Sent with `endpointing=vad` and
            `language_code=auto`.
        start_s:
          type: string
          title: float
          description: >-
            Start of the turn, in seconds from the start of the stream. Present
            with `return_timestamps=true`.
        end_s:
          type: string
          title: float
          description: >-
            End of the turn, in seconds from the start of the stream. Present
            with `return_timestamps=true`.
      required:
        - event
        - utterance_idx
        - text
      description: The raw text of a turn. Dictate does not change this text.
      title: dictateStreaming_dictateTranscriptFinal
    ChannelsDictateStreamingMessagesDictateDictationFinalEvent:
      type: string
      enum:
        - dictation.final
      title: ChannelsDictateStreamingMessagesDictateDictationFinalEvent
    DictateStreamingCorrectionSource:
      type: string
      enum:
        - vocabulary
        - reference
      title: DictateStreamingCorrectionSource
    DictateStreamingCorrection:
      type: object
      properties:
        heard:
          type: string
          description: What speech recognition wrote
        wrote:
          type: string
          description: What the finished text has
        source:
          $ref: '#/components/schemas/DictateStreamingCorrectionSource'
      required:
        - heard
        - wrote
        - source
      description: A change that Dictate made from your vocabulary or reference.
      title: DictateStreamingCorrection
    ChannelsDictateStreamingMessagesDictateDictationFinalDegraded:
      type: string
      enum:
        - llm_timeout
        - llm_error
        - llm_guard_failed
        - llm_context_limit
        - asr_error
        - asr_timeout
      description: >
        Null when the finishing step succeeded. Otherwise why it did not:


        - `llm_timeout`: The finishing step took longer than 45 s.

        - `llm_error`: The finishing model failed or is not available.

        - `llm_guard_failed`: The model's answer failed the output check: empty,
        over 64 KB, a label the speaker did not say, or much longer than what
        was said.

        - `llm_context_limit`: The inputs are too large for the model. Send less
        `rules`, `vocabulary` or `context`.

        - `asr_error`: Speech recognition failed for this turn. `text` is empty.

        - `asr_timeout`: Speech recognition did not finish for this turn. `text`
        is empty.
      title: ChannelsDictateStreamingMessagesDictateDictationFinalDegraded
    DictateStreamingUsage:
      type: object
      properties:
        audio_duration_s:
          type: string
          title: float
          description: |
            Audio length in seconds. With `endpointing=manual`, from
            `speech_start` to `speech_end` of the turn. With `endpointing=vad`,
            from the end of the last turn to the end of this turn, so silence
            between turns is included. A degraded turn shows 0 and is not
            billed. Audio that Dictate lost is not included. In `session.end`,
            the billed total for the session, which also covers audio after the
            last turn with `endpointing=vad`.
        words:
          type: integer
          description: Words in the raw transcript
        llm_input_tokens:
          type:
            - integer
            - 'null'
          description: >-
            Tokens sent to the finishing model. Null if the model did not report
            them.
        llm_output_tokens:
          type:
            - integer
            - 'null'
          description: >-
            Tokens from the finishing model. Null if the model did not report
            them.
      required:
        - words
      description: |
        Usage for a turn, or the billed total for the session in `session.end`.
        Do not add the session total to the usage of each turn. With
        `output_rules`, the output's tokens are included in the `session.end`
        token counts.
      title: DictateStreamingUsage
    dictateStreaming_dictateDictationFinal:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateDictationFinalEvent
        utterance_idx:
          type: integer
          description: Zero-based turn counter. Match it to `transcript.final`.
        model:
          type: string
          description: >-
            The snapshot that made this result, for example
            `dictate-v1-2026-11-04`
        text:
          type: string
          description: >-
            The finished text. If `degraded` is set, the raw transcript, or
            empty for `asr_error` and `asr_timeout`.
        corrections:
          type: array
          items:
            $ref: '#/components/schemas/DictateStreamingCorrection'
          description: The vocabulary and reference changes that were applied
        degraded:
          oneOf:
            - $ref: >-
                #/components/schemas/ChannelsDictateStreamingMessagesDictateDictationFinalDegraded
            - type: 'null'
          description: >
            Null when the finishing step succeeded. Otherwise why it did not:


            - `llm_timeout`: The finishing step took longer than 45 s.

            - `llm_error`: The finishing model failed or is not available.

            - `llm_guard_failed`: The model's answer failed the output check:
            empty, over 64 KB, a label the speaker did not say, or much longer
            than what was said.

            - `llm_context_limit`: The inputs are too large for the model. Send
            less `rules`, `vocabulary` or `context`.

            - `asr_error`: Speech recognition failed for this turn. `text` is
            empty.

            - `asr_timeout`: Speech recognition did not finish for this turn.
            `text` is empty.
        language_code:
          type: string
          description: The language of the turn
        usage:
          $ref: '#/components/schemas/DictateStreamingUsage'
      required:
        - event
        - utterance_idx
        - model
        - text
        - corrections
      description: |
        The finished text of a turn. Every turn gets exactly one, also when it
        fails: a failed turn has empty `text`, a `degraded` value and an `error`
        message. A short noise can open a turn with empty `text` and `degraded`
        null.
      title: dictateStreaming_dictateDictationFinal
    ChannelsDictateStreamingMessagesDictateOutputFinalEvent:
      type: string
      enum:
        - output.final
      title: ChannelsDictateStreamingMessagesDictateOutputFinalEvent
    ChannelsDictateStreamingMessagesDictateOutputFinalDegraded:
      type: string
      enum:
        - llm_timeout
        - llm_error
        - llm_context_limit
        - llm_length
        - asr_incomplete
      description: >
        Null for a complete output. Otherwise why it is not complete:


        - `llm_timeout`: The output call took longer than 90 s.

        - `llm_error`: The model failed or is not available.

        - `llm_context_limit`: The inputs are too large for the model.

        - `llm_length`: The output reached the limit of 6,000 tokens. `text` has
        the part the model wrote.

        - `asr_incomplete`: Some turns had no raw transcript, or the session
        transcript reached 1 MB. The output used the rest.
      title: ChannelsDictateStreamingMessagesDictateOutputFinalDegraded
    ChannelsDictateStreamingMessagesDictateOutputFinalUsage:
      type: object
      properties:
        llm_input_tokens:
          type:
            - integer
            - 'null'
          description: >-
            Tokens sent to the model for this output. Null if the model did not
            report them.
        llm_output_tokens:
          type:
            - integer
            - 'null'
          description: >-
            Tokens the model wrote for this output. Null if the model did not
            report them.
      title: ChannelsDictateStreamingMessagesDictateOutputFinalUsage
    dictateStreaming_dictateOutputFinal:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateOutputFinalEvent
        text:
          type:
            - string
            - 'null'
          description: |
            The output as written. JSON comes back as a string: parse it
            yourself. In a JSON output, a string value that is only the word
            "null" (any case, spaces around it) comes back as JSON `null`.
            Null when the call gave no usable text (see `degraded`).
        degraded:
          oneOf:
            - $ref: >-
                #/components/schemas/ChannelsDictateStreamingMessagesDictateOutputFinalDegraded
            - type: 'null'
          description: >
            Null for a complete output. Otherwise why it is not complete:


            - `llm_timeout`: The output call took longer than 90 s.

            - `llm_error`: The model failed or is not available.

            - `llm_context_limit`: The inputs are too large for the model.

            - `llm_length`: The output reached the limit of 6,000 tokens. `text`
            has the part the model wrote.

            - `asr_incomplete`: Some turns had no raw transcript, or the session
            transcript reached 1 MB. The output used the rest.
        usage:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateOutputFinalUsage
      required:
        - event
      description: |
        The output made from the whole session with `output_rules`. Sent once,
        after the last `dictation.final` and before `session.end`, only when
        `output_rules` is set when you send `end`.
      title: dictateStreaming_dictateOutputFinal
    ChannelsDictateStreamingMessagesDictatePongEvent:
      type: string
      enum:
        - pong
      title: ChannelsDictateStreamingMessagesDictatePongEvent
    dictateStreaming_dictatePong:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictatePongEvent
      required:
        - event
      description: Answer to `ping`.
      title: dictateStreaming_dictatePong
    ChannelsDictateStreamingMessagesDictateSessionEndEvent:
      type: string
      enum:
        - session.end
      title: ChannelsDictateStreamingMessagesDictateSessionEndEvent
    dictateStreaming_dictateSessionEnd:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateSessionEndEvent
        request_id:
          type: string
          description: ID for this session
        total_duration_s:
          type: string
          title: float
          description: Length of the session, in seconds
        total_utterances:
          type: integer
          description: Number of turns in the session
        audio_received_s:
          type: string
          title: float
          description: Seconds of audio that Dictate received
        usage:
          $ref: '#/components/schemas/DictateStreamingUsage'
      required:
        - event
        - request_id
      description: Last message after `end`.
      title: dictateStreaming_dictateSessionEnd
    ChannelsDictateStreamingMessagesDictateErrorEvent:
      type: string
      enum:
        - error
      title: ChannelsDictateStreamingMessagesDictateErrorEvent
    dictateStreaming_dictateError:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateErrorEvent
        code:
          type: string
          description: Machine-readable error code
        message:
          type: string
          description: Description for people. Use `code` in your program.
        is_fatal:
          type: boolean
          description: Whether Dictate closes the socket after this error
        stage:
          type: string
          description: The part of the pipeline where the error happened
        utterance_idx:
          type: integer
          description: The turn that failed, for a turn error
        start_s:
          type: string
          title: float
          description: >-
            For `audio_lost`, start of the lost audio, in seconds from the start
            of the session's audio
        end_s:
          type: string
          title: float
          description: >-
            For `audio_lost`, end of the lost audio, in seconds from the start
            of the session's audio
      required:
        - event
        - code
        - message
        - is_fatal
      description: >
        An error. If `is_fatal` is `true`, Dictate then closes the socket. It
        can send `session.end` first. After `inactivity_timeout`, for example,
        Dictate sends `session.end` and then closes with 1008.


        **Errors that keep the socket open** (`is_fatal` is `false`)


        | `code` | Cause |

        |---|---|

        | `invalid_json` | The message is not JSON. |

        | `invalid_event` | Unknown `event`. |

        | `invalid_audio` | Bad base64, or not a whole number of samples. |

        | `chunk_too_large` | More than 1 s of audio in one message. |

        | `invalid_control` | `speech_start`, `speech_end` or `flush` with
        `endpointing=vad`. |

        | `invalid_config` | A `config.update` was refused and nothing changed.
        This includes a change of `endpointing` or `model`, and `style.prefix`
        or `style.suffix`. |

        | `audio_lost` | Audio did not reach speech recognition. `start_s` and
        `end_s` give the lost part, which is not in the text and not billed. |

        | `asr_error`, `asr_timeout` | Recognition failed for one turn. Later
        turns continue. |


        **Errors that close the socket** (`is_fatal` is `true`)


        | `code` | Close code | Cause |

        |---|---|---|

        | `asr_error` | `1011` | Recognition stopped and could not reconnect. |

        | `config_unconfirmed` | `1011` | A settings change was not confirmed in
        5 s. |

        | `model_overloaded` | `1013` | Recognition is overloaded. |

        | `inactivity_timeout` | `1008` | No message from you for 60 s. |

        | `session_time_limit_exceeded` | `1008` | The session reached 3 hours.
        |
      title: dictateStreaming_dictateError
    ChannelsDictateStreamingMessagesDictateAudioInputEvent:
      type: string
      enum:
        - audio_input
      default: audio_input
      title: ChannelsDictateStreamingMessagesDictateAudioInputEvent
    dictateStreaming_dictateAudioInput:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateAudioInputEvent
        audio:
          type: string
          format: base64
          description: Raw audio samples (no file header), base64-encoded
      required:
        - event
        - audio
      description: Audio as a base64-encoded string.
      title: dictateStreaming_dictateAudioInput
    ChannelsDictateStreamingMessagesDictateSpeechStartEvent:
      type: string
      enum:
        - speech_start
      default: speech_start
      title: ChannelsDictateStreamingMessagesDictateSpeechStartEvent
    dictateStreaming_dictateSpeechStart:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateSpeechStartEvent
      required:
        - event
      description: Starts a turn (endpointing=manual only).
      title: dictateStreaming_dictateSpeechStart
    ChannelsDictateStreamingMessagesDictateSpeechEndEvent:
      type: string
      enum:
        - speech_end
      default: speech_end
      title: ChannelsDictateStreamingMessagesDictateSpeechEndEvent
    dictateStreaming_dictateSpeechEnd:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateSpeechEndEvent
      required:
        - event
      description: Ends the turn (endpointing=manual only).
      title: dictateStreaming_dictateSpeechEnd
    ChannelsDictateStreamingMessagesDictateFlushEvent:
      type: string
      enum:
        - flush
      default: flush
      title: ChannelsDictateStreamingMessagesDictateFlushEvent
    dictateStreaming_dictateFlush:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateFlushEvent
      required:
        - event
      description: Ends the turn. Same as `speech_end`.
      title: dictateStreaming_dictateFlush
    ChannelsDictateStreamingMessagesDictateConfigUpdateEvent:
      type: string
      enum:
        - config.update
      default: config.update
      title: ChannelsDictateStreamingMessagesDictateConfigUpdateEvent
    DictateStreamingStylePreset:
      type: string
      enum:
        - none
        - light
        - clean
      description: >
        How much the finishing step changes the text.


        - `none`: No finishing step. `text` is the raw transcript; `rules` and
        `vocabulary` are not applied. Speech recognition already writes
        punctuation and capital letters, and outside `verbatim` it writes
        digits, so this text has them too.

        - `light`: Keeps every word, fillers and repeats too. Adds punctuation
        and casing, writes numbers as digits, and spells your vocabulary. In
        Indian languages, `light` does not always write digits.

        - `clean`: Does what `light` does, and also removes fillers, repeats,
        false starts and the first version of a self-correction.


        If you leave it out, `verbatim` mode uses `light` and the other modes
        use `clean`.
      title: DictateStreamingStylePreset
    DictateStreamingStyle:
      type: object
      properties:
        preset:
          $ref: '#/components/schemas/DictateStreamingStylePreset'
          description: >
            How much the finishing step changes the text.


            - `none`: No finishing step. `text` is the raw transcript; `rules`
            and `vocabulary` are not applied. Speech recognition already writes
            punctuation and capital letters, and outside `verbatim` it writes
            digits, so this text has them too.

            - `light`: Keeps every word, fillers and repeats too. Adds
            punctuation and casing, writes numbers as digits, and spells your
            vocabulary. In Indian languages, `light` does not always write
            digits.

            - `clean`: Does what `light` does, and also removes fillers,
            repeats, false starts and the first version of a self-correction.


            If you leave it out, `verbatim` mode uses `light` and the other
            modes use `clean`.
        rules:
          type: string
          maxLength: 2000
          description: |
            Your formatting rules in plain language, up to 2,000 characters.
            Rules can change the layout, casing, number format and script, or
            translate the text. Do not ask for new content, a whole-session
            structure or shorter text; use `output_rules` for those. Send `""`
            to clear the rules. `style.preset` does not accept `""`.
      description: |
        How the finished text is written. Only the members you send change;
        send `""` to clear `rules`. `prefix` and `suffix` are not accepted: an
        update that sends them is refused with `invalid_config`. Line breaks and
        lists come only where the speaker says them or where a rule asks for
        them, and are made inside each turn.
      title: DictateStreamingStyle
    DictateStreamingVocabularyEntry:
      type: object
      properties:
        word:
          type: string
          minLength: 1
          maxLength: 64
          description: >-
            The exact spelling to write, in the script that the finished text
            uses.
        sounds_like:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 64
          description: >-
            Up to 5 ways speech recognition writes the term wrong. Add only
            misspellings that you have seen in the raw transcript. Each form
            belongs to one word only, and letter case is ignored: a form that is
            also listed for an entry with a different word gives an
            invalid_config error that names both entries. Entries with the same
            word are not refused.
        description:
          type: string
          maxLength: 200
          description: What the term is. Optional. A term is applied without it.
      required:
        - word
      description: A name or term the speaker can say.
      title: DictateStreamingVocabularyEntry
    DictateStreamingContext:
      type: object
      properties:
        text:
          type: string
          maxLength: 2000
          description: >-
            A description of the situation. Background for the model. It can
            sometimes change how a name is spelled, but not reliably, and the
            change is not listed in `corrections`. For names that must be right,
            use `vocabulary` or `reference`.
        reference:
          type: string
          maxLength: 50000
          description: >-
            A document with names and terms that can occur, up to 50,000
            characters. Dictate takes terms from it and uses them like
            vocabulary. This is text, not a URL.
      description: >-
        Background that helps Dictate resolve unclear words. Only the members
        you send change; send `""` to clear one.
      title: DictateStreamingContext
    ChannelsDictateStreamingMessagesDictateConfigUpdateMode:
      type: string
      enum:
        - transcribe
        - verbatim
        - translit
        - codemix
      title: ChannelsDictateStreamingMessagesDictateConfigUpdateMode
    ChannelsDictateStreamingMessagesDictateConfigUpdateStreamType:
      type: string
      enum:
        - fast
        - balanced
      title: ChannelsDictateStreamingMessagesDictateConfigUpdateStreamType
    dictateStreaming_dictateConfigUpdate:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateConfigUpdateEvent
        style:
          $ref: '#/components/schemas/DictateStreamingStyle'
        vocabulary:
          type: array
          items:
            $ref: '#/components/schemas/DictateStreamingVocabularyEntry'
          description: Up to 1,000 names and terms. Replaces the whole list.
        context:
          $ref: '#/components/schemas/DictateStreamingContext'
        output_rules:
          type: string
          maxLength: 4000
          description: |
            Asks for one output made from the whole session, for example a
            summary or a JSON record, up to 4,000 characters. An empty string,
            or a string of only spaces, turns the output off. The output is made
            by one model call that reads these rules and the whole finished text
            (the raw transcript for a turn that is `degraded`).
        language_code:
          type: string
          description: Language of the audio, as in the `language_code` URL setting.
        mode:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateConfigUpdateMode
        stream_type:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictateConfigUpdateStreamType
      required:
        - event
      description: >
        Changes session settings. Dictate checks the whole update: if one part

        is wrong, nothing changes and you get an `invalid_config` error. Wait

        for `config.updated` before you send the next `config.update`. An update
        that

        changes nothing returns `invalid_config`, and so does a `style` or
        `context`

        that is not a JSON object.


        - `context` and `style` change only the members you send. Send `""` to
        clear a member.

        - `vocabulary` replaces the whole list. Send `[]` to clear it.

        - `context`, `vocabulary` and `style` apply from the turn that ends
        next.

        - `output_rules` replaces the current value. The value set when you send
        `end` applies.

        - `language_code`, `mode` and `stream_type` change only between turns.

        - `endpointing` and `model` cannot change. An update that sends them is
        refused.

        - `stream_type` cannot change to or from `simulated`.
      title: dictateStreaming_dictateConfigUpdate
    ChannelsDictateStreamingMessagesDictateEndEvent:
      type: string
      enum:
        - end
      default: end
      title: ChannelsDictateStreamingMessagesDictateEndEvent
    dictateStreaming_dictateEnd:
      type: object
      properties:
        event:
          $ref: '#/components/schemas/ChannelsDictateStreamingMessagesDictateEndEvent'
      required:
        - event
      description: >-
        Finishes the open turn, sends the last results and `session.end`, then
        closes. After `end`, only read the remaining messages until
        `session.end`.
      title: dictateStreaming_dictateEnd
    ChannelsDictateStreamingMessagesDictatePingEvent:
      type: string
      enum:
        - ping
      default: ping
      title: ChannelsDictateStreamingMessagesDictatePingEvent
    dictateStreaming_dictatePing:
      type: object
      properties:
        event:
          $ref: >-
            #/components/schemas/ChannelsDictateStreamingMessagesDictatePingEvent
      required:
        - event
      description: Keepalive ping. Dictate answers `pong`.
      title: dictateStreaming_dictatePing

```