Skip to content

Grok 4.6 launch pricing, Cursor slug handling, DeepSeek v4 builtins - #129

Closed
ItsJazii wants to merge 2 commits into
mainfrom
grok-4-6-pricing
Closed

Grok 4.6 launch pricing, Cursor slug handling, DeepSeek v4 builtins#129
ItsJazii wants to merge 2 commits into
mainfrom
grok-4-6-pricing

Conversation

@ItsJazii

@ItsJazii ItsJazii commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

Grok 4.6 shipped 2026-08-12 and no public catalog carries it yet, so its spend showed the unpriced ⚠. This bakes in the vendor rates until catalogs catch up (same self-retiring pattern as kimi-k3 / qwen3.8-max — a real catalog entry outranks these the moment one ships). Verified working on a live install against real launch-day Cursor usage.

Grok 4.6 (docs.x.ai/docs/pricing):

  • $2 input / $0.50 cached / $6 output per MTok; ≥200k-token prompts bill $4 / $1 / $12 for the whole request (xAI's long-context rule matches request_cost's tiering at the default 200k threshold)
  • Cache writes bill as plain input (xAI publishes no write rate)
  • The 2× fast variant resolves through the existing -fast multiplier path — no separate entry
  • builtin_price now also strips Cursor's cursor- branding: Cursor's CSV logs the model as cursor-grok-4.6-xhigh, which stayed unpriced (20.6M real tokens at $0.00) until stripped
  • grok_price backstop in spend.rs: 4.6's "fast" is a 2× premium tier, never the old cheap grok-4-fast branch (kept consistent even though the backstop is normally unreachable for 4.6)

DeepSeek v4 (aihubmix.com): deepseek-v4-pro builtin at $0.464 / $0.928 / $0.004 cached, with dated-snapshot stripping (deepseek-v4-pro-0813 → base) so new dates don't silently go unpriced. CORRECTIONS_REV bumped to 4 so cached spend reprices.

Testing

  • 58/58 unit tests pass, including new coverage for every Grok 4.6 spelling (grok-4.6, grok-4-6, xai/-prefixed, effort suffixes, cursor-grok-4.6-xhigh, fast/long-context scaling) and DeepSeek dated snapshots
  • Confirmed on a local install: the launch-day Cursor session that showed $0.00 · 20.6M tokens · estimated prices correctly after the fix

🤖 Generated with Claude Code


Open in Devin Review

ItsJazii and others added 2 commits August 12, 2026 21:43
Released today (2026-08-12); no public catalog carries it yet, so
Grok 4.6 spend showed the unpriced warning. Rates from
docs.x.ai/docs/pricing: $2 in / $0.50 cached / $6 out per MTok,
doubling for >=200k-prompt requests (whole-request tiering, matching
request_cost at the default 200k threshold); cache writes bill as
plain input. The 2x fast variant resolves through the existing -fast
multiplier path. Catalog entries outrank this the moment one ships.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…iltins

- builtin_price strips Cursor's "cursor-" branding so launch-day slugs
  like cursor-grok-4.6-xhigh price before the supplement learns them
  (verified against real CSV rows: 20.6M tokens showed $0.00).
- grok_price backstop: 4.6''s "fast" is a 2x premium tier, never the
  old cheap grok-4-fast branch.
- DeepSeek v4 pro/flash builtin prices + dated-snapshot stripping
  (from the parallel working-tree edits; CORRECTIONS_REV 4).

Local-only branch — PR when jazii says so.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 3 potential issues.

Open in Devin Review

Comment thread src-tauri/src/pricing.rs
Comment on lines +692 to +693
"deepseek-v4-pro" => Some(Price::flat(0.464, 0.928, 0.004, 0.464)),
"deepseek-v4-flash" => Some(Price::flat(0.142, 0.284, 0.0284, 0.142)),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Cached input on one DeepSeek model is billed at roughly a tenth of the plausible rate

