# 管理 API key

API key 讓你的應用程式以程式化方式存取 Blockchain Atlantis。管理員可在管理後台隨時建立、檢視、撤銷 key 與調整 credit。

## 建立 key

在後台建立 key 時，指定**名稱**、**方案**與**初始 credit**。建立後系統會回傳一次性的明碼 key。

{% hint style="warning" %}
明碼 key（`ak_live_…`）**只會出現這一次**，請當場交付給使用者並妥善保存。系統只保存雜湊值，遺失只能撤銷後重建。
{% endhint %}

請給每把 key 一個能辨識用途的名稱（例如「行動 App」「對帳排程」），方便日後稽核。

## 撤銷 key

在後台找到該 key 按撤銷。撤銷**立即生效**——之後使用該 key 的請求一律回 `401`。

## 調整 credit

可為任一 key 增減 credit（`delta` 可正可負）。加值後使用者即可繼續呼叫。

## key 的狀態

| 狀態        | 意義      | 請求結果               |
| --------- | ------- | ------------------ |
| active    | 正常      | 通過認證               |
| suspended | 暫停（如欠費） | `403 forbidden`    |
| revoked   | 已撤銷     | `401 unauthorized` |

## 最佳實務

* **一整合一把 key** — 方便個別撤銷與用量追蹤。
* **最小權限** — 只發放必要的 credit 與方案額度。
* **定期盤點** — 撤銷不再使用的 key。
* **安全保管** — 提醒使用者把 key 放在伺服器端密鑰管理，勿入版本控制或前端。

詳細的 API 操作見[開發者文件的管理後台章節](https://api.atlantis.example/docs)。


---

# 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.blockchainsecurity.asia/help-center/guan-li/managing-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.
