Observability

Create an observability destination

Changed on

Create a new observability destination. A maximum of 5 enabled destinations per workspace, across all types, is allowed; disabled destinations do not count. A workspace already above the cap keeps its enabled destinations but cannot create or enable more until fewer than 5 are enabled. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace; use the workspace_id body field to scope to a different workspace. A workspace-scoped management key can only create in its own workspace; any other workspace_id returns 403. Management key required.

post/observability/destinations

Request

  • Base URL
    https://openrouter.ai/api/v1
  • Auth
    HTTP bearer

Request body

CreateObservabilityDestinationRequest required
api_key_hashes, string[] nullable

Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. null or omitted means all keys. Must contain at least one hash if provided. Every hash must belong to an API key in the destination's workspace; any other hash returns 400.

broadcast_generation_cost, boolean

When true, include cost and billing generation metadata.

broadcast_generation_cost_allocation, boolean

Beta. When true, include openrouter_cost_allocation: per-token-kind usage and cost, sent only when they reconcile with the billed cost.

broadcast_generation_identity, boolean

When true, include identity generation metadata.

broadcast_generation_request_context, boolean

When true, include request-context generation metadata.

config, object required

Provider-specific configuration. The shape depends on type and is validated server-side.

enabled, boolean

Whether this destination should be enabled immediately.

filter_rules, ObservabilityFilterRulesConfigNullable nullable

Optional structured filter rules controlling which events are forwarded.

name, string required

Human-readable name for the destination.

privacy_mode, boolean

When true, request/response bodies are not forwarded — only metadata.

regions, ObservabilityDataRegionInput[]

Data regions this destination applies to. eu is accepted as an alias for europe and normalizes to europe. Omitting this field defaults to ['global']; the array must be non-empty.

sampling_rate, number double

Sampling rate between 0.0001 and 1 (1 = 100%).

type, 'arize' | 'braintrust' | 'clickhouse' | 'datadog' | 'grafana' | 'langfuse' | 'langsmith' | 'newrelic' | 'opik' | 'otel-collector' | 'posthog' | 'ramp' | 's3' | 'sentry' | 'snowflake' | 'weave' | 'webhook' required

The destination type. Only stable destination types are accepted.

workspace_id, string uuid

Optional workspace ID. Defaults to the authenticated entity's default workspace, or a workspace-scoped management key's own workspace.

Example request

{
  "config": {
    "baseUrl": "https://us.cloud.langfuse.com",
    "publicKey": "pk-l...EfGh",
    "secretKey": "sk-l...AbCd"
  },
  "name": "Production Langfuse",
  "type": "langfuse"
}

Response

Destination created successfully

CreateObservabilityDestinationResponse required
data, intersection required

The newly created observability destination.

Example response

{
  "data": {
    "api_key_hashes": null,
    "broadcast_generation_cost": false,
    "broadcast_generation_cost_allocation": false,
    "broadcast_generation_identity": false,
    "broadcast_generation_request_context": false,
    "config": {
      "baseUrl": "https://us.cloud.langfuse.com",
      "publicKey": "pk-l...EfGh",
      "secretKey": "sk-l...AbCd"
    },
    "created_at": "2025-08-24T10:30:00Z",
    "enabled": true,
    "filter_rules": null,
    "id": "99999999-aaaa-bbbb-cccc-dddddddddddd",
    "name": "Production Langfuse",
    "privacy_mode": false,
    "regions": [
      "global"
    ],
    "sampling_rate": 1,
    "type": "langfuse",
    "updated_at": "2025-08-24T15:45:00Z",
    "workspace_id": "550e8400-e29b-41d4-a716-446655440000"
  }
}

Changes

    • info

      added the optional property data/allOf[#/components/schemas/ObservabilityDestination]/oneOf[#/components/schemas/ObservabilityOtelCollectorDestination]/config/metricsEndpoint to the response with the status

    • info

      added the optional property data/allOf[#/components/schemas/ObservabilityDestination]/oneOf[#/components/schemas/ObservabilityOtelCollectorDestination]/config/shouldSendMetrics to the response with the status

    • info

      the data/allOf[#/components/schemas/ObservabilityDestination]/oneOf[#/components/schemas/ObservabilityS3Destination]/config/roleArn response's property pattern was changed from ^arn:aws(?:-[a-z]+)*:iam::\d{12}:role\/[\w+=,.@/-]{1,512}$ to ^arn:aws:iam::\d{12}:role\/[\w+=,.@/-]{1,512}$ for the status