# 註冊和使用 API 金鑰

### 先決條件

首先，您需要擁有[一個備忘錄](/zh-hk/ge-ren-shi-yong/personal/mementos-filter-access.md)，該備忘錄是使用您的索引知識文件創建和精煉的。

### 創建共通知識

要創建共通知識，請登入您的 Rememberizer 帳戶並訪問 [您的共通知識頁面](https://rememberizer.ai/personal/common-knowledge)。選擇 **"您的共享知識"**，然後點擊 **"開始"**。

<figure><img src="/files/KKjbCM6n830pulzsUjwv" alt="common knowledge page"><figcaption></figcaption></figure>

然後選擇您之前創建的其中一個紀念品，您也可以選擇 **"全部"** 或 **"無"**。

<div align="center" data-full-width="false"><figure><img src="/files/TSSy2YSmpToG5EAGf558" alt="create common knowledge 1" width="375"><figcaption></figcaption></figure></div>

最後填寫共通知識的名稱、描述並給它一張代表性的照片。

<figure><img src="/files/sgQkAUnMhokZKt81lIkQ" alt="create common knowledge 2" width="375"><figcaption></figcaption></figure>

填寫完表單後，點擊底部的 "分享知識" 以創建您的共通知識。之後，開啟您的知識中的 **"啟用共享"**，並在彈出窗口中點擊 **"確認"**。

<figure><img src="/files/PDp7pJdAhTS0JtUmSh09" alt="common knowledge sharing"><figcaption></figcaption></figure>

您現在已準備好獲取其 API 金鑰並通過 API 調用訪問其文檔。

### 獲取您創建的共通知識的 API 金鑰

對於您的共通知識，點擊右上角的三個點，然後選擇「API 金鑰」。如果尚未存在，將為您創建一個。如果 API 金鑰存在，則會返回該金鑰。

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

在 **「管理您的 API 金鑰」** 面板中，您可以點擊 **「眼睛」** 按鈕來顯示/隱藏，點擊 **「複製」** 按鈕將金鑰複製到剪貼簿，並點擊 **「重新生成 API 金鑰」** 以使舊金鑰失效並創建一個新金鑰（通過 API 調用訪問您文檔的應用程序在您更新新金鑰之前將無法訪問）。

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

獲得 API 金鑰後，您可以在對 Rememberizer 的 API 調用中使用它來查詢您的索引文檔和內容。

### 使用 API 金鑰

要訪問 Rememberizer 端點，您需要在 API 請求的 `X-API-Key` 標頭中使用 API 金鑰。請查看 [API 文檔](/zh-hk/kai-fa-zhe-zi-yuan/api-docs.md) 以查看 Rememberizer 提供的端點。

一旦您擁有 API 金鑰，您可以以幾種方式使用它：

1. **直接 API 訪問**：在您的 HTTP 請求中使用 API 金鑰來查詢 Rememberizer 的搜索端點
2. **LangChain 集成**：使用 [LangChain 集成](/zh-hk/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-hk/kai-fa-zhe-zi-yuan/integration-options/creating-a-rememberizer-gpt.md)。
{% endhint %}

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


---

# Agent Instructions: 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.rememberizer.ai/zh-hk/kai-fa-zhe-zi-yuan/integration-options/registering-and-using-api-keys.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.