The cached-input rate for DeepSeek's pro model is set to $0.004 per million (Price::flat(0.464, 0.928, 0.004, 0.464) at src-tauri/src/pricing.rs:692), about 1/116 of its regular input rate, while its sibling flash model uses 1/5, which points to a dropped digit, so cached usage is charged far too little.
Impact: Spend totals for that model under-report the money actually spent whenever prompt caching is used.

Rate-card ratio inconsistency inside the same baked-in family

Both new entries mirror each other everywhere else (output = 2× input, cache write = input). The flash entry's cache read 0.0284 is exactly 20% of its input 0.142; the pro entry's cache read 0.004 is 0.86% of 0.464. A vendor cache-hit price of 1/10 input would be 0.04640.004 looks like a truncated 0.0464. The value is asserted in the new test at src-tauri/src/pricing.rs:772, so the test would need updating alongside. Please re-check the aihubmix.com rate card before merge.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread CHANGELOG.md
Comment on lines +5 to +16
### Fixed
- **DeepSeek V4 pro/flash now price** — DeepSeek's V4 pro and flash
models (including dated snapshots like `deepseek-v4-pro-0813` and
`deepseek-v4-flash-0731`) weren't in any public catalog, so usage
through Hermes/AihubMix counted tokens but showed $0 and folded out of
the spend ring. Their AihubMix rates are baked in until the catalogs
learn them (self-retiring), and cached history repricies.
- **Grok 4.6 prices from day one** — xAI's launch-day rates
($2 in / $0.50 cached / $6 out per MTok, doubling for ≥200k-token
prompts; the fast variant at 2x) are baked in until the public
catalogs learn the model, so spend from Grok 4.6 sessions shows
dollars instead of the unpriced ⚠.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Pull request bundles three unrelated changes despite the one-change rule

This change ships launch pricing for one vendor's new model, a separate vendor-prefix stripping rule, and a third vendor's model family in a single pull request (see the changelog entries added at CHANGELOG.md:5-16), which the project's contribution rules forbid.
Impact: Reviewers cannot accept or revert one part without the others.

CONTRIBUTING.md rule

CONTRIBUTING.md states under Pull requests: "Keep PRs focused: one change per PR." The PR title itself names three separate items (Grok 4.6 launch pricing, Cursor slug handling, DeepSeek v4 builtins), and the code changes touch independent builtin entries in src-tauri/src/pricing.rs:667-716 plus a backstop table in src-tauri/src/spend.rs:414-432.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread src-tauri/src/pricing.rs
Comment on lines +679 to +686
// DeepSeek ships dated snapshots ("deepseek-v4-pro-0813"); price them as
// the base model so a new date doesn't silently go unpriced.
let bare = match bare.strip_suffix(|c: char| c.is_ascii_digit()) {
Some(_) if bare.starts_with("deepseek-") => bare.rsplit_once('-').map_or(bare, |(h, t)| {
if t.chars().all(|c| c.is_ascii_digit()) && t.len() >= 4 { h } else { bare }
}),
_ => bare,
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Dated-snapshot stripping is scoped tightly, but only to deepseek-

The snapshot trimmer at src-tauri/src/pricing.rs:681-686 only fires when the slug ends in a digit, starts with deepseek-, and the trailing dash-segment is ≥4 digits, so deepseek-v4 (t=v4) and deepseek-coder-6.7b are untouched and non-DeepSeek families are unaffected. Note the guard is on the post-prefix-strip bare, so deepseek/deepseek-v4-pro-0813 works but a gateway spelling like aihubmix/deepseek-v4-pro-0813 would not be prefix-stripped at all and stays unpriced — worth confirming which exact strings Hermes/AihubMix logs emit.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@ItsJazii

Copy link
Copy Markdown
Owner Author

Superseded — splitting into one-change PRs per CONTRIBUTING.md (Devin's bundling finding). Grok 4.6 and DeepSeek v4 land separately; the DeepSeek pro cache rate Devin questioned is confirmed correct against aihubmix.com/model/deepseek-v4-pro-0813 (page lists Cache Read $0.004/M — the flash family simply has a different ratio).

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