GPT Weekly Limit Estimation
[Edited by Codex: 019bebf3-c7d3-75c1-b096-339970e5cbc0 2026-01-23]
Estimate weekly limit as:
weekly_limit_usd = cost_so_far_usd / percent_used
This skill intentionally does not re-implement token counting. It depends on two base skills:
compute-token-cost(ground truth token+cost computation)pull-pricing(live pricing snapshots + append-only historical JSONL)
Quick Start
# 0) Pull live pricing snapshot (writes snapshot JSON + appends pulled_data.jsonl)
python ~/.claude/skills/pull-pricing/run_pull_pricing_and_log.py
# 1) Extract one billing-week window (OpenAI resets weekly at 14:47 local time)
python /Users/sotola/swe/token-computation/extract_codex_week.py \
--src ~/centralized-logs/codex/sse_lines.jsonl \
--dst /tmp/billing_week.jsonl \
--start "2026-01-15 14:47" \
--end "2026-01-22 14:47" \
--assume-sorted-by-t
# 2) Compute cost using a specific pricing snapshot (pick the newest snapshot file)
cd /Users/sotola/swe/token-computation && \
python compute_token_costs.py \
--codex /tmp/billing_week.jsonl \
--claude ~/centralized-logs/claude/sse_lines.jsonl \
--pricing-snapshot ~/centralized-logs/pull-pricing/snapshots/<pick-newest>.json
Critical Knowledge
Billing week boundary
OpenAI’s weekly reset is Thursday 14:47 local time (confirm on the dashboard if unsure).
- Treat the reset timestamp as the exclusive end of the window.
- Extract
[start, end)wherestart = end - 7 days.
Why CodexMonitor can be wrong
CodexMonitor-style “delta of total_token_usage” can overcount when totals reset or multiple runs mix.
Ground truth is:
- Codex/OpenAI: sum
turn.token_count.info.last_token_usageand dedupe repeated snapshots persid. - Pricing: use a saved snapshot (don’t hardcode discounts).
Weekly limit estimation
If OpenAI dashboard shows you’ve used X% of your weekly limit:
cost_so_far = 147.20 # from compute_token_costs.py output
percent_used = 0.28 # from dashboard
weekly_limit = cost_so_far / percent_used
print(weekly_limit) # 525.714...
File locations
- Ground truth scripts:
/Users/sotola/swe/token-computation/compute_token_costs.py/Users/sotola/swe/token-computation/extract_codex_week.py/Users/sotola/swe/token-computation/pull_pricing.py
- Live logs:
~/centralized-logs/codex/sse_lines.jsonl~/centralized-logs/claude/sse_lines.jsonl
- Pricing history:
~/centralized-logs/pull-pricing/pulled_data.jsonl~/centralized-logs/pull-pricing/snapshots/