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

# Generic WebSocket

> Connect any WebSocket client — telephony, server-to-server, or custom integrations — to your Pipecat Cloud agents

The generic WebSocket endpoint is a protocol-agnostic way to connect a WebSocket client to your Pipecat Cloud agent. Unlike the provider-specific endpoints (`/ws/twilio`, `/ws/plivo`, etc.), it imposes no protocol requirements. Messages are relayed directly between the client and your bot without validation or transformation.

## When to Use

* **Telephony providers**: Connect any telephony provider that supports WebSocket audio streaming.
* **Server-to-server integrations**: Connect your own backend or a third-party platform over WebSocket.
* **Custom WebSocket clients**: Any client that can establish a WebSocket connection.

<Note>
  **Web and mobile clients**: Browsers and mobile apps can connect via
  WebSocket, but we recommend WebRTC instead. WebRTC handles varying network
  conditions, media quality, and reconnect behavior better than raw WebSocket.
  See the [Daily WebRTC guide](/pipecat-cloud/guides/daily-webrtc) or the
  SmallWebRTC [client SDKs](/client/js/introduction) for recommended web and
  mobile options.
</Note>

## Endpoint

```
wss://{region}.api.pipecat.daily.co/ws/generic/{agentName}.{organizationName}
```

The service host (`{agentName}.{organizationName}`) can also be provided as a query parameter:

```
wss://{region}.api.pipecat.daily.co/ws/generic?serviceHost={agentName}.{organizationName}
```

## Authentication

The generic endpoint supports optional HMAC token authentication, controlled by the `websocket_auth` setting on your agent. See the [WebSocket Authentication guide](/pipecat-cloud/guides/websocket-authentication) for details on how to configure and use token authentication.

When `websocket_auth` is set to `none`, clients can connect directly without a token:

```bash theme={null}
wscat -c "wss://us-west.api.pipecat.daily.co/ws/generic/my-agent.my-org"
```

## Message Format

The generic endpoint supports both text and binary WebSocket frames. Your bot receives messages exactly as sent by the client — no protocol-specific parsing or transformation is applied.

Your bot code is responsible for handling the client's message format. Use the appropriate [serializer](/api-reference/server/services/serializers/introduction) for your client's protocol, or implement custom message handling for non-standard clients.
