Skip to content

Commit 1d7d817

Browse files
committed
fix(xai): address B2 pricing review
1 parent 6e89ffc commit 1d7d817

17 files changed

Lines changed: 228 additions & 50 deletions

File tree

‎devlog/_plan/260818_fastwire_b2_xai/evidence/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ that exercise every branch of the new pricing path:
77
| --- | --- | --- |
88
| `req-standard` | no Fast requested | `~$0.0300` |
99
| `req-priority` | response-confirmed priority, prompt under the long-context threshold | `~$0.0600` — exactly the documented 2x premium over the row above |
10-
| `req-longctx-priority` | response-confirmed priority, prompt above 200k | `≥$0.8760` — the published long-context rate, marked a lower bound because xAI publishes no combined price |
10+
| `req-longctx-priority` | response-confirmed priority, prompt at or above 200k | `≥$0.8760` — the published long-context rate, marked a lower bound because xAI publishes no combined price |
1111

1212
The `≥` prefix is the visible change: a cost that is a known floor rather than an
1313
estimate now says so instead of rendering as `~$`. The detail drawer explains why

‎docs-site/src/content/docs/reference/configuration/providers.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,15 @@ Explicit capability `false` and Responses caller-tier forwarding retain their ex
154154
### xAI Priority Processing
155155

156156
The built-in `xai` preset advertises and injects Fast only when its effective transport uses
157-
`authMode: "key"`. It sends `service_tier: "priority"` to xAI's public Chat Completions or
158-
Responses API. `ocx login xai` uses the separate Grok CLI subscription gateway, so OAuth remains
159-
unclassified: its catalog rows do not advertise Fast and the proxy does not inject a tier.
157+
`authMode: "key"`. API-key mode uses the key transport at `https://api.x.ai/v1` and sends
158+
`service_tier: "priority"` to xAI's public Chat Completions or Responses API. `ocx login xai`
159+
instead stores OAuth credentials for the separate Grok CLI subscription-gateway flow, so OAuth
160+
remains unclassified: its catalog rows do not advertise Fast and the proxy does not inject a tier.
160161

161162
xAI charges Priority Processing at 2× the standard token price for input, output, cached, and
162163
reasoning tokens; cache discounts are applied before the multiplier. Cost estimates use that premium
163-
only when xAI echoes `service_tier: "priority"` (or when an adapter explicitly records an assumed
164-
priority outcome). An echoed `default` is a downgrade and stays at the standard price.
164+
only when xAI's response confirms `service_tier: "priority"`. A missing or unparsed response tier is
165+
not confirmation, and an echoed `default` is a downgrade; all three stay at the standard price.
165166

166167
For `grok-4.6`, the standard rate per 1M tokens is $2.00 input, $0.50 cached input, and $6.00
167168
output. A prompt of at least 200,000 tokens reprices the whole request at $4.00 / $1.00 / $12.00.

