Skip to content

OpenRouter

OpenRouter usage is imported from the Activity API and attributed to organization members by email.

  1. Create a management key for your OpenRouter organization

  2. Set the environment variable:

    Terminal window
    OPENROUTER_MANAGEMENT_KEY=sk-or-v1-...
  3. Optionally, limit the import to specific workspaces by ID or slug (comma-separated):

    Terminal window
    OPENROUTER_WORKSPACES=engineering

    Leave it unset to import activity from all workspaces.

Setting Value
Schedule Every 6 hours
Data Daily token counts, model, member email, cost (including BYOK)
History Last 30 days (OpenRouter’s activity retention)

The first sync imports the full 30-day window. Later syncs re-import from the day before the last sync through today, so partial days are completed on the next run.

When workspaces are configured, only members of those workspaces are imported and records are tagged with the workspace (openrouter:<workspace-id>).

Terminal window
pnpm cli sync openrouter --days 30