---
title: 在雲端平台上使用使用者設定檔
url: https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/platforms
description: 在提供 Claude 的每個雲端平台上，應在何處建立使用者設定檔、需要先連結什麼，以及如何傳送使用者設定檔 ID。
---

如果您透過雲端平台使用 Claude，使用者設定檔的設定方式取決於該平台。該平台決定了哪個組織保存您的使用者設定檔、您需要先將什麼連結到該組織，以及每個請求在何處攜帶使用者設定檔的 ID。若要了解使用者設定檔的作用以及您是否需要使用者設定檔，請參閱[使用者設定檔的運作方式](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/how-user-profiles-work)。若要了解誰需要使用者設定檔以及如何建立使用者設定檔，請參閱[建立使用者設定檔並歸屬請求](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/attribute-requests)。

## 哪個組織保存您的使用者設定檔

在 Amazon Bedrock、Claude Models on Google Cloud (Google managed) 和 Microsoft Foundry 上，您需要在另一個平台上的 Anthropic 組織中建立使用者設定檔。該平台通常是 Claude API。該組織的憑證僅用於管理使用者設定檔，您對 Claude 的請求仍使用您雲端平台的憑證。各平台的章節會說明哪些組織適用。

在 Claude Models on Google Cloud (Google managed) 和 Amazon Bedrock 上，任一[存取類型](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/attribute-requests#decide-who-gets-a-profile)皆可使用。

## 如果您使用 Amazon Bedrock

* **建立使用者設定檔的位置：** 在 Claude API 上的組織中。Claude Platform on AWS 上的組織也可以，但其使用者設定檔[不會回報限制或封禁](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/platforms#claude-platform-on-aws)。
* **需要先連結的項目：** 每個向 Amazon Bedrock 傳送帶有使用者設定檔 ID 之請求的 AWS 帳戶。請將每個帳戶連結到您用來建立使用者設定檔的組織。如需步驟，請參閱[連結 AWS 帳戶或 Google Cloud 專案](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles-verification-portal#link-an-aws-account-or-google-cloud-project)。您無需連結僅用於您自己用量的帳戶。
* **ID 的位置：** 在請求主體最上層的 `user_profile_id` 欄位中，而非 `anthropic-user-profile-id` 標頭中。請僅在[可以攜帶使用者設定檔 ID 的請求](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/platforms#amazon-bedrock-models)上傳送它。請參閱[各平台如何檢查 ID](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/platforms#how-each-platform-checks-the-id)。

### 可以攜帶使用者設定檔 ID 的請求

使用者設定檔適用於 [Amazon Bedrock 中的 Claude（`bedrock-mantle`）](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-in-amazon-bedrock)，以及 [Amazon Bedrock 上的 Claude（`bedrock-runtime`）](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-on-amazon-bedrock-legacy)上的 `InvokeModel`，包括使用 `InvokeModelWithResponseStream` 的「streaming」（串流）。請僅在針對下列模型的請求上傳送使用者設定檔 ID，但並非每個模型都同時提供於兩個端點上：

* Claude 4.7 及更新的模型
* Claude Sonnet 4.6
* Claude Haiku 4.5

對於任何其他模型的請求，請勿包含該 ID，因為帶有該 ID 的請求可能會以 `400` 失敗。Amazon Bedrock 批次推論工作中也請勿包含該 ID。

不帶 ID 的請求不會歸屬至任何終端客戶。

`Converse` API 不提供使用者設定檔。請改用 `InvokeModel` 或 `bedrock-mantle` 端點。

### 在請求主體中傳送 ID

以下是 ID 在 `bedrock-mantle` 主體中的位置。關於 `bedrock-runtime` 主體，請參閱下列清單中的最後兩個項目。

```json
{
  "model": "anthropic.claude-opus-5-5",
  "max_tokens": 1024,
  "user_profile_id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",
  "messages": [{ "role": "user", "content": "Hello, Claude" }]
}
```

ID 如何放入主體，取決於您呼叫 Amazon Bedrock 的方式：

* **標準 SDK 用戶端：** 請勿透過您用於 Claude API 的用戶端向 Amazon Bedrock 傳送使用者設定檔 ID。無論您提供什麼基礎 URL，該用戶端都會將 ID 放在標頭中。

* **適用於 `bedrock-mantle` 的 SDK 用戶端：** 請使用最新版本的 [`bedrock-mantle` 用戶端](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-in-amazon-bedrock#install-an-sdk)，您可以使用 `AnthropicBedrockMantle` (csharp: `AnthropicBedrockMantleClient`; go: `bedrock.NewMantleClient()`; java: `BedrockMantleBackend`; php: `MantleClient`; ruby: `Anthropic::BedrockMantleClient`) 建立它。在 SDK 的[使用者設定檔引數](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/attribute-requests#attribute-each-request)中傳遞 ID，用戶端就會將其放入主體。

* **適用於 `bedrock-runtime` 的 SDK 用戶端：** 如果您透過 `AnthropicBedrock` (csharp: `AnthropicBedrockClient`; go: `bedrock.WithLoadDefaultConfig()`; java: `BedrockBackend`; php: `Bedrock\Client`; ruby: `Anthropic::BedrockClient`) 呼叫 `InvokeModel`，[最新版本的 SDK](https://platform.claude.com/docs/zh-TW/cli-sdks-libraries/overview#latest-versions) 會替您將[使用者設定檔引數](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/attribute-requests#attribute-each-request)放入請求主體。較早的版本則不會，因此除非您自行加入 ID，否則請求不會被歸屬。在 TypeScript 和 C# 中，判斷依據的是 Bedrock 套件的版本，即 `@anthropic-ai/bedrock-sdk` 或 `Anthropic.Bedrock`。

  在最新 SDK 所傳送的 API 版本上，`InvokeModel` 請求對於某些模型可能會以 `400` 失敗。這些模型是 [Amazon Bedrock 上的 Claude（`bedrock-runtime`）](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-on-amazon-bedrock-legacy)模型表中編號為 4.6 或更低的模型。對於這些模型，請繼續使用 SDK 的前一個主要版本。若要安裝該版本，請使用[安裝用於存取 Bedrock 的 SDK](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-on-amazon-bedrock-legacy#install-an-sdk-for-accessing-bedrock) 中的命令。

  使用較早版本時，請使用 `extra_body` (ruby: `request_options: {extra_body: {...}}`; typescript: `body`; php: `extraBodyParams`; java: `.putAdditionalBodyProperty()`; go: `option.WithJSONSet()`; csharp: `MessageCreateParams.FromRawUnchecked()`)，將 `user_profile_id` 加入[接受它之模型](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/platforms#amazon-bedrock-models)的請求主體中。主體的其餘部分請保持原樣，因為 SDK 會根據主體的 `model` 以及（若您使用串流）`stream: true` 來建構 URL。在 TypeScript 和 C# SDK 中，該選項會取代整個主體，因此請將請求的每個欄位連同 `user_profile_id` 一併包含在內。

* **直接呼叫 `InvokeModel`：** 請將模型 ID 放在請求的 URL 中（在 AWS SDK 中為 `modelId`），而非主體中。主體還需要 `anthropic_version` 欄位，例如 `"anthropic_version": "bedrock-2023-05-31"`。

如果您從[發送請求](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-on-amazon-bedrock-legacy#making-requests)中的範例開始，請將其模型改為[接受使用者設定檔 ID](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/platforms#amazon-bedrock-models) 的模型。

## 如果您使用 Claude Platform on AWS

* **建立使用者設定檔的位置：** 在您於 [Claude Platform on AWS](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-platform-on-aws) 上的組織中，並使用該平台的基礎 URL 和驗證方式。呼叫的主體需要具備[使用者設定檔 IAM 動作](https://platform.claude.com/docs/zh-TW/api/claude-platform-on-aws-iam-actions#user-profiles)。
* **需要先連結的項目：** 如果您在此組織中建立使用者設定檔，則無需連結任何項目。如果使用者設定檔是由其他組織建立的，請參閱[如果請求傳回 `400`](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/attribute-requests#if-a-request-returns-a-400)。
* **ID 的位置：** 在 `anthropic-user-profile-id` 標頭中，由 SDK 的[使用者設定檔引數](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/attribute-requests#attribute-each-request)設定。
* **限制與封禁：** 不會回報。關於強制措施欄位改為顯示的內容，請參閱[在 Claude Platform on AWS 上管理使用者設定檔](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/manage-profiles#if-you-use-claude-platform-on-aws)。

## 如果您使用 Claude Models on Google Cloud (Anthropic managed)

* **建立使用者設定檔的位置：** 在您於 [Claude Models on Google Cloud (Anthropic managed)](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-models-on-google-cloud/anthropic-managed) 上的組織中，您可以在該處建立、擷取、列出及更新使用者設定檔。請使用 Google Cloud 憑證而非 API 金鑰進行驗證，並使用最新版本的[適用於 Claude Models on Google Cloud (Anthropic managed) 的 SDK 用戶端](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-models-on-google-cloud/anthropic-managed#install-an-sdk)或[組織層級的基礎 URL](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-models-on-google-cloud/anthropic-managed#making-requests)。
* **需要先連結的項目：** 如果您在此組織中建立使用者設定檔，則無需連結任何項目。如果使用者設定檔是由其他組織建立的，請參閱[如果請求傳回 `400`](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/attribute-requests#if-a-request-returns-a-400)。
* **ID 的位置：** 在 `anthropic-user-profile-id` 標頭中，由 SDK 的[使用者設定檔引數](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/attribute-requests#attribute-each-request)設定。

## 如果您使用 Claude Models on Google Cloud (Google managed)

* **建立使用者設定檔的位置：** 在 Claude API 上的組織中。Claude Platform on AWS 上的組織也可以，但其使用者設定檔[不會回報限制或封禁](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/platforms#claude-platform-on-aws)。
* **需要先連結的項目：** 每個向 [Claude Models on Google Cloud (Google managed)](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-models-on-google-cloud/google-managed) 傳送帶有使用者設定檔 ID 之請求的 Google Cloud 專案。請將每個專案連結到您用來建立使用者設定檔的組織。如需步驟，請參閱[連結 AWS 帳戶或 Google Cloud 專案](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles-verification-portal#link-an-aws-account-or-google-cloud-project)。您無需連結僅用於您自己用量的專案。
* **ID 的位置：** 在 `anthropic-user-profile-id` 標頭中，而非請求主體中。請參閱[各平台如何檢查 ID](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/platforms#how-each-platform-checks-the-id)。

使用 SDK 時，請使用最新版本的[適用於 Claude Models on Google Cloud (Google managed) 的 SDK 用戶端](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-models-on-google-cloud/google-managed#install-an-sdk-for-accessing-vertex-ai)，您可以使用 `AnthropicVertex` (csharp: `AnthropicVertexClient`; go: `vertex.WithGoogleAuth()`; java: `VertexBackend`; php: `Anthropic\Vertex\Client`; ruby: `Anthropic::VertexClient`) 建立它。在其[使用者設定檔引數](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/attribute-requests#attribute-each-request)中傳遞 ID，用戶端就會傳送該標頭。

## 如果您使用 Microsoft Foundry

以下詳細資訊適用於[託管在 Anthropic 上](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-in-microsoft-foundry#hosting-options)的 [Microsoft Foundry 中的 Claude](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-in-microsoft-foundry) 部署。

* **建立使用者設定檔的位置：** 在 Claude API 上的組織中。`/v1/user_profiles` 端點不適用於 Microsoft Foundry。
* **需要先連結的項目：** 保存您 Foundry 資源的組織。Anthropic 會將其連結至您用來建立使用者設定檔的組織。若要申請此連結，請聯絡您的客戶團隊。
* **ID 的位置：** 連結建立後，放在 `anthropic-user-profile-id` 標頭中。在此之前，每個帶有使用者設定檔 ID 的請求都會傳回 `400`。

## 規則與特殊情況

### 各平台如何檢查 ID

有些平台會在每個請求上檢查 ID。關於是哪些平台以及它們會傳回什麼，請參閱[如果請求傳回 `400`](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/attribute-requests#if-a-request-returns-a-400)。

Claude Models on Google Cloud (Google managed) 會以 `400` 拒絕格式錯誤的 ID。Amazon Bedrock 在[可以攜帶使用者設定檔 ID 的請求](https://platform.claude.com/docs/zh-TW/manage-claude/user-profiles/platforms#amazon-bedrock-models)上也是如此。兩者都會接受任何格式正確的 ID。在這兩個平台上，成功的回應並不代表該 ID 與您的某個使用者設定檔相符。
