Skip to content

About

C# console application that generates credit usage reports for Windsurf

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Windsurf Analytics Report Tool

A C# console application that generates credit usage reports for Windsurf.

Purpose

This tool helps team administrators see how many credits are used by each user in their Windsurf organization.

What It Does

  1. Fetches all users from your Windsurf team using the User Page Analytics API
  2. Calculates credit usage for each user by querying the Cascade Analytics API in parallel
  3. Generates a sorted report showing users ranked by credit consumption (highest to lowest)
  4. Displays summary statistics including total credits consumed, average per user, and total user count

Prerequisites

  • .NET 9.0 SDK or later
  • Windsurf Enterprise account with API access
  • Service key with "Teams Read-only" permissions

Setup

  1. Get your service key:

    • Navigate to Windsurf Team Settings
    • Go to the "Service Keys" section
    • Ensure Individual Level Analytics is enabled
    • Create a new service key with "Teams Read-only" permissions
    • Copy the generated service key
  2. Configure the application:

    • Open appsettings.json
    • Replace the placeholder with your actual service key:
    {
      "Windsurf": {
        "ServiceKey": "your_actual_service_key_here"
      }
    }
  3. Set your date range (optional):

    • Edit Program.cs lines 35-36 to change the reporting period
    • Default is 2025-01-01 to 2025-12-31

How to Run

dotnet run

Technical Details

API Methods

  1. GetUserEmailsAsync: Fetches all user emails from the User Page Analytics API
  2. GetTotalPromptsUsedAsync: Gets credit usage for a single user from the Cascade Analytics API
  3. GetPromptsUsedByEmailAsync: Processes multiple users in parallel for efficient bulk reporting

APIs Used

  • User Page Analytics API: https://server.codeium.com/api/v1/UserPageAnalytics
  • Cascade Analytics API: https://server.codeium.com/api/v1/CascadeAnalytics

About

C# console application that generates credit usage reports for Windsurf

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages