Skip to content

feat(models): show cache write pricing on detail page - #3022

Merged
steebchen merged 3 commits into
mainfrom
claude/model-pricing-details-pr8i4w
Jul 12, 2026
Merged

steebchen merged 3 commits into
mainfrom
claude/model-pricing-details-pr8i4w

Conversation

@steebchen

@steebchen steebchen commented Jul 12, 2026 •

Copy link
Copy Markdown
Member

Summary

The per-provider model detail page (/models/[name]/[provider]) previously only rendered Input, Cached (cache read), and Output token prices, plus request/search/OCR/image/tiered pricing. Several pricing fields that exist on provider mappings were never surfaced anywhere on the page — most notably the cache write rates that Anthropic-style explicit caching bills.

This PR lists the remaining pricing details on the detail page:

  • Cache Write 5m — cacheWriteInputPrice (5-minute TTL)
  • Cache Write 1h — cacheWriteInputPrice1h (1-hour TTL, falling back to the 5-minute rate when unset, matching the model-definition semantics)
  • Audio Output — outputAudioPrice (per output audio token, for TTS/speech models)

The existing "Cached" cell is relabeled Cache Read on the detail page to disambiguate it from the new cache-write cells.

Screenshots

Model detail page pricing card for claude-opus-4-8 on Anthropic (a global seed discount is active in the screenshot environment, which is why the strikethrough/discounted prices show — the new cells honor discounts and service-tier multipliers like the existing ones).

Light

Model detail pricing card — light

Dark

Model detail pricing card — dark

(Screenshot PNGs are hosted from an isolated commit and intentionally kept out of the mergeable diff, which contains only the two code files below.)

Scope

  • A new detailed prop on ProviderSection gates the additional pricing rows so they appear only on the model detail page (via DetailProviderCards). The compact model list cards stay unchanged/minimal.
  • Every new cell reuses the existing PriceCell / formatPrice path, so service-tier multipliers and discounts apply consistently, and cells only render when the corresponding price is present.

All data was already exposed by the internal models API (cacheWriteInputPrice, cacheWriteInputPrice1h, outputAudioPrice); this is a display-only change.

Testing

  • pnpm format
  • turbo run build --filter=ui
  • Rendered the detail page locally against a seeded DB and captured the screenshots above.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 12, 2026 16:36
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

ProviderSection now supports detailed pricing displays for cache reads, cache writes, and audio output. DetailProviderCards enables this mode for rendered provider sections, while the default simplified display remains unchanged.

Changes

Provider pricing details

Layer / File(s) Summary
Detailed mode wiring
apps/ui/src/components/models/detail-provider-cards.tsx, apps/ui/src/components/models/model-card.tsx
ProviderSection accepts an optional detailed flag, and DetailProviderCards passes it when rendering provider sections.
Detailed price rendering
apps/ui/src/components/models/model-card.tsx
Detailed mode labels cached pricing as “Cache Read” and renders Cache Write 5m, Cache Write 1h with fallback, and Audio Output pricing when available.

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

Possibly related PRs

Suggested reviewers: smakosh

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding cache write pricing to the model detail page.
✨ 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 claude/model-pricing-details-pr8i4w

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.

@steebchen
steebchen merged commit 582e629 into main Jul 12, 2026
12 checks passed
@steebchen
steebchen deleted the claude/model-pricing-details-pr8i4w branch July 12, 2026 22:46
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.

3 participants