Skip to main content
Connect Oh My Pi to Weave to report AI model usage across your team. Weave receives Pi’s OpenTelemetry traces and metrics: traces record completed chat requests, token usage, and sessions, while the cost metric records aggregate reported cost.

What’s tracked

  • Model usage — the requested or served model from each completed chat request
  • Token usage — uncached input, cache-read, cache-creation, and output tokens
  • Sessions — chat requests grouped by Pi conversation ID when Pi provides one
  • Cost — the cumulative cost metric Pi exports for completed chat calls, including OpenRouter’s reported cost when the OpenRouter response provides it. Because this metric has no request or conversation ID, it is used for aggregate cost reporting rather than session assignment
  • People — usage attributed to the Weave account identified by the telemetry resource email
Weave does not ingest Pi prompts, model responses, tool arguments, or tool results in this integration.

Prerequisites

  • The current Oh My Pi release installed
  • An OpenRouter account and API key if your team routes Pi through OpenRouter
  • Admin access to your Weave organization to create a Pi telemetry key
  • The email address on each user’s Weave account

Setup

1

Create a Pi telemetry key in Weave

Go to Data → Pi → Create API key. The key is organization-wide. Copy the generated environment configuration immediately; Weave shows the full key only when it is created.
2

Configure each user's identity

The API key is shared by the organization, but identity is per person. Each Pi user must set OTEL_RESOURCE_ATTRIBUTES with their own Weave account email:
Do not use another user’s email. Requests without a usable identity are accepted by the ingest endpoint but are discarded before attribution.If OTEL_RESOURCE_ATTRIBUTES is already set, append user.email to the existing comma-separated value instead of replacing the existing resource attributes:
The address must not contain , or = because those characters are separators in the OpenTelemetry resource-attribute format.
3

Enable the Weave OTLP exporter

Set these variables in the same environment that runs Oh My Pi. The Data → Pi page generates this block with the real key and signed-in user’s email:
Pi appends /v1/traces and /v1/metrics to the OTLP endpoint for the two enabled signals:
4

Configure OpenRouter in Pi

Configure OpenRouter in Oh My Pi using the current Pi provider instructions. Add the OpenRouter credential to Pi’s provider configuration and select the models your team wants to use.The OpenRouter credential stays in Pi. Do not send it to Weave or put it in the Weave telemetry header. Weave needs only the wpikey_ telemetry key.
5

Verify the connection

Run a few Pi chat requests, then check the AI reports in Weave. Telemetry is processed asynchronously, so newly received activity may take time to appear. If a request is not attributed, first check that the user’s OTEL_RESOURCE_ATTRIBUTES contains their own Weave email.

Cost reporting

When Pi routes requests through OpenRouter, Pi exports OpenRouter’s reported cost through the cumulative pi.omp.agent.chat.cost.estimated_usd OTLP metric. Weave converts repeated cumulative exports into deltas and includes those deltas in aggregate Pi cost reporting. The metric has no request or conversation ID, so it cannot be assigned to individual Pi sessions. The trace path remains the source for per-request tokens and sessions. If Pi does not emit a populated cost metric, Weave retains the trace usage but cannot report aggregate provider cost. See OpenRouter usage in Weave for the cost model, visibility, and reconciliation guidance.

Visibility in Weave

Pi is the source shown in Weave for usage that Pi reports. OpenRouter is the provider Pi uses to fulfill a request. If you also connect OpenRouter Analytics, the usage it syncs appears under a separate OpenRouter source. After processing and the next reporting refresh, authorized users can see Pi usage in:
  • AI reports — usage by person, team, time period, and AI tool
  • AI tool costs — cost and request metrics, including the Pi source
  • Token usage views — input, output, and cache-token totals by model and person
  • Session views — Pi conversation activity when a conversation ID is present
  • Data → Pi — telemetry-key management and the generated setup configuration
The current integration does not expose prompt text or tool-call content for drilldowns. This keeps the first rollout focused on model, token, session, and cost reporting.

Troubleshooting

A 200 response means the telemetry was accepted for asynchronous processing; it does not mean the request is already visible in reports. Check the user’s identity attribute, then allow time for ingest and reporting refreshes to complete.
Check that OTEL_RESOURCE_ATTRIBUTES contains user.email=<the user's Weave email>. Each person must set their own value. Do not share the email from another user’s generated configuration.
OpenRouter authentication is configured in Pi and is independent of the Weave telemetry key. Check Pi’s provider configuration and OpenRouter credential; the Weave header should contain only the wpikey_ value.
Aggregate Pi cost comes from the OTLP metrics signal. Pi also reports a cost on each chat span, which Weave uses for session costs but leaves out of aggregate AI tool cost so the same spend isn’t counted twice. Confirm OTEL_METRICS_EXPORTER='otlp' is set and that Pi emits a populated pi.omp.agent.chat.cost.estimated_usd metric; if that metric is absent or zero, Weave keeps the usage data but has no aggregate cost to report.
Last modified on October 17, 2026