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

# Realtime 连接

> <ul><li>建立 WebSocket 连接用于实时对话。</li><li>**注意**: 这是一个 WebSocket 端点，需要使用 WebSocket 协议连接。</li><li>连接 URL 示例: `wss://api.elkapi.com/v1/realtime?model=gpt-5.5`</li></ul>

<RequestExample>
  ```bash cURL theme={null} theme={null}
  curl --request GET \
    --url 'https://api.elkapi.com/v1/realtime?model=gpt-5.5' \
    --header 'Authorization: Bearer <token>'
  ```

  ```python Python theme={null} theme={null}
  import requests

  url = "https://api.elkapi.com/v1/realtime?model=gpt-5.5"
  headers = {
      "Authorization": "Bearer <token>"
  }

  response = requests.request("GET", url, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null} theme={null}
  const url = "https://api.elkapi.com/v1/realtime?model=gpt-5.5";

  const headers = {
    "Authorization": "Bearer <token>"
  };

  const response = await fetch(url, { method: "GET", headers });
  console.log(await response.json());
  ```
</RequestExample>

<ResponseExample>
  ```json 400 theme={null} theme={null}
  {
    "error": {
      "message": "message",
      "type": "type",
      "param": "param",
      "code": "code"
    }
  }
  ```
</ResponseExample>

## Authorizations

<ParamField header="Authorization" type="string" required>
  所有接口均需要使用 Bearer Token 进行认证。

  在请求头中添加：

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Query Parameters

<ParamField query="model" type="string" default="gpt-5.5">
  要使用的模型

  示例：`gpt-5.5`
</ParamField>
