Claude Platform Docs

外部金鑰

建立外部金鑰
client.Beta.Organization.ExternalKeys.New(ctx, body) (*BetaExternalKey, error)
POST/v1/organizations/external_keys

建立由呼叫者組織擁有的外部金鑰設定。

列出外部金鑰
client.Beta.Organization.ExternalKeys.List(ctx, query) (*PageCursor[BetaExternalKey], error)
GET/v1/organizations/external_keys

列出呼叫者組織中的外部金鑰設定。

取得外部金鑰
client.Beta.Organization.ExternalKeys.Get(ctx, externalKeyID) (*BetaExternalKey, error)
GET/v1/organizations/external_keys/{external_key_id}

依 ID 擷取呼叫者組織中的單一外部金鑰設定。

更新外部金鑰
client.Beta.Organization.ExternalKeys.Update(ctx, externalKeyID, body) (*BetaExternalKey, error)
POST/v1/organizations/external_keys/{external_key_id}

部分更新外部金鑰設定。省略的欄位將保持不變。

刪除外部金鑰
client.Beta.Organization.ExternalKeys.Delete(ctx, externalKeyID) (*BetaOrganizationExternalKeyDeleteResponse, error)
DELETE/v1/organizations/external_keys/{external_key_id}

刪除外部金鑰設定。

驗證外部金鑰
client.Beta.Organization.ExternalKeys.Validate(ctx, externalKeyID) (*BetaOrganizationExternalKeyValidateResponse, error)
POST/v1/organizations/external_keys/{external_key_id}/validate

針對客戶的 KMS 驗證外部金鑰設定。

Models
type BetaAWSExternalKeyConfig struct { Type: "aws"; KMSARN; Region; RoleARN }
Type AWS
KMSARN string

Full ARN of the AWS KMS key. On Claude Platform on AWS the key must be a single-Region key in your organization's own AWS account; cross-account keys, multi-Region keys, and alias ARNs are rejected.

maxLength2048
Region string Optional

AWS region. Derived from kms_arn if omitted.

RoleARN string OptionalDeprecated

IAM role ARN. Deprecated — Anthropic reaches the KMS key through its own intermediate role (or, on Claude Platform on AWS, with credentials AWS issues for the Workspace); this field is ignored.

type BetaAzureExternalKeyConfig struct { Type: "azure"; KeyName; TenantID; /* 2 more */ }
Type Azure
KeyName string

Name of the key within the vault.

TenantID string

Azure AD tenant ID.

VaultURI string

Key Vault data-plane URI — https://{vault-name}.vault.azure.net or https://{hsm-name}.managedhsm.azure.net.

ClientID string Optional

Azure AD application (client) ID. Omit to use Anthropic's multitenant app. Provide only if using a single-tenant app registration in the customer's directory.

type BetaAzureExternalKeyConfigParam struct { Type: "azure"; KeyName; TenantID; /* 2 more */ }

Azure Key Vault provider configuration.

Type Azure
KeyName string

Name of the key within the vault.

TenantID string

Azure AD tenant ID.

VaultURI string

Key Vault data-plane URI — https://{vault-name}.vault.azure.net or https://{hsm-name}.managedhsm.azure.net.

ClientID string Optional

Azure AD application (client) ID. Omit to use Anthropic's multitenant app. Provide only if using a single-tenant app registration in the customer's directory.

type BetaExternalKey struct { Type: "external_key"; ID; Attachment; /* 5 more */ }

CMEK external key config belonging to the caller's organization.

Configs are organization-scoped. Workspaces attach to a config; once any workspace references it, the provider fields become effectively immutable (existing encrypted data needs the config for decrypt).

type BetaExternalKeyAttachedAttachment struct { Type: "attached" }
Type Attached
defaultattached
type BetaExternalKeyUnattachedAttachment struct { Type: "unattached" }
Type Unattached
defaultunattached
type BetaGCPExternalKeyConfig struct { Type: "gcp"; KeyName }
Type GCP
KeyName string

Full resource name of the Cloud KMS key.