Claude Platform Docs

外部密钥

创建外部密钥
organization.external_keys.create(**kwargs) -> ExternalKey
POST/v1/organizations/external_keys

创建一个归调用方组织所有的外部密钥配置。

列出外部密钥
organization.external_keys.list(**kwargs) -> SyncPageCursor[ExternalKey]
GET/v1/organizations/external_keys

列出调用方组织中的外部密钥配置。

获取外部密钥
organization.external_keys.retrieve(external_key_id) -> ExternalKey
GET/v1/organizations/external_keys/{external_key_id}

按 ID 检索调用方组织中的单个外部密钥配置。

更新外部密钥
organization.external_keys.update(external_key_id, **kwargs) -> ExternalKey
POST/v1/organizations/external_keys/{external_key_id}

部分更新外部密钥配置。省略的字段保持不变。

删除外部密钥
organization.external_keys.delete(external_key_id) -> ExternalKeyDeleteResponse
DELETE/v1/organizations/external_keys/{external_key_id}

删除外部密钥配置。

验证外部密钥
organization.external_keys.validate(external_key_id) -> ExternalKeyValidateResponse
POST/v1/organizations/external_keys/{external_key_id}/validate

针对客户的 KMS 验证外部密钥配置。

Models
class AWSExternalKeyConfig: type: "aws"; kms_arn; region
type: Literal["aws"]
kms_arn: str

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: Optional[str]

AWS region. Derived from kms_arn if omitted.

class AzureExternalKeyConfig: type: "azure"; key_name; tenant_id; ... # 2 more
type: Literal["azure"]
key_name: str

Name of the key within the vault.

tenant_id: str

Azure AD tenant ID.

vault_uri: str

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

client_id: Optional[str]

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.

class AzureExternalKeyConfigParam: type: "azure"; key_name; tenant_id; ... # 2 more

Azure Key Vault provider configuration.

type: Literal["azure"]
key_name: str

Name of the key within the vault.

tenant_id: str

Azure AD tenant ID.

vault_uri: str

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

client_id: Optional[str]

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.

class ExternalKey: 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).

class ExternalKeyAttachedAttachment: type: "attached"
type: Literal["attached"]
defaultattached
class ExternalKeyUnattachedAttachment: type: "unattached"
type: Literal["unattached"]
defaultunattached
class GCPExternalKeyConfig: type: "gcp"; key_name
type: Literal["gcp"]
key_name: str

Full resource name of the Cloud KMS key.

class ExternalKeyDeleteResponse: type: "external_key_deleted"; id
type: Literal["external_key_deleted"]
defaultexternal_key_deleted
id: str

ID of the deleted External Key.

class ExternalKeyValidateResponse: type: "external_key_validation"; error; status

Result of a validation roundtrip against the customer's KMS.

HTTP 200 for both outcomes — the operation completed; status says whether the key works.

type: Literal["external_key_validation"]
defaultexternal_key_validation
error: Optional[str]

Error message when status is failure. Null otherwise.

status: Literal["failure", "success"]

success — encrypt/decrypt roundtrip succeeded. failure — the roundtrip failed or timed out; see error.

One of the following:
"failure"
"success"