Claude Platform Docs

建立遙測目的地

$client->beta->organization->telemetryDestinations->create(string endpointURL, TelemetryDestinationWorkspacesParams workspaces, ?string displayName, ?array<string,string> headers, ?TelemetryDestinationTracesParams traces, ?list<AnthropicBeta> betas): TelemetryDestination
POST/v1/organizations/telemetry_destinations
Requires anthropic-beta: telemetry-destinations-2026-08-11. How to send beta headers

為組織註冊 OpenTelemetry 目的地。

目的地的初始狀態為 enabled。一個組織最多可有 10 個目的地,包括已停用的目的地。

請參閱 OpenTelemetry 匯出指南,進一步了解如何新增目的地。

Parameters
endpointURL: string

The base URL of your collector's OTLP/HTTP endpoint, for example https://gateway.example.com.

The URL must use https and a hostname, not an IP address. The port, if given, must be 443. The URL must not contain a query string, a fragment, or a username and password. At most 2,048 characters.

A path prefix, such as /otlp, is allowed. Don't include the per-signal path (/v1/traces), because the API appends it on delivery. If your collector takes traces on another path, also set traces.endpoint_url.

Which of the organization's workspaces the destination covers.

displayName?: optional string

Human-readable name for the destination. Optional. 1 to 255 characters.

headers?: optional array<string,string>

Request headers that the API sends with every delivery, typically your collector's authentication header (for example authorization).

The API never returns the values. Reads show only header_names.

At most 20 headers. Names are at most 128 characters. Two names can't differ only in case. Values are printable ASCII, at most 4,096 characters, and can't begin or end with a space. Names and values together are at most 16,384 bytes.

Reserved names are rejected, for example host, cookie, user-agent, and names that start with content-, proxy-, x-forwarded-, or anthropic-. For this check, _ in a name counts as -.

The settings for the traces that the destination receives. If you leave it out, every setting takes its default.

betas?: optional list<AnthropicBeta>⁠Header parameter

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

Returns
class TelemetryDestination { $type = 'telemetry_destination'; $id; $createdAt; /* 8 more */ }
建立遙測目的地
<?php

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

use Anthropic\Client;
use Anthropic\Beta\AnthropicBeta;
use Anthropic\Beta\Organization\TelemetryDestinations\TelemetryDestinationContentMode;

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

$betaTelemetryDestination = $client
  ->beta
  ->organization
  ->telemetryDestinations
  ->create(
  endpointURL: 'x',
  workspaces: ['type' => 'all'],
  displayName: 'display_name',
  headers: ['foo' => 'string'],
  traces: [
    'contentMode' => TelemetryDestinationContentMode::METADATA_ONLY,
    'enabled' => true,
    'endpointURL' => 'endpoint_url',
    'maxContentBytes' => 0,
  ],
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
);

var_dump($betaTelemetryDestination);
Returns Examples
Response 200
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "delivery_health": {
    "last_error": "last_error",
    "last_error_at": "2019-12-27T18:11:19.117Z",
    "last_success_at": "2019-12-27T18:11:19.117Z"
  },
  "display_name": "display_name",
  "endpoint_url": "endpoint_url",
  "header_names": [
    "string"
  ],
  "state": {
    "type": "enabled"
  },
  "traces": {
    "content_mode": "metadata_only",
    "enabled": true,
    "endpoint_url": "endpoint_url",
    "max_content_bytes": 0
  },
  "type": "telemetry_destination",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "workspaces": {
    "type": "all"
  }
}