---
title: 開發者 API 金鑰
url: https://platform.claude.com/docs/zh-TW/manage-claude/api-keys
description: 比較開發者 API 金鑰的類型、使用金鑰、選擇工作區，以及管理到期時間。
---

開發者 API 金鑰是您在 Claude Console 中建立並隨每個請求傳送的密鑰。金鑰適用於要求提供金鑰的工具，以及沒有可用[身分提供者](https://platform.claude.com/docs/zh-TW/manage-claude/authentication#workload-identity-federation)的伺服器。

**這是您需要的金鑰嗎？** 開發者 API 金鑰用於呼叫 Claude，而 [Admin API 金鑰](https://platform.claude.com/docs/zh-TW/manage-claude/admin-api-keys)用於管理組織。若要比較兩者，請參閱[兩種 API 金鑰](https://platform.claude.com/docs/zh-TW/manage-claude/authentication#api-keys)。

**您可能不需要金鑰。** 若要選擇不需要金鑰的方法，請參閱「身分驗證」頁面上的[選擇您的方式](https://platform.claude.com/docs/zh-TW/manage-claude/authentication#choose-your-path)。

## 金鑰類型

當您建立金鑰時，**已連結的帳戶**設定決定了其類型。選擇您自己即建立個人金鑰，選擇服務帳戶即建立服務帳戶金鑰。**未連結**會建立舊版的工作區金鑰。

如果某個只有您自己執行的工具要求提供金鑰，請使用個人金鑰。如果共享或無人值守的工作負載必須使用金鑰，請為其提供服務帳戶金鑰，這種金鑰不會因為某個人離開而停止運作。

類型決定了金鑰代表的身分、適用範圍，以及何時停止運作：

* **個人金鑰：** 代表您本人，具備您的角色。它適用於單一工作區，或您的角色允許使用 API 的工作區（請參閱工作區頁面上的[工作區角色和權限](https://platform.claude.com/docs/zh-TW/manage-claude/workspaces#workspace-roles-and-permissions)）。當您離開組織或被移出組織時，它便會停止運作。
* **服務帳戶金鑰：** 代表一個[服務帳戶](https://platform.claude.com/docs/zh-TW/manage-claude/workload-identity-federation#service-accounts)。它適用於單一工作區，或該服務帳戶的角色允許使用 API 的工作區。當服務帳戶被封存時，它便會停止運作。
* **工作區金鑰（舊版）：** 不代表任何人。它適用於建立它的工作區。當該工作區被封存時，它便會停止運作。

個人金鑰與服務帳戶金鑰與某個身分綁定，因此不會在擁有它們的人員或服務帳戶離開後繼續存在。

工作區金鑰屬於舊版，因此對於新的整合，請使用個人金鑰或服務帳戶金鑰。要停止使用工作區金鑰，請參閱[替換工作區金鑰](https://platform.claude.com/docs/zh-TW/manage-claude/api-keys#replacing-workspace-api-keys)。

### 範圍

個人金鑰或服務帳戶金鑰的範圍限定於單一工作區或整個組織：

* **限定於單一工作區：** 金鑰僅在該工作區中運作。當其擁有者失去該工作區的存取權或該工作區被封存時，金鑰也會停止運作。
* **限定於組織：** 金鑰可在多個工作區中運作，因此每個 Claude API 請求都需指定其中一個（請參閱[選擇工作區](https://platform.claude.com/docs/zh-TW/manage-claude/api-keys#select-a-workspace)）。

## 金鑰到期

當您在 Claude Console 的 [API 金鑰](https://platform.claude.com/settings/keys)頁面（`platform.claude.com/settings/keys`）建立金鑰時，您需要選擇其到期時間，且之後無法變更。可選項目包括：

* 預設選項：3 小時、1 天、7 天或 30 天
* 自訂日期與時間
* **永不**，適用於儲存在機密管理工具中並由您自行輪替的金鑰

如果您的組織設有最長到期時間政策，Console 會將預設選項與自訂日期限制在該上限內，且不提供**永不**選項。

如果金鑰的有效期至少為 3 天，Anthropic 會在其到期前向金鑰的建立者發送電子郵件。

金鑰到期後，使用它發出的請求會回傳 401 `authentication_error`。已到期的金鑰只能被刪除，無法重新啟用，因此請建立新金鑰以恢復存取。

Console 中的 API 金鑰表格會顯示每個金鑰的到期時間。[Admin API](https://platform.claude.com/docs/zh-TW/manage-claude/admin-api) 會在[列出 API 金鑰](https://platform.claude.com/docs/zh-TW/api/organization/api_keys/list)和[擷取 API 金鑰](https://platform.claude.com/docs/zh-TW/api/organization/api_keys/retrieve)上回報每個金鑰的 `expires_at`，讓您可以在金鑰到期前進行輪替。

## 誰可以建立哪種金鑰

| 金鑰 | 可建立者 |
| ----- | ----- |
| 個人金鑰，限定於單一工作區 | 該工作區中的 Workspace Developer、Workspace Limited Developer 或 Workspace Admin。身為該工作區成員的組織開發者也可以建立。組織管理員在每個工作區中都具有 Workspace Admin 角色。 |
| 個人金鑰，限定於組織 | 組織開發者與管理員 |
| 服務帳戶金鑰 | 組織管理員 |
| 工作區金鑰（舊版） | 該工作區中的 Workspace Developer、Workspace Limited Developer 或 Workspace Admin。組織管理員在每個工作區中都具有 Workspace Admin 角色。 |

預設工作區沒有成員清單，因此組織開發者與管理員可以在其中建立個人金鑰與工作區金鑰。

關於每個角色所允許的操作，請參閱 Admin API 頁面上的[組織角色與權限](https://platform.claude.com/docs/zh-TW/manage-claude/admin-api#organization-roles-and-permissions)，以及工作區頁面上的[工作區角色和權限](https://platform.claude.com/docs/zh-TW/manage-claude/workspaces#workspace-roles-and-permissions)。

組織管理員可以在 Claude Console 的[安全性](https://platform.claude.com/settings/identity)頁面關閉金鑰建立功能。**允許建立新的 API 金鑰**控制整個組織。**允許在預設工作區中建立新的 API 金鑰**僅控制限定於預設工作區的金鑰。

如果您無法建立所需的金鑰，應採取的做法取決於原因：

* **您具有組織使用者角色：** 請使用您擔任 Workspace Developer、Workspace Limited Developer 或 Workspace Admin 的工作區。在 [API 金鑰](https://platform.claude.com/settings/keys)頁面上，點擊**建立金鑰**。如果對話框先提供其他連線方式，請點擊**其他地方**或**使用 API 金鑰繼續**。然後，將**範圍**設為該工作區。
* **建立金鑰不存在或已停用，或 Console 顯示您沒有權限：** 請詢問組織管理員。他們可以變更您的角色、變更金鑰建立設定，或為您的工作負載建立服務帳戶金鑰。

## 建立和使用金鑰

要逐步建立金鑰，請參閱[取得您的 Claude API 金鑰](https://platform.claude.com/docs/zh-TW/get-api-key)。

SDK 和 CLI 會從 `ANTHROPIC_API_KEY` 環境變數讀取金鑰。直接的 HTTP 請求會在 `Authorization` 標頭中的 `Bearer` 之後傳送金鑰。它也可以改用舊版的 `x-api-key` 標頭傳送。請只傳送其中一種。使用 `Authorization` 時，請求如下所示：

```http
POST /v1/messages
Authorization: Bearer YOUR_API_KEY
anthropic-version: 2026-10-21
content-type: application/json
```

請勿將金鑰放入原始碼控制、用戶端程式碼和提示中。要在您的 shell 中設定 `ANTHROPIC_API_KEY`（包括在 Windows 上），請參閱 CLI 驗證選項頁面上的 [API 金鑰](https://platform.claude.com/docs/zh-TW/cli-sdks-libraries/cli/authentication#api-key)。

以下範例展示各工具如何取得金鑰：

<CodeGroup>
  ```bash cURL
  curl https://api.anthropic.com/v1/messages \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -H "content-type: application/json" \
    -d '{
      "model": "claude-opus-5-5",
      "max_tokens": 1024,
      "messages": [{"role": "user", "content": "Hello, Claude"}]
    }'
  ```

  ```bash CLI
  export ANTHROPIC_API_KEY=sk-ant-...
  ```

  ```python Python
  client = Anthropic()  # reads ANTHROPIC_API_KEY
  # 或傳入您從 secrets manager（機密管理工具）載入的金鑰：
  # client = Anthropic(api_key=key_from_your_secrets_manager)
  ```

  ```typescript TypeScript
  const client = new Anthropic(); // reads ANTHROPIC_API_KEY
  // 或者傳入您從 secrets manager（機密管理工具）載入的金鑰：
  // const client = new Anthropic({ apiKey: keyFromYourSecretsManager });
  ```

  ```csharp C#
  AnthropicClient client = new(); // reads ANTHROPIC_API_KEY
  // 或傳入您從 secrets manager（機密管理工具）載入的金鑰：
  // AnthropicClient client = new() { ApiKey = keyFromYourSecretsManager };
  ```

  ```go Go
  client := anthropic.NewClient() // reads ANTHROPIC_API_KEY
  // 或傳入您從 secrets manager（機密管理工具）載入的金鑰
  // （import github.com/anthropics/anthropic-sdk-go/v2/option）：
  // client := anthropic.NewClient(option.WithAPIKey(keyFromYourSecretsManager))
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv(); // reads ANTHROPIC_API_KEY
  // 或傳入您從 secrets manager（機密管理工具）載入的金鑰：
  // AnthropicClient client = AnthropicOkHttpClient.builder()
  //     .apiKey(keyFromYourSecretsManager)
  //     .build();
  ```

  ```php PHP
  $client = new Client(); // reads ANTHROPIC_API_KEY
  // 或傳入您從 secrets manager（機密管理工具）載入的金鑰：
  // $client = new Client(apiKey: $keyFromYourSecretsManager);
  ```

  ```ruby Ruby
  client = Anthropic::Client.new # reads ANTHROPIC_API_KEY
  # 或傳入您從 secrets manager（機密管理工具）載入的金鑰：
  # client = Anthropic::Client.new(api_key: key_from_your_secrets_manager)
  ```
</CodeGroup>

### 使用金鑰執行文件中的範例

首先，將 `ANTHROPIC_API_KEY` 設為您的金鑰。如果金鑰限定於組織，每個 Claude API 範例也必須指定工作區（請參閱[選擇工作區](https://platform.claude.com/docs/zh-TW/manage-claude/api-keys#select-a-workspace)）。其他需要變更的內容取決於範例：

* **SDK 和 CLI 範例，以及傳送 `x-api-key` 的 cURL 範例：** 無需其他變更。它們會讀取 `ANTHROPIC_API_KEY`。
* **使用 CLI 登入的 cURL 範例：** 這些範例會傳送 `Authorization: Bearer $(ant auth print-credentials --access-token)`。請將其改為 `Authorization: Bearer $ANTHROPIC_API_KEY`。

## 選擇工作區

請求是否需要指定工作區，取決於金鑰的範圍：

* **限定於單一工作區：** 請求可以省略 `anthropic-workspace-id` 標頭。如果您傳送此標頭，它必須指定金鑰本身的工作區。
* **限定於組織：** 每個 Claude API 請求都必須在 `anthropic-workspace-id` 標頭中指定工作區。請勿在 Admin API 請求中加入此標頭，因為 Admin API 會拒絕它。

若要查詢工作區的 ID，請使用下列任一方式：

* Claude Console 中[工作區](https://platform.claude.com/settings/workspaces)頁面上的 **ID** 欄位。該頁面也會列出預設工作區。
* Admin API 中的 [列出工作區](https://platform.claude.com/docs/zh-TW/api/organization/workspaces/list)。只有在您傳入 `include_default=true` 時，才會包含預設工作區。

以下範例在單一請求上設定此標頭。使用 SDK 時，您也可以為某個用戶端的所有請求一次設定：

<CodeGroup>
  ```bash cURL
  # 對於範圍限定於組織的金鑰，每個 Claude API 請求皆須提供此項。
  # 對於範圍限定於單一工作區的金鑰，請省略 anthropic-workspace-id 標頭。
  curl https://api.anthropic.com/v1/messages \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2026-10-21" \
    -H "anthropic-workspace-id: wrkspc_01AbCdEfGhJkLmNpQrStUvWx" \
    -H "content-type: application/json" \
    -d '{
      "model": "claude-opus-5-5",
      "max_tokens": 1024,
      "messages": [{"role": "user", "content": "Hello, Claude"}]
    }'
  ```

  ```bash CLI
  # 對於範圍限定於組織的金鑰，每個 Claude API 請求皆須提供。
  # 若金鑰範圍限定於單一工作區，請省略 --workspace-id。
  ant messages create \
    --workspace-id wrkspc_01AbCdEfGhJkLmNpQrStUvWx \
    --model claude-opus-5-5 \
    --max-tokens 1024 \
    --message '{role: user, content: "Hello, Claude"}'
  ```

  ```python Python
  client = Anthropic()  # reads ANTHROPIC_API_KEY

  # 對於範圍為組織的金鑰，每個 Claude API 請求皆必須提供。
  # 對於範圍為單一工作區的金鑰，請省略 extra_headers。
  message = client.messages.create(
      model="claude-opus-5-5",
      max_tokens=1024,
      messages=[{"role": "user", "content": "Hello, Claude"}],
      extra_headers={"anthropic-workspace-id": "wrkspc_01AbCdEfGhJkLmNpQrStUvWx"},
  )
  print(message.content)

  # 或針對此用戶端的所有請求一次性設定：
  workspace_client = Anthropic(
      default_headers={"anthropic-workspace-id": "wrkspc_01AbCdEfGhJkLmNpQrStUvWx"},
  )
  ```

  ```typescript TypeScript
  const client = new Anthropic(); // reads ANTHROPIC_API_KEY

  // 對於範圍限定為組織的金鑰，每個 Claude API 請求皆須提供。
  // 若金鑰範圍限定為單一工作區，請省略第二個引數。
  const message = await client.messages.create(
    {
      model: "claude-opus-5-5",
      max_tokens: 1024,
      messages: [{ role: "user", content: "Hello, Claude" }]
    },
    { headers: { "anthropic-workspace-id": "wrkspc_01AbCdEfGhJkLmNpQrStUvWx" } }
  );
  console.log(message.content);

  // 或為此用戶端的所有請求統一設定一次：
  const workspaceClient = new Anthropic({
    defaultHeaders: { "anthropic-workspace-id": "wrkspc_01AbCdEfGhJkLmNpQrStUvWx" }
  });
  ```

  ```csharp C#
  AnthropicClient client = new(); // reads ANTHROPIC_API_KEY

  MessageCreateParams parameters = new()
  {
      Model = Model.ClaudeOpus5_5,
      MaxTokens = 1024,
      Messages = [new UserMessageParam { Content = "Hello, Claude" }],
  };

  // 對於範圍限定在組織的金鑰，每個 Claude API 請求都必須提供。
  // 對於範圍限定在單一工作區的金鑰，請直接呼叫 client.Messages.Create(parameters)。
  var message = await client
      .WithOptions(options =>
          options with
          {
              ExtraHeaders = new Dictionary<string, string>
              {
                  ["anthropic-workspace-id"] = "wrkspc_01AbCdEfGhJkLmNpQrStUvWx",
              },
          }
      )
      .Messages.Create(parameters);
  Console.WriteLine(message);

  // 或者為此用戶端的所有請求設定一次：
  AnthropicClient workspaceClient = new(new ClientOptions
  {
      ExtraHeaders = new Dictionary<string, string>
      {
          ["anthropic-workspace-id"] = "wrkspc_01AbCdEfGhJkLmNpQrStUvWx",
      },
  });
  ```

  ```go Go
  client := anthropic.NewClient() // reads ANTHROPIC_API_KEY

  // 對於範圍限定於組織的金鑰，每個 Claude API 請求都必須提供此項。
  // 若金鑰範圍限定於單一工作區，請省略此選項。
  message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
  	Model:     anthropic.ModelClaudeOpus5_5,
  	MaxTokens: 1024,
  	Messages: []anthropic.MessageParam{
  		anthropic.NewUserMessage(anthropic.NewTextBlock("Hello, Claude")),
  	},
  }, option.WithHeader("anthropic-workspace-id", "wrkspc_01AbCdEfGhJkLmNpQrStUvWx"))
  if err != nil {
  	log.Fatal(err)
  }
  fmt.Println(message.Content)

  // 或為此用戶端的所有請求統一設定一次：
  workspaceClient := anthropic.NewClient(
  	option.WithHeader("anthropic-workspace-id", "wrkspc_01AbCdEfGhJkLmNpQrStUvWx"),
  )
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv(); // reads ANTHROPIC_API_KEY

  // 對於範圍限定於組織的金鑰，每個 Claude API 請求皆須提供。
  // 若金鑰範圍限定於單一工作區，請省略 putAdditionalHeader。
  Message message = client.messages().create(MessageCreateParams.builder()
      .model(Model.CLAUDE_OPUS_5_5)
      .maxTokens(1024)
      .addUserMessage("Hello, Claude")
      .putAdditionalHeader("anthropic-workspace-id", "wrkspc_01AbCdEfGhJkLmNpQrStUvWx")
      .build());

  IO.println(message.content());

  // 或為此用戶端的所有請求一次設定：
  AnthropicClient workspaceClient = AnthropicOkHttpClient.builder()
      .fromEnv()
      .putHeader("anthropic-workspace-id", "wrkspc_01AbCdEfGhJkLmNpQrStUvWx")
      .build();
  ```

  ```php PHP
  use Psr\Http\Message\RequestInterface;
  use Psr\Http\Message\ResponseInterface;

  $client = new Client(); // reads ANTHROPIC_API_KEY

  // 對於範圍限定於組織的金鑰，每個 Claude API 請求皆需提供。
  // 若金鑰範圍限定於單一工作區，請省略 workspaceID。
  $message = $client->messages->create(
      model: Model::CLAUDE_OPUS_5_5,
      maxTokens: 1024,
      messages: [['role' => 'user', 'content' => 'Hello, Claude']],
      workspaceID: 'wrkspc_01AbCdEfGhJkLmNpQrStUvWx',
  );

  echo json_encode($message->content), PHP_EOL;

  // 或為此用戶端的所有請求設定一次：
  $workspaceMiddleware = function (RequestInterface $request, callable $next): ResponseInterface {
      if (!$request->hasHeader('anthropic-workspace-id')) {
          $request = $request->withHeader('anthropic-workspace-id', 'wrkspc_01AbCdEfGhJkLmNpQrStUvWx');
      }

      return $next($request);
  };

  $workspaceClient = new Client(requestOptions: ['middleware' => [$workspaceMiddleware]]);
  ```

  ```ruby Ruby
  client = Anthropic::Client.new # reads ANTHROPIC_API_KEY

  # 對於範圍限定於組織的金鑰，每個 Claude API 請求都必須提供。
  # 若金鑰範圍限定於單一工作區，請省略 workspace_id。
  message = client.messages.create(
    model: Anthropic::Model::CLAUDE_OPUS_5_5,
    max_tokens: 1024,
    messages: [{ role: "user", content: "Hello, Claude" }],
    workspace_id: "wrkspc_01AbCdEfGhJkLmNpQrStUvWx"
  )

  puts message.content

  # 或為此用戶端的所有請求一次設定：
  workspace_middleware = lambda do |request, call_next|
    headers = { "anthropic-workspace-id" => "wrkspc_01AbCdEfGhJkLmNpQrStUvWx", **request.headers }
    call_next.call(request.with(headers:))
  end

  workspace_client = Anthropic::Client.new(middleware: [workspace_middleware])
  ```
</CodeGroup>

如果使用限定於組織之金鑰發出的請求省略了此標頭，API 會回傳 400 `invalid_request_error`：

```json JSON
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "This API key is not scoped to a workspace, so this request must include the anthropic-workspace-id header with the ID of the workspace to use. Add the header, or use an API key that is scoped to a workspace."
  },
  "request_id": "req_011CSHoEeqs5C35K2UUqR7Fy"
}
```

標頭本身也可能導致錯誤：

* **不是有效工作區 ID 的值：** API 會回傳 400 `invalid_request_error`，訊息為 `anthropic-workspace-id header must be a valid workspace ID.`
* **金鑰無法觸及的工作區：** API 會回傳 404 `not_found_error`，訊息為 ``Workspace `<uuid>` not found.``，其中以 UUID 而非 `wrkspc_` ID 指稱該工作區。例如，該工作區不存在，或金鑰僅在另一個工作區中運作。對於限定於組織的金鑰，此錯誤也可能表示金鑰的擁有者無法存取該工作區。
* **金鑰擁有者在該工作區中的角色不允許此請求：** API 會回傳 403 `permission_error`，訊息例如 `The account linked to this API key does not have permission for this endpoint.`。例如，Workspace User 和 Workspace Billing 角色無法傳送 Messages 請求。

## 保護金鑰安全

請將 API 金鑰儲存在機密管理工具中，定期輪替，並停用或刪除任何您懷疑已外洩的金鑰。Claude Console 的 [API 金鑰](https://platform.claude.com/settings/keys)頁面提供兩種停止金鑰的方式：

* **停用**是可復原的：**重新啟用**會讓金鑰恢復運作。當**允許建立新的 API 金鑰**關閉時，您無法重新啟用金鑰（請參閱[誰可以建立哪種金鑰](https://platform.claude.com/docs/zh-TW/manage-claude/api-keys#who-can-create-which-key)）。
* **刪除**是永久性的。

Admin API 會將已停用金鑰的 `status` 回報為 `"inactive"`，並將重新啟用之金鑰的 `status` 回報為 `"active"`。已刪除的金鑰仍會以 `status: "archived"` 出現在[列出 API 金鑰](https://platform.claude.com/docs/zh-TW/api/organization/api_keys/list)中。

若要限制金鑰外洩時可被使用的時間長度，請在建立金鑰時設定[金鑰到期](https://platform.claude.com/docs/zh-TW/manage-claude/api-keys#key-expiration)。若要限制外洩金鑰可運作的位置，請開啟目前處於 beta 階段的 [IP 允許清單](https://platform.claude.com/docs/zh-TW/manage-claude/ip-allowlist)。

## 替換工作區金鑰

工作區金鑰在設定它的人員離開後仍會繼續運作。替換它可提供更好的安全性和可觀察性。

要以何者替換工作區金鑰，取決於程式碼執行的位置：

* **具有身分提供者的工作負載：** 請使用工作負載身分聯合，它不需要長期有效的金鑰。請參閱工作負載身分聯合頁面上的[從 API 金鑰遷移](https://platform.claude.com/docs/zh-TW/manage-claude/workload-identity-federation#migrate-from-api-keys)。
* **您在自己電腦上執行的程式碼：** 請使用 CLI 登入。請參閱身分驗證頁面的[使用 CLI 登入](https://platform.claude.com/docs/zh-TW/manage-claude/authentication#sign-in-with-the-cli)章節。
* **其他程式碼：** 請使用個人金鑰或服務帳戶金鑰。

如果您需要新的服務帳戶，組織管理員會在 Claude Console 的[服務帳戶](https://platform.claude.com/settings/service-accounts)頁面建立它。管理員也會將其加入該工作區。

要用個人金鑰或服務帳戶金鑰替換工作區金鑰：

1. **決定金鑰類型。** 本頁的[金鑰類型](https://platform.claude.com/docs/zh-TW/manage-claude/api-keys#key-types)章節說明了應使用哪一種。
2. **建立新金鑰。** 除非該整合需要多個工作區，否則請將其範圍限定於舊金鑰的工作區。若是服務帳戶金鑰，請要求組織管理員建立。
3. **部署新金鑰。** 在整合讀取金鑰的所有位置替換舊金鑰，通常是 `ANTHROPIC_API_KEY` 環境變數或機密管理工具中的項目。對於限定於組織的金鑰，也請傳送 `anthropic-workspace-id` 標頭（請參閱[選擇工作區](https://platform.claude.com/docs/zh-TW/manage-claude/api-keys#select-a-workspace)）。
4. **淘汰舊金鑰。** 在 Claude Console 的 [API 金鑰](https://platform.claude.com/settings/keys)頁面停用該工作區金鑰。確認請求仍然成功後，再將其刪除。

## 使用 Admin API 管理金鑰

需要自動化金鑰管理的組織管理員，可以使用 [Admin API 參考](https://platform.claude.com/docs/zh-TW/api/organization)中的端點，例如[列出 API 金鑰](https://platform.claude.com/docs/zh-TW/api/organization/api_keys/list)和[擷取 API 金鑰](https://platform.claude.com/docs/zh-TW/api/organization/api_keys/retrieve)。關於這些端點接受的憑證，請參閱 [Admin API 驗證](https://platform.claude.com/docs/zh-TW/manage-claude/admin-api#authentication)。要取得 Console Admin API 金鑰，請參閱[為 Claude Console 組織建立金鑰](https://platform.claude.com/docs/zh-TW/manage-claude/admin-api-keys#create-a-key-for-a-claude-console-organization)。

這些端點會回傳部分隱藏的金鑰密鑰提示，絕不會回傳密鑰本身。要取得金鑰，請在 Claude Console 的 [API 金鑰](https://platform.claude.com/settings/keys)頁面建立一個。

## 特殊情況

### 如果您使用 Claude Platform on AWS

Claude Platform on AWS 使用其自有的金鑰，您需在 AWS Console 中建立。要傳送金鑰，請參閱 Claude Platform on AWS 頁面上的 [API 金鑰驗證](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-platform-on-aws#api-key-authentication)。
