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

# Lingopal WebSocket Client

> Learn how to use the Lingopal WebSocket client to connect to transcription services and receive real-time messages.

## Run the example WebSocket client script:

```bash theme={null}
python examples/run_client.py <stream_id> <api_key>
```

## Arguments:

* **`<stream_id>`**: The stream UUID you get from Lingopal
* **`<api_key>`**: Your Lingopal API key
* **`[env]`** (optional):
  * `prod` (default): connect to production

## Example

```bash theme={null}
python examples/run_client.py 0684xxxx-xxxx-xxxx-xxxx a9e12xxxxxxx
```

## This will:

* Connect to the transcription WebSocket server
* Print any messages received from the server

## Notes

* The client uses the `websockets` library
* If connection fails due to a missing header argument, make sure you're using `websockets>=11.0`
* Example script is located at `examples/run_client.py`

## Usage

The WebSocket client allows you to receive real-time transcription data from your active streams. This is useful for:

* Real-time captioning applications
* Live translation services
* Stream monitoring and analytics
* Interactive applications that need immediate transcript updates

## Connection Details

The WebSocket client automatically handles:

* Authentication using your API key
* Connection to the appropriate environment (production by default)
* Message parsing and formatting
* Error handling and reconnection logic

For more information about the WebSocket protocol and message formats, see the [Introduction](/api-reference/endpoint/introduction) documentation.

## Getting Help

* Visit our [GitHub repository](https://github.com/lingopal-ai/lingopal-reference) for the latest code and issues
