A C# console application that generates credit usage reports for Windsurf.
This tool helps team administrators see how many credits are used by each user in their Windsurf organization.
- Fetches all users from your Windsurf team using the User Page Analytics API
- Calculates credit usage for each user by querying the Cascade Analytics API in parallel
- Generates a sorted report showing users ranked by credit consumption (highest to lowest)
- Displays summary statistics including total credits consumed, average per user, and total user count
- .NET 9.0 SDK or later
- Windsurf Enterprise account with API access
- Service key with "Teams Read-only" permissions
-
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
-
Configure the application:
- Open
appsettings.json - Replace the placeholder with your actual service key:
{ "Windsurf": { "ServiceKey": "your_actual_service_key_here" } } - Open
-
Set your date range (optional):
- Edit
Program.cslines 35-36 to change the reporting period - Default is 2025-01-01 to 2025-12-31
- Edit
dotnet run- GetUserEmailsAsync: Fetches all user emails from the User Page Analytics API
- GetTotalPromptsUsedAsync: Gets credit usage for a single user from the Cascade Analytics API
- GetPromptsUsedByEmailAsync: Processes multiple users in parallel for efficient bulk reporting
- User Page Analytics API:
https://server.codeium.com/api/v1/UserPageAnalytics - Cascade Analytics API:
https://server.codeium.com/api/v1/CascadeAnalytics