P1 ARDR research: OpenRouter Analytics API -> StarIntel LLM telemetry #199
Labels
No labels
bug
design
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/starintel-auto-research#199
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
StarIntel problem
Owning issue:
starintel-labs/starintel-infra#65.StarIntel wants OpenRouter cost/token/model/provider activity in the canonical OpenObserve
llmtelemetry stream. The owning issue was written when the exact upstream collection surface was uncertain and explicitly required re-checking current OpenRouter APIs rather than assuming a webhook.Current
starintel-infra/maininspected ata9de6e13ab83ba7a0d6c5994c9d8330f1271c3cf. Repository code search found no existing OpenRouter collector implementation to preserve.ARDR state
READY_FOR_DESIGNImplementation approval remains operator-only.
Current upstream evidence
OpenRouter announced its Activity dashboard / Analytics API on 2026-08-17. The current first-party description says the Analytics API exposes the same aggregate data as Activity and supports metrics including spend, request count, prompt/completion/reasoning/cached tokens, cache hit rate, blended cost, BYOK-vs-credit spend, latency and throughput. It can group by dimensions including model, variant, provider, API key, app, user, workspace, origin, country, data region, finish reason, context length, session, generation, custom user IDs and classifier dimensions, with minute/hour/day/week/month rollups.
OpenRouter also documents per-response usage accounting in API responses, but that surface only covers requests StarIntel directly intercepts and therefore is not a complete account/workspace reconciliation source. Current OpenRouter material also distinguishes Activity/account analytics from per-key usage totals and per-response
usageobjects.Research decision
Use the OpenRouter Analytics API as the authoritative upstream accounting source for this collector. Do not scrape the Activity UI and do not invent a webhook dependency.
Per-response usage may later be correlated for low-latency request telemetry, but aggregate/account reconciliation must remain Analytics-API-backed so requests from multiple StarIntel agents/apps/keys are recoverable after collector downtime.
StarIntel requirements
Normalized
llmtelemetry contractAt minimum preserve:
openrouter-analyticsDo not manufacture zero values for fields the API omitted; preserve missing/unknown semantics.
Acquisition strategy
Use a small bounded scheduled collector. This is an external SaaS API adapter, so an external HTTP request is justified, but no new general StarLang syntax is required. If StarIntel later represents scheduled acquisition jobs in StarLang, the collector can be invoked through that capability; the upstream protocol adapter remains ordinary service/runtime code.
Privacy boundary
Never persist/export by default:
Dimension values must be independently allowlisted; the fact that OpenRouter can group by a dimension does not make it safe for StarIntel telemetry.
RED-first research output
First implementation slice should be a pure normalization/reconciliation contract with fixtures, before any live credential/API wiring.
Mandatory initial REDs on untouched infra:
llmrecord;Adversarial findings
Rejected:
usageand losing requests generated outside one instrumented proxy;Dependencies
The pure collector contract can be designed/tested before those services are live; deployment/export integration remains dependent on their stable ingestion contract.
Decision
Evidence is sufficient for design. No human research validation is required.
Implementation approval:
PENDING / AWAITING_OPERATOR_APPROVAL.