‎gui/src/i18n/de.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,9 @@ export const de: Record<TKey, string> = {
657657
"logs.col.tokens": "Tokens",
658658
"logs.col.tokPerSec": "tok/s",
659659
"logs.col.estimatedCost": "~$",
660+
"logs.cost.approximate": "~{amount}",
661+
"logs.cost.lowerBound": "≥{amount}",
662+
"logs.cost.unavailable": "—",
660663
"logs.metric.tokPerSecTitle": "Ausgabe-Tokens pro Sekunde über die gesamte Anfragedauer",
661664
"logs.metric.estimatedCostTitle": "API-Listenpreis-Äquivalent, keine tatsächliche Belastung; bei fehlendem Preisabgleich nicht verfügbar",
662665
"usage.cost.total": "API-Listenpreis-Äquivalent (dieser Zeitraum)",

‎gui/src/i18n/en.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,9 @@ export const en = {
690690
"logs.col.tokens": "Tokens",
691691
"logs.col.tokPerSec": "tok/s",
692692
"logs.col.estimatedCost": "~$",
693+
"logs.cost.approximate": "~{amount}",
694+
"logs.cost.lowerBound": "≥{amount}",
695+
"logs.cost.unavailable": "—",
693696
"logs.metric.tokPerSecTitle": "Output tokens per second over the full request duration",
694697
"logs.metric.estimatedCostTitle": "API list-price equivalent, not an actual charge; unmatched pricing is unavailable",
695698
"usage.cost.total": "API list-price equivalent (this range)",

‎gui/src/i18n/fr.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,9 @@ export const fr: Record<TKey, string> = {
671671
"logs.col.tokens": "Jetons",
672672
"logs.col.tokPerSec": "jetons/s",
673673
"logs.col.estimatedCost": "~$",
674+
"logs.cost.approximate": "~{amount}",
675+
"logs.cost.lowerBound": "≥{amount}",
676+
"logs.cost.unavailable": "—",
674677
"logs.metric.tokPerSecTitle": "Jetons de sortie par seconde sur toute la durée de la requête",
675678
"logs.metric.estimatedCostTitle": "Équivalent au tarif catalogue de l’API, et non montant réellement facturé ; aucun tarif n’est disponible en l’absence de correspondance",
676679
"usage.cost.total": "Équivalent au tarif catalogue de l’API (cette période)",

‎gui/src/i18n/ja.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,9 @@ export const ja: Record<TKey, string> = {
633633
"logs.col.tokens": "トークン",
634634
"logs.col.tokPerSec": "tok/s",
635635
"logs.col.estimatedCost": "~$",
636+
"logs.cost.approximate": "~{amount}",
637+
"logs.cost.lowerBound": "≥{amount}",
638+
"logs.cost.unavailable": "—",
636639
"logs.metric.tokPerSecTitle": "リクエスト全体の所要時間あたりの出力トークン数",
637640
"logs.metric.estimatedCostTitle": "API 定価相当額(実際の請求ではありません); 未対応の価格は利用できません",
638641
"usage.cost.total": "API 定価相当額(この期間)",

‎gui/src/i18n/ko.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,9 @@ export const ko: Record<TKey, string> = {
676676
"logs.col.tokens": "토큰",
677677
"logs.col.tokPerSec": "tok/s",
678678
"logs.col.estimatedCost": "~$",
679+
"logs.cost.approximate": "~{amount}",
680+
"logs.cost.lowerBound": "≥{amount}",
681+
"logs.cost.unavailable": "—",
679682
"logs.metric.tokPerSecTitle": "전체 요청 시간 기준 초당 출력 토큰",
680683
"logs.metric.estimatedCostTitle": "API 정가 환산치이며 실제 청구액이 아닙니다. 가격 미매칭은 표시하지 않습니다.",
681684
"usage.cost.total": "API 정가 환산치 (이 기간)",

‎gui/src/i18n/ru.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,9 @@ export const ru: Record<TKey, string> = {
674674
"logs.col.tokens": "Токены",
675675
"logs.col.tokPerSec": "tok/s",
676676
"logs.col.estimatedCost": "~$",
677+
"logs.cost.approximate": "~{amount}",
678+
"logs.cost.lowerBound": "≥{amount}",
679+
"logs.cost.unavailable": "—",
677680
"logs.metric.tokPerSecTitle": "Выходные токены в секунду за полную длительность запроса",
678681
"logs.metric.estimatedCostTitle": "Эквивалент стоимости по прайс-листу API, а не фактическое списание; если цену не удалось сопоставить, значение недоступно",
679682
"usage.cost.total": "Эквивалент стоимости по прайс-листу API (за этот период)",

‎gui/src/i18n/tr.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,9 @@ export const tr: Record<TKey, string> = {
681681
"logs.col.tokens": "Jetonlar",
682682
"logs.col.tokPerSec": "jeton/sn",
683683
"logs.col.estimatedCost": "~$",
684+
"logs.cost.approximate": "~{amount}",
685+
"logs.cost.lowerBound": "≥{amount}",
686+
"logs.cost.unavailable": "—",
684687
"logs.metric.tokPerSecTitle": "Çıktı jetonu / saniye",
685688
"logs.metric.estimatedCostTitle": "Tahmini API liste fiyatı",
686689
"usage.cost.total": "API liste fiyatı eşdeğeri",

‎gui/src/i18n/zh-TW.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,9 @@ export const zhTW: Record<TKey, string> = {
527527
"logs.col.tokens": "Token 數",
528528
"logs.col.tokPerSec": "tok/s",
529529
"logs.col.estimatedCost": "~$",
530+
"logs.cost.approximate": "~{amount}",
531+
"logs.cost.lowerBound": "≥{amount}",
532+
"logs.cost.unavailable": "—",
530533
"logs.metric.tokPerSecTitle": "按完整請求耗時計算的每秒輸出 token",
531534
"logs.metric.estimatedCostTitle": "按 API 標價估算,並非實際扣費;價格無法符合時不顯示",
532535
"usage.cost.total": "API 標價折算(當前範圍)",

0 commit comments

Comments
 (0)