| name | gpt-weekly-limit-estimation |
| description | Estimate OpenAI weekly usage limits from ground-truth token cost + reproducible pricing snapshots (billing week resets 14:47 local). |
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
python ~/.claude/skills/pull-pricing/run_pull_pricing_and_log.py
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
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) where start = 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_usage and dedupe repeated snapshots per sid.
- 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
percent_used = 0.28
weekly_limit = cost_so_far / percent_used
print(weekly_limit)
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/