improvement(mistral): update OCR pricing to OCR 4 rate ($4/1,000 pages)#5193
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview The per-page rate is now Reviewed by Cursor Bugbot for commit f81e252. Configure here. |
Greptile SummaryUpdates the Mistral OCR cost-tracking constant from the stale OCR 3 rate ($0.002/page) to the current OCR 4 rate ($0.004/page), reflecting Mistral's June 23, 2026 repoint of
Confidence Score: 5/5Safe to merge — the change is a single-constant update to a pricing multiplier, with no behavioral or logic changes. The diff touches only the cost multiplier in the getCost function. The updated value ($0.004/page) correctly reflects the OCR 4 rate ($4/1,000 pages), the alias resolution is documented with sources in TSDoc, and the constant name follows the project's SCREAMING_SNAKE_CASE convention. No other code paths are affected. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[OCR API Response] --> B{usage_info or metadata.usageInfo present?}
B -- No --> C[Throw Error]
B -- Yes --> D[Extract pagesProcessed]
D --> E["cost = pagesProcessed × MISTRAL_OCR_COST_PER_PAGE\n($0.004 / page — OCR 4 rate)"]
E --> F[Return cost + metadata]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[OCR API Response] --> B{usage_info or metadata.usageInfo present?}
B -- No --> C[Throw Error]
B -- Yes --> D[Extract pagesProcessed]
D --> E["cost = pagesProcessed × MISTRAL_OCR_COST_PER_PAGE\n($0.004 / page — OCR 4 rate)"]
E --> F[Return cost + metadata]
Reviews (2): Last reviewed commit: "docs(mistral): document mistral-ocr-late..." | Re-trigger Greptile |
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit f81e252. Configure here.
Summary
mistral-ocr-latestalias (what we call) now resolves to OCR 4 (mistral-ocr-4-0), so the model is already current — no model-string change needed./v1/ocrstandard rate is $4/1,000 pages, so updated the cost to $0.004/page.MISTRAL_OCR_COST_PER_PAGEconstant with TSDoc citing the source.Type of Change
Testing
Tested manually — verified OCR 4 pricing against https://mistral.ai/news/ocr-4/ and https://mistral.ai/pricing.
Checklist