otak-usage
See what your AI pair programmers would cost - Claude Code and OpenAI Codex CLI usage as API-equivalent dollars, right in the VS Code status bar.
Usage
Install the extension - a cost readout appears on the right side of the status bar:
✦ $12.34 ⬡ $5.67 (✦ Claude Code / ⬡ Codex CLI)
Hover for a per-model breakdown of today and the current month
Click to toggle the displayed period between Today and This Month
Disclaimer: The amounts shown are API-equivalent estimates computed from your local session logs and public per-token API prices. If you use a subscription plan (Claude Pro/Max, ChatGPT Plus/Pro), this is not what you actually pay - it is what the same usage would have cost via the API.
Features
otak-usage is a lightweight VS Code extension that reads the local session logs of AI coding CLIs and turns token counts into dollars. No accounts, no API keys, no network calls.
Key Features
Commands
| Command |
Description |
Otak Usage: Toggle Period (Today / This Month) |
Switch the status bar between today's and this month's cost (also bound to clicking the status bar item) |
Otak Usage: Refresh Usage (Clear Cache and Rescan) |
Drop the incremental scan cache and rebuild from the logs |
Otak Usage: Copy Usage Summary |
Copy a plain-text per-model breakdown to the clipboard (also available as the "Copy Summary" link in the tooltip) |
Configuration
| Setting |
Default |
Description |
otakUsage.period |
today |
Aggregation period shown in the status bar (today / month) |
otakUsage.updateIntervalSeconds |
60 |
How often to rescan the logs (minimum 10) |
otakUsage.showClaude |
true |
Show the Claude Code segment |
otakUsage.showCodex |
true |
Show the Codex CLI segment |
otakUsage.pricingOverrides |
{} |
Per-model price overrides in USD per million tokens, e.g. {"gpt-6": {"input": 5, "cachedInput": 0.5, "output": 30}} |
otakUsage.claudeConfigDir |
"" |
Claude Code config dir (empty = $CLAUDE_CONFIG_DIR or ~/.claude) |
otakUsage.codexHome |
"" |
Codex home dir (empty = $CODEX_HOME or ~/.codex) |
How costs are computed
- Claude Code: each assistant message records
input_tokens, output_tokens, cache_read_input_tokens, and a 5m/1h cache-write breakdown. Cost = input × base + cache reads × 0.1 × base + 5m writes × 1.25 × base + 1h writes × 2 × base + output × output price. Fast-mode responses (usage.speed: "fast") are tracked as <model>-fast and billed at the fast-mode premium, with the cache multipliers stacking on the fast price.
- Codex CLI: each turn records
last_token_usage. Cost = (input − cached) × base + cached × cached-input price + output × output price. Reasoning tokens are already included in output tokens.
- Prices were verified against the official Anthropic and OpenAI pricing pages. Dated model ids (
claude-opus-4-8-20250915) and variants (gpt-5.3-codex-spark) resolve to their base model by longest-prefix match.
Privacy
Everything stays on your machine. The extension reads token-count metadata from local log files; it never reads your prompts' content, never writes to the log directories, and never touches the network or credential files.
Requirements
Check out the other otak-series extensions:
License
MIT License - see the LICENSE file for details.
For more information, visit the GitHub repository.