Claude Platform Docs

Проверить внешний ключ

$client->organization->externalKeys->validate(string externalKeyID): ExternalKeyValidateResponse
POST/v1/organizations/external_keys/{external_key_id}/validate

Проверяет конфигурацию внешнего ключа в KMS клиента.

Anthropic выполняет цикл шифрования/расшифровки с использованием настроенного ключа KMS и ожидает результат до 30 секунд. Статус ответа — success, если цикл выполнен успешно, или failure с сообщением об ошибке, если он завершился неудачей или истекло время ожидания.

Parameters
externalKeyID: string⁠Path parameter

ID of the External Key.

Returns
class ExternalKeyValidateResponse { $type = 'external_key_validation'; $error; $status; }
"external_key_validation" type
?string error

Error message when status is failure. Null otherwise.

Status status

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

Проверить внешний ключ
<?php

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

use Anthropic\Client;

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

$response = $client->organization->externalKeys->validate('external_key_id');

var_dump($response);
Returns Examples
Response 200
{
  "error": "error",
  "status": "failure",
  "type": "external_key_validation"
}