Claude Platform Docs

获取外部密钥

$client->beta->organization->externalKeys->retrieve(string externalKeyID): ExternalKey
GET/v1/organizations/external_keys/{external_key_id}

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

Parameters
externalKeyID: string

ID of the External Key.

Returns
class ExternalKey { $type = 'external_key'; $id; $attachment; /* 5 more */ }
"external_key" type
string id

Identifier of the external key config. A tagged ID prefixed ekey_, or — for organizations on the Claude Platform on AWS — the AWS KMS key ARN.

Attachment attachment

Whether any workspace uses this config to encrypt its data — counting live and archived workspaces (an archived workspace's data remains encrypted under the config), excluding deleted ones. Only an attached config is used by the encryption path; an unattached config is inert and can be deleted.

\Datetime createdAt
?string displayName

Human-friendly display name. Null if none was set.

string geo

Data residency geo. Selects which regional validator handles this key's encrypt/decrypt roundtrips.

ProviderConfig providerConfig

KMS provider identity and auth coordinates.

\Datetime updatedAt
获取外部密钥
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'my-anthropic-api-key');

$betaExternalKey = $client->beta->organization->externalKeys->retrieve(
  'external_key_id'
);

var_dump($betaExternalKey);
Returns Examples
Response 200
{
  "id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
  "attachment": {
    "type": "attached"
  },
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "prod-us-key",
  "geo": "us",
  "provider_config": {
    "kms_arn": "arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222",
    "type": "aws",
    "region": "us-east-1",
    "role_arn": "arn:aws:iam::111122223333:role/anthropic-cmek"
  },
  "type": "external_key",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}