> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta.md).

# Live APIs（Beta）

通过基于 WebRTC 的 Live APIs 实现与 Convai AI 角色的实时、低延迟交互，支持文本、音频和动态上下文通信。

{% hint style="danger" %}
Live API 仅适用于 Enterprise 计划。
{% endhint %}

Convai 的 **Live API** 通过 **WebRTC**实现用户与 AI 角色之间的实时动态交互。\
这些 API 允许您的应用发送和接收 **音频**, **文本**以及其他上下文数据，让用户与 AI 角色之间的对话流畅且响应迅速。

创建角色后，Live API 会自动管理对话输入和上下文响应，确保不同会话中的行为自然且一致。

#### **借助 Live API，您可以：**

* **进行实时对话** — 发送用户文本或语音输入，并实时接收符合上下文的自然回复。
* **以文本和/或音频形式获取回复** — 支持基于文本的聊天和语音对话体验。
* **使用实时模型** — 集成低延迟模型（目前支持 Google Realtime；即将支持 OpenAI），实现高速对话体验。

这些 **Live API** 充当 AI 角色与用户之间的桥梁，支持在 **文本** 和 **语音** 渠道之间进行流畅的双向实时通信。

***

#### 从这里开始

| 页面                                                                                                                                      | 内容                                                              |
| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [连接 API](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/connect-api.md)                              | 如何开启会话，以及可配置的所有选项                                               |
| [使用多角色会话](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/multi-character-sessions.md)                | 创建包含多个角色实例的共享房间、路由轮次并更新角色列表                                     |
| [构建群聊](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/build-a-group-chat.md)                         | 在一个连接中运行受审核的房间，让多个角色回答同一条消息                                     |
| [群聊消息](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/group-chat-messages.md)                        | group-address `group-address` 命令、其响应和错误代码，以及 `turn-complete` 事件 |
| [轮次生命周期和消息顺序](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/turn-lifecycle-and-message-ordering.md) | 机器人轮次的传递方式、可依赖的消息顺序，以及字段存在规则                                    |
| [响应规范和解析](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/response-contract-and-parsing.md)           | 语音、动作和情绪如何分离，以及服务器会从语音回复中移除哪些内容                                 |
| [消息术语表](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/message-glossary.md)                          | 快速了解所有消息类型                                                      |
| [客户端到服务器的消息](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/client-to-server-messages.md)            | 您发送的消息                                                          |
| [服务器到客户端的消息](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/server-to-client-messages.md)            | 您接收的消息                                                          |
| [音频数据（通过数据通道）](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/audio-data-via-data-channel.md)        | 自定义音频处理                                                         |
| [指标](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/metrics.md)                                      | 性能指标与监控                                                         |

{% hint style="info" %}
如果你要从头编写客户端，请先阅读 [回合生命周期与消息顺序](https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta/turn-lifecycle-and-message-ordering.md) 。该文档首先介绍数据通道上的三种信封格式以及顺序保证，这两者涵盖了大多数集成问题。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.convai.com/api-docs/zh/api-can-kao/core-api-reference/live-apis-beta.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
