Repository navigation
feat(ai-review): estimate costs across the model pricing catalog - #17
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI review cost estimates were populated only for Terra, leaving the new Astra default without a cost. Add a 47-model dictionary from the official OpenAI standard text pricing tables, verified on 2026-10-16, covering the current review models and published legacy/specialized text models.
The estimator prices each request using cumulative usage deltas, ignores repeated token-count events, separates uncached input/cache reads/cache writes/output, and applies the published long-context premium above 272,000 input tokens per request. Reasoning output is already included in output tokens. Unknown exact model identifiers, unpriced usage categories, or inconsistent counters produce an unavailable reason rather than an invented cost.
The workflow summary and analysis artifact include the pricing source, verification date, standard-rate basis, cache-write usage, and any unavailable reason. Estimates exclude tools, regional/service-tier uplifts, and the optional native benchmark. Pricing entries do not imply Codex model compatibility.
Source: https://developers.openai.com/api/docs/pricing
Validation: all 42 tests pass, including model-specific rates, cache writes, context boundaries, duplicate events, and unavailable cases; actionlint and git diff --check pass. A token-only replay of 256 real Codex usage events also completed with an estimate. Fresh local medium-tier review checked all 47 rates and found no issues.