Skip to content

Add GPT-6 Astra pricing - #414

Merged
btsouth merged 1 commit into
mainfrom
fix/gpt-6-astra-pricing
Sep 7, 2026
Merged

btsouth merged 1 commit into
mainfrom
fix/gpt-6-astra-pricing

Conversation

@btsouth

@btsouth btsouth commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Fixes #413

GPT-6 Astra tokens scan fine from Codex logs but were missing from the built-in pricing table, so the Charts page showed $0.00 with "0% of tokens priced". This adds the model at OpenAI's published standard rates: $10 input / $1 cached input / $50 output per 1M tokens.

Details:

  • Codex usage of Astra does not incur the >272K long-context multipliers and Codex does not charge cache writes, so the entry has no long_context rates (short-context rates apply at every context size).
  • Bare gpt-6 normalizes to gpt-6-astra, matching the existing gpt-5.6 to gpt-5.6-sol pattern. Date-suffixed and -codex variants already resolve through existing logic.
  • Added a regression test covering variant normalization and the published rates.

Commands run: cargo test --manifest-path rust/Cargo.toml (1186 passed), cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml (617 passed), cargo fmt --all. Clippy is clean for the touched files; the two existing -D warnings failures are pre-existing on clean main (Windows-gated code that is dead on Linux).

Note

Add gpt-6-astra pricing and alias gpt-6 to it in CODEX_PRICING

  • Adds a gpt-6-astra entry to CODEX_PRICING at $10/M input, $50/M output, and $1/M cached-input tokens, with no long-context rate override.
  • CostUsagePricing::normalize_codex_model now maps the exact name gpt-6 to the canonical key gpt-6-astra, so the alias and dated/Codex-suffixed Astra variants resolve to the new rates.
  • Adds tests covering canonical, dated, Codex-suffixed, and gpt-6 alias normalization, plus cached and long-context cost assertions.
  • Behavioral Change: gpt-6 and Astra variants now resolve to gpt-6-astra pricing in cost_pricing.rs; review normalize_codex_model and the gpt-6-astra table entry to confirm rates and alias handling.

Macroscope summarized 79c1041.

Summary by CodeRabbit

  • New Features

    • Added pricing support for the GPT-6 Astra model, including standard input, output, and cached-input rates.
    • Added recognition of the gpt-6 model alias and related model identifiers.
  • Bug Fixes

    • Ensured extended input lengths use the correct standard pricing when no long-context rates apply.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: d349a670-1c87-4836-979c-cbf29b8df2f4

📥 Commits

Reviewing files that changed from the base of the PR and between 45a2a4f and 79c1041.

📒 Files selected for processing (2)
  • rust/src/core/cost_pricing.rs
  • rust/src/core/cost_pricing_tests.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Adds GPT-6 Astra pricing and maps the gpt-6 alias to gpt-6-astra. Tests cover dated aliases, Codex aliases, standard rates, cached-input billing, and 300K-token input pricing.

Changes

GPT-6 Astra pricing

Layer / File(s) Summary
Pricing, normalization, and validation
rust/src/core/cost_pricing.rs, rust/src/core/cost_pricing_tests.rs
Adds standard GPT-6 Astra input, output, and cache-read rates. Maps gpt-6 to gpt-6-astra. Tests alias normalization and pricing without long-context multipliers.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 79c10

GPT-6 Astra usage will now resolve to published pricing rather than appearing as unpriced usage, with tested aliases and token-rate behavior. No current merge-blocking risk remains.

Suggested reviewers: finesssee

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding GPT-6 Astra pricing.
Linked Issues check ✅ Passed The changes address issue #413 by adding GPT-6 Astra pricing, model normalization, and regression coverage so Astra usage can be recognized and displayed correctly.
Out of Scope Changes check ✅ Passed All changes are related to GPT-6 Astra pricing, normalization, and tests. No unrelated code changes are identified.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/gpt-6-astra-pricing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ceiling 79c1041 Commit Preview URL

Branch Preview URL
Sep 07 2026, 02:42 PM

@btsouth
btsouth merged commit 14d8c08 into main Sep 7, 2026
11 checks passed
@btsouth
btsouth deleted the fix/gpt-6-astra-pricing branch September 7, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: GPT Astra (6) usage is not avaliable in app

1 participant