> For the complete documentation index, see [llms.txt](https://docs.rememberizer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rememberizer.ai/zh-cn/kai-fa-zhe-zi-yuan/integration-options/registering-and-using-api-keys.md).

# 注册和使用 API 密钥

### 前提条件

首先，您需要使用您的索引知识文件创建并完善[一个备忘录](/zh-cn/ge-ren-shi-yong/personal/mementos-filter-access.md)。

### 创建共享知识

要创建共享知识，请登录您的 Rememberizer 账户并访问 [您的共享知识页面](https://rememberizer.ai/personal/common-knowledge)。选择 **“您的共享知识”**，然后点击 **“开始”**。

<figure><img src="/files/cnvbsl7e8wOG7LucjF34" alt="共享知识页面"><figcaption></figcaption></figure>

然后选择您之前创建的其中一个纪念品，您也可以选择 **“全部”** 或 **“无”**。

<div align="center" data-full-width="false"><figure><img src="/files/TLexKU4bhqUINpiHASVA" alt="创建共享知识 1" width="375"><figcaption></figcaption></figure></div>

最后填写共享知识的名称、描述，并提供一张代表性的照片。

<figure><img src="/files/naFOqoH4VKjgFdYsxUBT" alt="创建共享知识 2" width="375"><figcaption></figcaption></figure>

填写完表单后，点击底部的“分享知识”以创建您的共享知识。之后，打开您的知识中的 **“启用分享”** 并在弹出窗口中点击 **“确认”**。

<figure><img src="/files/JZMg8fnRsZxTTllJZ8KG" alt="共享知识分享"><figcaption></figcaption></figure>

您现在可以获取其 API 密钥并通过 API 调用访问其文档。

### 获取您创建的公共知识的 API 密钥

对于您的公共知识，请点击右上角的三个点，然后选择“API 密钥”。如果还没有，将为您创建一个。如果 API 密钥存在，将返回该密钥。

<figure><img src="/files/HjM7PWs7hhlszqGWCo1a" alt="knowledge open API key"><figcaption></figcaption></figure>

在 **“管理您的 API 密钥”** 面板中，您可以点击 **“眼睛”** 按钮以显示/隐藏，点击 **“复制”** 按钮将密钥复制到剪贴板，以及点击 **“重新生成 API 密钥”** 以使旧密钥失效并创建一个新密钥（通过 API 调用访问您文档的应用程序在您更新新密钥之前将无法访问）。

<figure><img src="/files/79EI1UEmlRenT4INUF7U" alt="copy api key"><figcaption></figcaption></figure>

获得 API 密钥后，您可以在对 Rememberizer 的 API 调用中使用它，以查询您索引的文档和内容。

### 使用 API 密钥

要访问 Rememberizer 端点，您需要在 API 请求的 `X-API-Key` 头中使用 API 密钥。请查看 [API 文档](/zh-cn/kai-fa-zhe-zi-yuan/api-docs.md) 以了解 Rememberizer 提供的端点。

一旦您拥有 API 密钥，可以通过几种方式使用它：

1. **直接 API 访问**：在您的 HTTP 请求中使用 API 密钥查询 Rememberizer 的搜索端点
2. **LangChain 集成**：使用 [LangChain 集成](/zh-cn/kai-fa-zhe-zi-yuan/integration-options/langchain-integration.md) 将 Rememberizer 的功能融入您的 LangChain 应用程序
3. **自定义 GPT**：在自定义 GPT 应用程序中使用 API 密钥，如下所述

#### 使用自定义 GPT

首先在 [ChatGPT UI 中创建一个 GPT](https://chat.openai.com/gpts/editor)。确保选择身份验证类型为“API 密钥”，身份验证类型为“自定义”，并将头部设置为“X-Api-Key”，然后将您之前复制的密钥粘贴到 API 密钥文本框中。

{% hint style="info" %}
有关使用 OAuth 而不是 API 密钥的更高级的 GPT 集成，请参见 [创建一个 Rememberizer GPT](/zh-cn/kai-fa-zhe-zi-yuan/integration-options/creating-a-rememberizer-gpt.md)。
{% endhint %}

<figure><img src="/files/0Gmwpki5QTuuolRIX6X9" alt="gpt app using api key" width="375"><figcaption></figcaption></figure>


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.rememberizer.ai/zh-cn/kai-fa-zhe-zi-yuan/integration-options/registering-and-using-api-keys.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
