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

# 角色构建 API

使用 Convai 的角色构建 API 创建和配置 AI 角色，以定义其个性、行为、知识等。

该 **角色构建 API** 让开发者全面掌控 AI 角色的设计、配置和演进。\
这些 API 构成角色身份的基础——定义其 **性格、行为、知识和叙事** 在所有交互中的一致性。

借助这些 API，你可以：

* **创建并管理角色** —— 定义角色元数据，如名称、描述、语言。
* **配置 AI 设置** 通过 **核心 AI 设置 API**，包括模型选择、温度。
* **构建并维护知识库** —— 上传、更新并整理构成角色领域知识的文档。
* **开发背景故事** 使用 **背景故事 API**，为你的角色提供深度与连贯性。
* **设计叙事元素** 通过 **叙事设计 API** 来创建沉浸式故事线和世界观关联。
* **创建外部 API 函数** —— 角色可通过其调用的 Python 处理器作为工具（天气、票务、实时数据），通过 **外部 API**.
* **连接 MCP 服务器** —— 注册远程 MCP 工具服务器，使用静态请求头或 OAuth，并通过以下方式将其附加到角色： **MCP 服务器 API**.
* **定义并管理动作** （手势、动作或特定环境行为）使用 **动作 API**.
* **访问语言和语音选项** 通过 **语言列表** 和 **语音列表 API**，从而实现多语言和可定制语音的角色体验。
* **检索并管理角色列表和版本** 通过 **角色列表 API**，确保你的生产角色保持有序并正确管理版本。
* **评估并优化** 你角色的响应和表现，使用 **评估 API**.

这些 API 共同让你塑造角色的 **核心智能、情感基调和知识框架**，确保在每次对话中都具有一致且可信的人格。

{% content-ref url="/pages/dab4497e3350d6ecde15c3c9e5ad83e64bc21bc9" %}
[角色基础 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/character-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/d469688f9d4ad68069e55312cfea61bb7a4d9f24" %}
[背景故事 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/backstory-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/022b58fc84ede8ef62eb99e705ed732d009ab0be" %}
[Mindview API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/mindview-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/ba1c2d733d1597fe6cbe6b30bbd302d5f1bf6fb1" %}
[核心 AI 设置 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/core-ai-settings-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/188670c7a430f8bc1c5fbd90fa7d6e22f07d3474" %}
[叙事设计 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/narrative-design-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/7c5287afcd4e876cdd7ac8cac05b07b2529acb89" %}
[知识库 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/knowledge-bank-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/4e0200509af6aec80cc3e4db7d53eeeb77ee76d1" %}
[外部 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/external-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/4dd0f56a9411883f2a72d0e1666c09db995df98f" %}
[MCP 服务器 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/mcp-server-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/f8d44c79bf1e017f91e01dcd9fb7a3a708930589" %}
[动作 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/action-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/ac8129adfcadd7218ac6e52bdc6388fefcf9351a" %}
[聊天历史 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/chat-history-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/0bef86f48f506b7240afeae45c35ccdd06027c8e" %}
[评估 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/evaluation-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/fdfed88f59c6997bd47c6e08c93781d8de8d9d7d" %}
[语言列表 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/language-list-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/ca26d73f8d2e97a80021565ab030a9f12904f637" %}
[语音列表 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/voice-list-api.md)
{% endcontent-ref %}

{% content-ref url="/pages/533981de37c51ca21e1526c104e6de84309a01a1" %}
[角色列表 API](/api-docs/zh/api-can-kao/core-api-reference/character-crafting-apis/character-list-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/character-crafting-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.
