Skip to content

fix(models): Complete Terra and Luna tiered pricing - #240

Merged
mike1858 merged 2 commits into
mainfrom
fix/complete-terra-luna-tiered-pricing
Aug 20, 2026
Merged

fix(models): Complete Terra and Luna tiered pricing#240
mike1858 merged 2 commits into
mainfrom
fix/complete-terra-luna-tiered-pricing

Conversation

@mike1858

@mike1858 mike1858 commented Aug 20, 2026

Copy link
Copy Markdown
Member

Why

GPT-5.6 Terra and Luna support long-context pricing above 272K prompt tokens, but Splitrail currently treats both models as flat-priced. Their recorded Priority/Fast and Flex/Batch rates are also stale relative to OpenAI’s current pricing table.

This underreports long-context requests and can misprice short-context service-tier usage. Updating only the current tables would also retroactively reprice usage from before OpenAI’s July 30 price cut, so historical Standard, Priority, Flex, and Batch rates need to remain date-aware.

GPT-5.4 was reviewed at the same time: its Standard and Flex/Batch brackets already match OpenAI, while no long-context Priority/Fast rates are published, so this change does not invent them.

What changed

  • Model Terra and Luna Standard pricing with verified 272K short- and long-context brackets.
  • Add matching tiered cache-write and cache-read rates for both models.
  • Replace flat Priority/Fast and Flex/Batch entries with the complete published short/long matrices.
  • Correct the current Terra and Luna short-context service-tier rates.
  • Extend DatedPricing with optional service-tier overrides while preserving external-config compatibility through #[serde(default)].
  • Preserve pre–July 30 Standard, Priority, Flex, and Batch prices, including their historical long-context multipliers.
  • Remove the now-unused flat service-tier cache-write helper.
  • Add mixed cached/uncached coverage proving a 300K prompt selects one long-context bracket for the full request.
  • Cover historical full-request costs across all four service tiers and update current Standard, Priority, Flex, and Batch assertions.

Validation

  • cargo build --quiet
  • cargo test --quiet — 432 passed
  • cargo clippy --quiet -- -D warnings
  • cargo doc --quiet
  • cargo fmt --all --quiet
  • git diff --check

Summary by CodeRabbit

  • Pricing Updates
    • Updated pricing for gpt-5.6-terra and gpt-5.6-luna to use 272K-token usage tiers.
    • Added separate tiered rates for cache reads and writes.
    • Updated Standard, Priority, Flex, and Batch service-tier pricing.
    • Improved pricing accuracy for long-context requests.
    • Added support for historically accurate rates based on the request’s effective date.
    • Ensured matching dated service-tier pricing is applied when available.

Apply OpenAI's 272K short- and long-context brackets to Terra and
Luna across standard, priority, flex, and batch processing.

Correct the current service-tier rates, preserve pre-July 30
standard pricing, and cover mixed cached and uncached long prompts.
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: aa912d02-27ca-4ba2-86ad-e53e2809f437

📥 Commits

Reviewing files that changed from the base of the PR and between b090324 and 7ca3c01.

📒 Files selected for processing (1)
  • src/models.rs

📝 Walkthrough

Walkthrough

Terra and Luna pricing now uses 272K-token tiers for standard, Priority, Flex, and Batch service tiers. DatedPricing stores historical service-tier overrides. Lookup logic selects dated overrides before current service-tier rates. Tests cover long-context pricing, cutoff dates, and cache costs.

Changes

Tiered model pricing

Layer / File(s) Summary
Dated service-tier contract
src/models.rs
DatedPricing now stores and validates dated service-tier pricing. A macro populates overrides by model, cutoff date, and service tier.
Tiered pricing registrations
src/models.rs
Terra and Luna standard, Priority, Flex, and Batch pricing now uses 272K-token tiers with separate input, output, cache-write, and cache-read rates.
Dated lookup and validation
src/models.rs
Service-tier lookup checks matching dated overrides before current service-tier pricing and standard pricing. Tests cover historical rates, long-context requests, token costs, and cache costs.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: jimyag, kozora

Poem

Poem

A rabbit maps each pricing tier,
Historical rates now appear.
Cache writes hop, reads follow through,
Long-context checks confirm each queue.
Terra and Luna rates align.

🚥 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 identifies the main change: completing tiered pricing for Terra and Luna.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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/complete-terra-luna-tiered-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.

Extend dated pricing windows with service-tier overrides so Terra and Luna retain their pre-July 30 Priority, Flex, and Batch rates. Model historical long-context multipliers explicitly and cover full-request costs across every tier.
@mike1858
mike1858 enabled auto-merge (squash) August 20, 2026 17:38
@mike1858
mike1858 merged commit d304dda into main Aug 20, 2026
6 of 7 checks passed
@mike1858
mike1858 deleted the fix/complete-terra-luna-tiered-pricing branch August 20, 2026 17:39
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.

1 participant