A WXT-based browser extension that enhances the ChatGPT Codex Analytics page.
It visualizes token usage, activity, model distribution, and client distribution from the analytics responses already requested by the page.
When you open ChatGPT Codex Analytics, the extension appends enhanced content below the official analytics charts:
| Chart | Contents |
|---|---|
| Token usage trend | Cached input, uncached input, output, and total tokens (area chart) |
| Credits usage trend | Credits usage over time (area chart) |
| Activity | Users, threads, and turns (bar chart) |
| Model distribution | Usage share by model (doughnut chart) |
| Client distribution | Usage share by client, such as Web and Codex (doughnut chart) |
- The aggregation period follows the official Analytics page: day / week / month
- Summary cards for user activity days, turns, thread activity, credits, total tokens, and date range
- The enhanced panel can be collapsed and updates after the official page receives new data
- Dark and light theme support
- Standard WebExtension i18n with English and Simplified Chinese catalogs; the browser extension locale selects the UI and Chrome Web Store listing text
- WXT — Next-generation Web Extension framework
- Vue 3 — UI for the injected analytics panel
- ECharts 6 — On-demand chart modules for visualizations
- Lucide — Vue SVG icon library
@wxt-dev/i18n— WXT's type-safe wrapper around the standard WebExtension i18n API- Shadow DOM — Isolated styles for the injected panel
chatgpt-analytics/
├── .github/workflows/ # CI and draft release workflows
│ ├── ci.yml
│ └── release.yml
├── entrypoints/
│ ├── analytics-interceptor.content.ts # Main-world fetch/XHR response observer
│ ├── stats.content/ # Content script for the Codex Analytics page
│ │ ├── index.ts # Shadow DOM UI mounting
│ │ └── App.vue # Charts and usage details table
│ └── popup/ # Extension popup
│ ├── index.html
│ ├── main.ts
│ ├── App.vue # Analytics page link
│ └── style.css
├── locales/ # Source localization catalogs
│ ├── en.json
│ └── zh_CN.json
├── utils/
│ ├── types.ts # Analytics response types
│ ├── config.ts # Panel configuration
│ ├── api.ts # Response listening, parsing, and normalization
│ ├── charts.ts # Data aggregation and chart datasets
│ └── page-bridge.ts # Main-world / isolated-world event bridge
├── public/icon/ # Extension icons (16 to 512 px)
├── wxt.config.ts # WXT configuration
└── package.json
Install the published extension from the Chrome Web Store:
After installation:
- Open ChatGPT Codex Analytics while signed in to your account.
- Scroll below the official analytics charts to view the enhanced panel.
Prerequisites: Node.js >= 22 and Chrome or Firefox.
# 1. Install dependencies
npm install
# 2. Start development mode
npm run dev
# 3. Build a production extension
npm run build- Run
npm run build(ornpm run packto also generate.output/chatgpt-analytics-*.zip). - Open
chrome://extensions/. - Enable Developer mode in the top right.
- Click Load unpacked and select
.output/chrome-mv3. - Open ChatGPT Codex Analytics and view the enhanced content below the official charts.
To load the packaged zip instead of the unpacked folder, drag .output/chatgpt-analytics-*.zip onto chrome://extensions/.
- Run
npx wxt build --browser firefox. - Open
about:debugging#/runtime/this-firefox. - Click Load Temporary Add-on and select
.output/firefox-mv2/manifest.json. - Open the Analytics page.
# Chrome
npm run pack
# .output/chatgpt-analytics-1.0.0-chrome.zip
# Firefox
npx wxt zip --browser firefox
# .output/chatgpt-analytics-1.0.0-firefox.zipThe actual archive name includes the version from package.json.
GitHub Actions runs lint, type checking, and Chrome/Firefox builds on pushes to main and on pull requests targeting main.
To create a draft release, update the package version, commit it, and push a matching v* tag:
npm version patch --no-git-tag-version
git add package.json package-lock.json
git commit -m "chore: release v1.0.1"
git tag v1.0.1
git push origin main v1.0.1The tag must match the version in package.json. The release workflow creates a draft GitHub Release with Chrome and Firefox archives attached. Review and publish the draft manually.
If the default npm cache is read-only, use a writable cache directory:
export npm_config_cache=/tmp/npm-cache
mkdir -p /tmp/npm-cache
npm installIf /tmp is not writable, use another writable directory such as ~/Projects/.npm-cache.
- The extension does not actively request the analytics endpoint and does not read or store tokens. A main-world content script observes the
fetch/XHRresponses already requested by the Analytics page, so the page's own cookies,Authorizationheader, and other request headers are used. - The popup only opens the Analytics page and does not request internal data or require additional cookie permissions.
- Localization follows the browser's extension UI locale, as required by the standard
browser.i18nAPI; changing it requires changing the browser language. - The endpoint is an undocumented internal OpenAI endpoint and may change without notice. If the page changes its response format, update
utils/api.ts. - If the official page does not request a particular aggregation period, the extension does not issue a replacement request.
- A direct
curlrequest normally returns 401 without the browser session cookies.
This project is an independent community extension and is not affiliated with, endorsed by, or sponsored by OpenAI or ChatGPT. It relies on undocumented internal endpoints and page behavior that may change or stop working at any time. Use it at your own risk; no guarantee is made regarding data accuracy, availability, or compatibility.
MIT