This page is for OpenRouter’s server-side Broadcast. To trace OpenRouter calls from your own Go code instead, see OpenRouter (Go).
Prerequisites
- An OpenRouter account. Broadcast can be set up for your user or, by an admin, for an organization.
- A LangWatch API key, from your project settings.
Setup
1
Enable Broadcast in OpenRouter
In OpenRouter, go to Settings > Observability and turn on Enable Broadcast.
2
Configure the OpenTelemetry Collector destination
Click the edit icon next to OpenTelemetry Collector and enter:Replace
- Endpoint:
https://app.langwatch.ai/api/otel/v1/traces - Headers:
<LANGWATCH_API_KEY> with your LangWatch API key. OpenRouter encrypts destination credentials before storing them.Self-hosted LangWatch: replace https://app.langwatch.ai with the URL of your own instance, for example https://langwatch.example.com/api/otel/v1/traces. OpenRouter sends traces from its own servers, so the endpoint must be reachable from the public internet.3
Test and save
Click Test Connection. OpenRouter only saves the destination when the test passes.
4
Send a test request
Make a request through OpenRouter:
5
See the trace in LangWatch
Open your project in LangWatch. The trace for the request appears in the traces list.
What OpenRouter sends
According to the Broadcast documentation, each trace includes:- The input messages and the model output, with multimodal content stripped.
- Token usage: prompt, completion and total tokens.
- The total cost of the request.
- Timing: start time, end time and latency.
- The model slug and the provider that served the request.
- Whether tools were included in the request and whether tool calls were made.
gen_ai.*), and the prompt and completion are on the generation span.
Sessions, users and metadata
OpenRouter reads these optional fields from the request body and adds them to the trace:
A few keys inside
trace have a fixed meaning for the OpenTelemetry Collector destination:
Example request body:
Destination options
These OpenRouter settings apply per destination:- Privacy Mode removes the input messages and the output from traces. Tokens, cost, timing, model and custom metadata are still sent.
- Sampling rate sends a share of traces, for example
0.5for about half. When you send asession_id, every trace in a session is kept or dropped together. - API key filtering sends only traces from the API keys you select, and never from keys you exclude.