Skip to main content
OpenRouter is a multi-provider LLM gateway — one API key and an OpenAI-compatible endpoint for 100+ models. OpenRouter’s Broadcast feature is OpenTelemetry-native: with a one-time configuration in the OpenRouter dashboard, every request routed through OpenRouter is exported as a trace — no application code or instrumentation required.
This page configures OpenRouter to broadcast traces for all of its traffic. To instead instrument your own application’s calls to OpenRouter from Python, see OpenRouter Tracing.

How it works

OpenRouter sends Broadcast traces from its own infrastructure using OTLP over HTTP with JSON encoding. Phoenix accepts OTLP over HTTP with protobuf encoding, so you run an OpenTelemetry Collector between the two. The collector:
  • receives OpenRouter’s OTLP/JSON traces on a public HTTPS endpoint
  • sets the Phoenix project with the openinference.project.name resource attribute
  • forwards the traces to Phoenix as OTLP/protobuf
Because OpenRouter connects from the internet, both the collector and the Phoenix instance it forwards to must be reachable from where they run. The collector must be publicly reachable over HTTPS; a collector or Phoenix on localhost is not reachable from OpenRouter.

Launch Phoenix

The simplest option is a free Phoenix Cloud account. You can also self-host Phoenix alongside the collector. From the settings page in your Phoenix instance, copy your:
  • Endpoint — for Phoenix Cloud, https://app.phoenix.arize.com/s/<your-space-name>
  • API key — required when authentication is enabled, as it is on Phoenix Cloud

Run an OpenTelemetry Collector

Create otel-collector-config.yaml. The bearertokenauth extension makes the collector reject requests that don’t carry your shared token, so only OpenRouter can send it traces:
The otlp_http exporter appends /v1/traces to the endpoint and sends protobuf by default, which is what Phoenix expects. If your Phoenix instance doesn’t have authentication enabled, remove the headers block. Run the collector with your Phoenix credentials and a token of your choice:
Expose port 4318 on a public HTTPS URL, for example behind your cloud load balancer or a reverse proxy that terminates TLS. The rest of this page calls that URL https://<your-collector-host>.

Configure Broadcast in OpenRouter

  1. In the OpenRouter dashboard, navigate to Settings → Observability and toggle Enable Broadcast.
  2. Add the OpenTelemetry Collector destination.
  3. Set the Endpoint to https://<your-collector-host>/v1/traces.
  4. Set Headers to a JSON object that carries your collector token:
  5. Click Test Connection. OpenRouter only saves the configuration if the test passes.
  6. Save the destination.
  • Custom metadata: the trace field on an OpenRouter request is sent as span attributes, so you can attach your own identifiers to each trace.
  • Privacy mode: enable it to exclude prompt and completion content from broadcast traces; metadata and usage data are still sent.

Observe

Once Broadcast is enabled, every request through OpenRouter is exported to Phoenix. Open the openrouter project, or the name you set in the collector’s resource/phoenix_project processor, to see traces appear shortly after activity. Each trace includes the model, prompt, response, token usage, and latency for the request.

Troubleshooting

  • Test Connection fails. Confirm the collector is reachable at the public HTTPS URL, the endpoint ends in /v1/traces, and the Authorization header matches COLLECTOR_TOKEN.
  • Test Connection passes but no traces appear in Phoenix. Check the collector logs for export errors. Confirm PHOENIX_COLLECTOR_ENDPOINT is your Phoenix base URL without /v1/traces, and that PHOENIX_API_KEY is valid.
  • Traces land in the default project. Confirm the resource/phoenix_project processor is listed in the traces pipeline.

Resources

OpenRouter Broadcast to an OpenTelemetry Collector

OpenTelemetry Collector

OpenRouter Documentation