> 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/interaction-apis.md).

# 交互 API

使用 Convai 的交互 API，实现与 AI 角色的实时交互，以自然的文本和语音方式进行通信。

该 **交互 API** 可实现用户与您的 AI 角色之间的实时动态交互。\
当您的角色上线后，这些 API 会处理对话输入和上下文响应。

借助这些 API，你可以：

* **进行实时对话** — 发送用户文本或语音输入，并接收具上下文的自然回复。
* **以文本和/或音频形式获取回复**，从而同时支持基于文本的聊天和语音对话模式。
* **发送并处理音频输入** （例如， `.wav` 单声道文件（支持的采样率）以启用实时语音识别。

交互 API 连接您的角色与用户，实现跨文本和语音渠道的无缝、响应迅速的通信。

{% content-ref url="/pages/9f68825136f6ad3eb76c8a1fdee1f114238c1f07" %}
[交互 API](/api-docs/zh/api-can-kao/core-api-reference/interaction-apis/interaction-api.md)
{% endcontent-ref %}


---

# 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/interaction-apis.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.
