GPTMeter is a lightweight Windows 11 companion for the official ChatGPT desktop application. It runs in the notification area, detects ChatGPT, and displays a compact floating usage widget near the top of the appropriate monitor.
GPTMeter is an independent project and is not affiliated with or endorsed by OpenAI.
- Configurable ChatGPT process detection and background monitoring
- Compact always-on-top widget with smooth hover expansion and delayed collapse
- Horizontally draggable widget constrained to the monitor's upper work area
- Five-hour and weekly used/remaining percentages, reset clocks, and countdowns
- Automatic normal, warning, and critical usage colors
- System, Light, and Dark themes with live Windows theme tracking
- Immediate theme, position, and opacity previews with Save/Discard/Cancel handling
- Top Left, Top Center, and Top Right placement
- Multi-monitor, work-area, per-monitor-v2 DPI, and Windows virtual-desktop support
- Custom Windows 11-style tray menu and GPTMeter application icon
- Tray commands for widget display, refresh, ChatGPT launch, settings, startup, monitoring, theme, and exit
- Mock, manual, and experimental Windows UI Automation usage providers
- Per-user Windows startup without administrator privileges
- Portable JSON settings and usage storage with safe corruption recovery
- Size-limited local logs that exclude credentials and conversation content
- Self-contained single-file publishing for Windows x64 and Arm64
See the User Guide for installation, configuration, operation, and troubleshooting.
Add current screenshots of the collapsed widget, expanded widget, Settings window, and tray menu here.
- C# and .NET 8
- WPF and MVVM
- Windows Forms
NotifyIconwith a custom WPF tray menu System.Diagnosticsprocess discovery- Windows UI Automation behind
IUsageProvider - Win32 monitor APIs and Windows Virtual Desktop Manager
System.Text.Json
No Electron, browser automation, WebView UI, screenshot OCR, or undocumented ChatGPT API is used.
GPTMeter.sln
src/GPTMeter/
Assets/
Models/
Properties/PublishProfiles/
Services/
Utilities/
ViewModels/
Views/
Windows/
tests/GPTMeter.Tests/
App.xaml.cs is the composition root. UI state lives in view models, while process detection, usage retrieval, countdowns, settings, startup, logging, launching, monitor placement, and virtual-desktop behavior are separated into services.
- Windows 10 or Windows 11; Windows 11 is the primary target
- .NET 8 SDK
- Optional: Visual Studio 2022 with the .NET desktop development workload
- The official ChatGPT Windows application for integration testing
Verify the SDK:
dotnet --versiongit clone https://github.com/MadushanSandaru1/GPTMeter.git gptmeter
cd gptmeter
dotnet restore GPTMeter.sln
dotnet build GPTMeter.sln
dotnet test GPTMeter.sln
dotnet run --project src/GPTMeter/GPTMeter.csprojGPTMeter starts in the notification area. If the widget is hidden, right-click its tray icon and select Show widget.
Developer Mode enables Windows development and deployment features. On current Windows 11 versions, open Settings, search for Developer Mode, or go to System → Advanced → For developers, then enable Developer Mode and accept the administrator prompt. On earlier Windows 11 versions the page may be named For developers directly under Settings.
Developer Mode is useful for development tooling, but it is not a Smart App Control exception and does not make an unsigned GPTMeter build trusted. A normal dotnet build may not require Developer Mode, depending on the machine and deployment workflow. See Microsoft's Developer Mode documentation.
Smart App Control can block locally compiled GPTMeter.exe or GPTMeter.dll because development outputs are unsigned and do not yet have reputation. There is currently no per-application Allow exception. Unblock-File does not help when the file has no Mark of the Web and is being rejected for its signing level.
Supported approaches are:
- Develop and test in a VM where Smart App Control is not enforcing.
- Sign every distributed EXE and DLL with a publicly trusted RSA code-signing certificate.
- Publish an MSIX package through the Microsoft Store, which signs approved packages.
Avoid disabling Smart App Control on a primary machine solely for development. Changing it affects the whole device and restoration behavior depends on the Windows version. See Smart App Control overview and Microsoft's code-signing guidance.
Windows x64:
dotnet publish src/GPTMeter/GPTMeter.csproj `
-c Release `
-r win-x64 `
--self-contained true `
-p:PublishSingleFile=trueWindows Arm64:
dotnet publish src/GPTMeter/GPTMeter.csproj `
-c Release `
-r win-arm64 `
--self-contained true `
-p:PublishSingleFile=trueOutput is written to:
src/GPTMeter/bin/Release/net8.0-windows/<runtime>/publish/
The self-contained build does not require .NET on the target PC. Self-contained does not mean code-signed; public distribution still requires trusted signing or Store packaging to avoid application-control blocks.
GPTMeter prefers portable storage beside the executable:
GPTMeter.exe
data/
settings.json
usage.json
logs/
gptmeter.log
gptmeter.log.1
When the executable directory is read-only, storage falls back to %LOCALAPPDATA%\GPTMeter.
Example settings:
{
"position": "TopCenter",
"autoHide": true,
"alwaysOnTop": true,
"launchMinimized": true,
"startWithWindows": false,
"showUsedPercentage": true,
"hoverExpansionEnabled": true,
"opacity": 0.94,
"collapseDelayMilliseconds": 500,
"processPollIntervalSeconds": 2,
"usageRefreshIntervalSeconds": 60,
"usageProvider": "Mock",
"theme": "System",
"chatGptProcessNames": ["ChatGPT", "ChatGPT.Windows"]
}Values are normalized to safe ranges. Missing or malformed JSON falls back to defaults rather than terminating the application.
- Mock returns representative offline values for UI testing.
- Manual accepts 0–100 percentages and local reset date/times, persisted in
data/usage.json. - Automatic experimentally reads text exposed by the open ChatGPT window through supported Windows UI Automation.
Automatic mode interprets ChatGPT labels such as 94% left as 6% used and 94% remaining. For best results, open ChatGPT's usage or plan page before refreshing. If ChatGPT does not expose those controls to the Windows accessibility tree, GPTMeter reports that limitation in its status line and retains the last successful values.
GPTMeter does not claim that an official ChatGPT subscription-usage API exists. It does not collect passwords, copy cookies or tokens, read conversations, automate a browser, or perform screenshot OCR.
The test project covers:
- Countdown and reset-clock formatting
- Used/remaining percentage calculations and bounds
- Automatic parsing of
left,remaining,used, andconsumedlabels - Valid, missing, and malformed settings JSON
Run:
dotnet test GPTMeter.sln -c Release- Automatic usage retrieval works only when the installed ChatGPT UI exposes usage text through Windows UI Automation.
- ChatGPT UI wording and accessibility structure can change without notice.
- Process names may change after a ChatGPT update; edit
chatGptProcessNamesif detection stops working. - Open ChatGPT depends on the installed application appearing in the Windows AppsFolder with a name containing
ChatGPT. - A locally built unsigned application can be blocked by Smart App Control.
- Portable storage beside the executable requires write permission.
- Improve automatic-provider diagnostics and parsing coverage
- Add signed MSIX packaging and release automation
- Add screenshot assets and accessibility review
- Expand unit and UI integration tests
- Produce a stable signed v1.0 release
Issues and focused pull requests are welcome. Keep dependencies minimal, preserve service/provider boundaries, avoid undocumented authentication or usage endpoints, and add tests for non-UI logic.
Licensed under the MIT License.