Webhook allows you to send traces to any HTTP endpoint that can receive JSON payloads. This is useful for integrating with custom observability systems, internal tools, or any service that accepts HTTP requests.
Create an HTTP endpoint that can receive POST or PUT requests with JSON payloads. Your endpoint should:
application/json content typeThe endpoint will receive traces in OpenTelemetry Protocol (OTLP) format, making it compatible with any OTLP-aware system.
Go to Settings > Observability and toggle Enable Broadcast.

Click the edit icon next to Webhook and enter:
https://api.example.com/traces)POST (default) or PUTExample headers for authenticated endpoints:
Click Test Connection to verify the setup. The configuration only saves if the test passes. During the test, OpenRouter sends an empty OTLP payload with an X-Test-Connection: true header to your endpoint.
Your endpoint should return a 2xx status code for the test to pass. A 400 status code is also accepted, as some endpoints reject empty payloads.
Make an API request through OpenRouter and verify that your webhook endpoint receives the trace data.
Traces are sent in OTLP JSON format. Each request contains a resourceSpans array with span data including:
Example payload structure:
The Webhook destination is ideal for:
For production use, ensure your webhook endpoint is highly available and can handle the expected volume of traces. Consider implementing retry logic on your end for any failed deliveries.
Custom metadata from the trace field is included as span attributes in the OTLP JSON payload sent to your webhook endpoint.
Custom metadata keys appear as span attributes in the OTLP payload under the trace.metadata.* namespace:
user field maps to user.id in span attributessession_id field maps to session.id in span attributesgen_ai.*) are included for model, token, and cost dataWhen Privacy Mode is enabled for this destination, prompt and completion content is excluded from traces. All other trace data — token usage, costs, timing, model information, and custom metadata — is still sent normally. See Privacy Mode for details.