Claude Platform Docs

测试遥测目标

$client->beta->organization->telemetryDestinations->test(string destinationID, ?list<AnthropicBeta> betas): TelemetryDestinationTestResponse
POST/v1/organizations/telemetry_destinations/{destination_id}/test
Requires anthropic-beta: telemetry-destinations-2026-08-11. How to send beta headers

使用目标已注册的标头向其发送一个名为 anthropic.test 的测试 span,仅发送一次且不重试,并报告目标的响应。无论目标是否以 2xx 状态响应,响应均为 200:其 result 的类型为 success,或类型为 failure 并在 error 中给出原因。目标的配置、state 和 delivery_health 不会改变。已禁用的目标也可以测试。对同一目标的两次测试之间请等待 10 秒;过早发出的请求可能会收到 429 状态。

Parameters
destinationID: string⁠Path parameter

ID of the destination to test (starts with tdst_).

betas?: optional list<AnthropicBeta>⁠Header parameter

This endpoint is in beta: requests must send telemetry-destinations-2026-08-11 in this header.

Returns
class TelemetryDestinationTestResponse { $type = 'telemetry_destination_test'; $result; }
"telemetry_destination_test" type

How the test went: success when the destination answered with a 2xx status, else failure with the reason.

测试遥测目标
<?php

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

use Anthropic\Client;
use Anthropic\Beta\AnthropicBeta;

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

$betaTelemetryDestinationTestResponse = $client
  ->beta
  ->organization
  ->telemetryDestinations
  ->test('destination_id', betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24]);

var_dump($betaTelemetryDestinationTestResponse);
Returns Examples
Response 200
{
  "result": {
    "type": "success"
  },
  "type": "telemetry_destination_test"
}