Expand description
Provider attribution headers.
Port of native Pi’s packages/coding-agent/src/core/provider-attribution.ts.
Some providers want to know which app is calling them (for their own
dashboards/quotas). Native pi attaches a small set of app-identifying headers
for OpenRouter, NVIDIA NIM, and Cloudflare, plus a session header for
opencode. This module reproduces that mapping.
Functions§
- default_
attribution_ headers - The app-identifying headers for
model(nativegetDefaultAttributionHeaders). - enabled
- Attribution is enabled unless
RPI_DISABLE_ATTRIBUTION=1(native gates this on install telemetry). - merge_
provider_ attribution_ headers - Merge session + attribution headers with caller-supplied sources (later
wins), matching native
mergeProviderAttributionHeaders. - session_
headers - opencode session headers (native
getSessionHeaders).