Claude Platform Docs

Buat Tujuan Telemetri

$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

Daftarkan tujuan OpenTelemetry untuk organisasi.

Tujuan dimulai dalam status enabled. Sebuah organisasi dapat memiliki paling banyak 10 tujuan, termasuk yang dinonaktifkan.

Lihat panduan ekspor OpenTelemetry untuk mempelajari lebih lanjut tentang menambahkan tujuan.

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 */ }
Buat Tujuan Telemetri
<?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"
  }
}