OpenRouter
If your app calls models through OpenRouter, you can send a trace of every request to Anosys without changing your code. OpenRouter's Broadcast feature sends each request as an OpenTelemetry trace to your Anosys endpoint.
Each trace includes the model and provider, token usage (including cached and reasoning tokens), cost, latency and time to first token. If you send them, it also includes the user, the session, and the prompt and response.
%%{init: {"flowchart": {"curve": "linear"}}}%%
graph LR
A["Your app"] --> B["OpenRouter"]
B --> C["Model provider"]
B -->|"Broadcast<br/>(OTLP traces)"| D["Anosys endpoint<br/>OpenTelemetry / AI Agents"]
D --> E["Traces, dashboards,<br/>cost and alerts"]
Step 1. Create an endpoint
Create an endpoint of type OpenTelemetry / AI Agents. Open Collecting → Integration Options → OTEL and copy the Traces URL. You can use either form:
- Unauthorized: the URL alone identifies your endpoint. No headers needed.
- Authorized: the URL plus an
anosys-apikeyheader with your API key. Use this for production.
Step 2. Turn on Broadcast in OpenRouter
- In OpenRouter, open Settings → Observability and turn on Enable Broadcast. In an organization account, this needs admin rights.
- Click the edit icon next to OpenTelemetry Collector.
- Set Endpoint to the Traces URL you copied.
-
For the Authorized form, set Headers to:
-
Click Test Connection. OpenRouter saves the destination only if the test passes.
Result: send one request through OpenRouter. The endpoint's activity graph shows it within seconds, and the request appears in the Trace Timeline.
Step 3. Add users and sessions
To see cost and quality per user or per conversation, pass these fields on your OpenRouter requests:
| Field | What it does in Anosys |
|---|---|
user |
Ties each trace to one of your users (up to 128 characters) |
session_id (or the x-session-id header) |
Groups the requests of one conversation (up to 256 characters) |
trace |
Your own keys, for example environment or feature, so you can filter and group by them. trace_id, trace_name and span_name set the trace ID and names you see in Anosys, so you can group several calls into one trace. |
Control what is sent
These settings are on each OpenRouter Broadcast destination:
| Setting | Effect |
|---|---|
| Privacy Mode | Leaves out prompts and responses. Model, tokens, cost, timing and your metadata are still sent. |
| Sampling rate | Sends only a share of traces, from 0 to 1. Each session is kept or dropped as a whole. |
| API key filter | Sends traces only for the OpenRouter keys you pick, for example production keys only. |
To keep prompts but protect them in Anosys, see Security and data controls.
What you can do with it
- Compare models: chart cost, latency and time to first token by model and provider side by side.
- Track spend: cost per user, session, feature or environment. See Track AI and coding spend.
- Catch problems: alert on error spikes, slow providers or unusual cost with the Alert Builder.
- Check quality: score responses with Evaluations.