> 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/cha-jian-yu-ji-cheng/unity-plugin-beta-overview/getting-started/setup/configure-api-key.md).

# 配置 API 密钥

## 简介

SDK 需要您的 Convai API 密钥来验证请求并启用角色对话。

## 先决条件

* 一个 Convai 账户
* 来自您的 API 密钥 [Convai 仪表板](https://convai.com/). [（在哪里找到您的 API 密钥）](https://docs.convai.com/api-docs/convai-playground/get-started/dashboard-overview#profile-and-settings)

## 分步骤

{% stepper %}
{% step %}
**在 Unity 中打开 Convai 账户窗口**

在 Unity 顶部菜单中，转到 **Convai → 账户**.

<figure><img src="/files/11381e7ff986fabb57c7907819f0728e4ded4b55" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**从 Convai 复制你的 API 密钥**

* 在浏览器中打开 Convai 并登录。
* 找到你的 **API 密钥** 位于仪表板/个人资料设置中。
* 复制 API 密钥。

<figure><img src="/files/d395eba44d9216dd4504309d7c4e077e808c67dd" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**将密钥粘贴并更新到 Unity 中**

* 将密钥粘贴到 **API 密钥** 字段中。
* 单击 **更新 API 密钥**.
* **预期结果：** 账户详情和使用信息已成功刷新。

<figure><img src="/files/a21c81b94aac69a0e39bef55855cecc0869cd890" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## 故障排查

* **账户信息未更新**
  * 确认 API 密钥正确（没有多余空格）。
  * 检查网络连接并重试。
* **您找不到您的 API 密钥**
  * 使用链接的仪表板/个人资料文档部分。

## 结论

您的项目现已通过 Convai 认证。接下来，使用 **示例场景** 或继续使用 **自定义场景设置**.

{% hint style="info" %}
**需要帮助？** 如有疑问，请访问 [**Convai 开发者论坛**](https://forum.convai.com/).
{% 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin-beta-overview/getting-started/setup/configure-api-key.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
