> 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](https://docs.convai.com/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.
