Pricing compatibility paused for kernel reset #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Pricing Source Compatibility | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "17 13 * * 1" | |
| jobs: | |
| parse-live-pricing: | |
| name: Parse live OpenAI pricing source | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install ".[dev]" | |
| - name: Parse live pricing Markdown | |
| run: | | |
| python - <<'PY' | |
| from urllib.request import Request, urlopen | |
| from codex_usage_tracker.pricing import ( | |
| OPENAI_PRICING_MD_URL, | |
| VALID_PRICING_TIERS, | |
| parse_openai_pricing_markdown, | |
| ) | |
| request = Request( | |
| OPENAI_PRICING_MD_URL, | |
| headers={"User-Agent": "codex-usage-tracker-pricing-compat"}, | |
| ) | |
| with urlopen(request, timeout=20) as response: | |
| markdown = response.read().decode("utf-8") | |
| for tier in VALID_PRICING_TIERS: | |
| models = parse_openai_pricing_markdown(markdown, tier=tier) | |
| print(f"{tier}: parsed {len(models)} models") | |
| PY |