An open API service indexing awesome lists of open source software.

https://github.com/xbotter/codex-cost

A cross-platform menu bar app that estimates daily Codex usage cost from local session logs.
https://github.com/xbotter/codex-cost

codex cost-tracking macos menubar-app openai rust tauri tray-app typescript usage-analytics

Last synced: 25 days ago
JSON representation

A cross-platform menu bar app that estimates daily Codex usage cost from local session logs.

Awesome Lists containing this project

README

          


codex-cost logo

codex-cost

A lightweight desktop tray app for Codex users who want today's cost visible at a glance.



GitHub Release


License

Tauri v2
Rust
TypeScript
macOS
Windows
Linux

`codex-cost` is a lightweight desktop tray app for Codex users who want to keep today's cost visible at a glance.

It reads local Codex usage logs, estimates the current day's USD cost, and keeps that number close at hand through a tray icon, tooltip, and compact dashboard.

![codex-cost dashboard](docs/dashboard-screenshot.png)

## Highlights

- Always-on tray app for Windows, macOS, and Linux
- Reads local Codex logs directly
- Tracks daily usage in local timezone
- Includes subagent usage
- Uses online LiteLLM pricing with local cache fallback
- Provides a quiet dashboard for cost and token breakdown

## What It Feels Like

`codex-cost` is designed to stay out of the way.

- Live in the tray instead of a terminal tab
- Check today's value in one glance
- Open a compact dashboard only when you need detail
- Close the window without quitting the app

## Installation

Download from GitHub Releases:

- Latest release page: [github.com/xbotter/codex-cost/releases/latest](https://github.com/xbotter/codex-cost/releases/latest)

Platform notes:

- macOS Apple Silicon: download the `aarch64` `.dmg`
- macOS Intel: download the `x64` `.dmg`
- Windows: download the NSIS installer
- Linux: choose `AppImage` for a portable build or `deb` for Debian/Ubuntu-based systems

Windows builds are distributed as an NSIS installer. The installer also places `WebView2Loader.dll` next to the app binary to avoid missing-loader startup failures.

## How It Works

`codex-cost` reads local Codex session JSONL logs and calculates usage from session deltas instead of summing raw cumulative counters.

The current implementation:

- groups usage by local day
- treats billable input as `input_tokens - cached_input_tokens`
- includes `reasoning_output_tokens` in output cost
- preserves cross-day session baselines to avoid overcounting

## Acknowledgements

This project is inspired by [`ccusage`](https://github.com/ryoppippi/ccusage).

Its Codex pricing and accounting behavior were an important reference while validating the usage model in `codex-cost`. This project takes that accounting direction and turns it into a desktop tray experience focused on always-on visibility.

## Development

Requirements:

- Node.js 20+
- Rust stable
- Tauri v2 prerequisites for your platform

Install dependencies:

```bash
npm install
```

Run local checks:

```bash
npm run check
```

Run in development:

```bash
npm run tauri dev
```

Build release artifacts locally:

```bash
npm run build
npx tauri build
```

## License

MIT. See [LICENSE](LICENSE).