Skip to content

feat(xai): add grok-4.3 and grok-4.3-latest to model_prices_and_context_window.json - #27153

Closed
ishaan-berri wants to merge 1 commit into
mainfrom
shin-watcher/add-xai-grok-4-3
Closed

feat(xai): add grok-4.3 and grok-4.3-latest to model_prices_and_context_window.json#27153
ishaan-berri wants to merge 1 commit into
mainfrom
shin-watcher/add-xai-grok-4-3

Conversation

@ishaan-berri

Copy link
Copy Markdown
Contributor

What

Adds the missing grok-4.3 flagship (and its -latest alias) to model_prices_and_context_window.json.

Why

xAI's docs/models page now leads with Grok 4.3 and explicitly says:

"We strongly recommend all API callers use grok-4.3. It is the most intelligent and fastest model we've built."

But it isn't currently listed in model_prices_and_context_window.json, so cost tracking, context-window limits, and capability flags don't work for users hitting it through litellm. The other 30+ Grok models are all there.

Pricing & specs (sourced from xAI's published model metadata)

Field Value
input_cost_per_token $1.25 / 1M (≤200k tokens)
input_cost_per_token_above_200k_tokens $2.50 / 1M
output_cost_per_token $2.50 / 1M (≤200k tokens)
output_cost_per_token_above_200k_tokens $5.00 / 1M
cache_read_input_token_cost $0.20 / 1M (≤200k)
cache_read_input_token_cost_above_200k_tokens $0.40 / 1M
max_tokens / max_input_tokens / max_output_tokens 1,000,000
Capabilities vision, reasoning, function calling, structured outputs, prompt caching, web search

Verified against known anchors before encoding: xAI publishes raw token prices as fixed-point integers where 30000 corresponds to grok-4's known $3/M and 3000 corresponds to grok-3-mini's $0.30/M — so the unit is value / 10000 per 1M tokens. grok-4.3's published values are 12500 / 25000 / 25000 / 50000 for prompt-short / completion-short / prompt-long / completion-long respectively, which decode to the table above.

The 200k-token long-context threshold matches xAI's longContextThreshold: 200000 for grok-4.3 and uses the existing *_above_200k_tokens keys already present in this file.

Diff

42-line surgical insertion — only adds two new top-level entries, doesn't touch any existing model. JSON validity verified locally.

Out of scope

While auditing, I also noticed a couple of items not included in this PR (happy to follow up):

  • Missing aliases: xai/grok-4-fast, xai/grok-4-fast-non-reasoning-latest, xai/grok-4-fast-reasoning-latest, xai/grok-3-fast.
  • xai/grok-4.20-* entries currently priced at $2 / $6 per 1M, but xAI's published metadata is $1.25 / $2.50 short-ctx and $2.50 / $5.00 long-ctx — could be a stale snapshot worth refreshing in a separate PR.

🤖 Opened by shin-watcher in response to "check if we are missing any xAI models, if we are add them as a PR". Source: https://docs.x.ai/docs/models.

…xt_window.json

xAI's docs page now lists grok-4.3 as the recommended chat / coding model:
"We strongly recommend all API callers use grok-4.3. It is the most
intelligent and fastest model we've built." (https://docs.x.ai/docs/models)

Pricing/specs sourced from xAI's published model metadata:
  - input:  $1.25 / 1M tokens (<=200k),  $2.50 / 1M tokens (>200k)
  - output: $2.50 / 1M tokens (<=200k),  $5.00 / 1M tokens (>200k)
  - cached: $0.20 / 1M tokens (<=200k),  $0.40 / 1M tokens (>200k)
  - context: 1,000,000 tokens
  - capabilities: vision, reasoning, function calling, structured outputs,
    prompt caching, web search

Adds two entries: `xai/grok-4.3` (canonical) and `xai/grok-4.3-latest` (alias),
mirroring the pattern used for the rest of the xAI/Grok-4 family.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


shin-watcher seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codspeed-hq

codspeed-hq Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing shin-watcher/add-xai-grok-4-3 (1c31e2c) with main (934ecdc)

Open in CodSpeed

@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes a surgical, 42-line addition of xai/grok-4.3 and xai/grok-4.3-latest to the model prices/context-window registry. The JSON is structurally valid, pricing values are mathematically consistent with the PR description (e.g. 1.25e-06 = $1.25/M tokens), capability flags match the pattern of comparable recent xAI models (grok-4-1-fast), and the -latest alias is a full-copy entry consistent with how xai/grok-4-latest and other aliases are handled throughout the file.

Confidence Score: 4/5

Safe to merge — purely additive JSON data entry with no logic changes and no risk to existing models.

No P0 or P1 issues found. Pricing arithmetic checks out ($1.25e-6, $2.5e-6, etc.), the JSON structure mirrors existing xAI entries, and the -latest alias pattern (full-copy entry) is consistent with how other aliases like xai/grok-4-latest are handled. The only uncertainty is whether the source URL (https://docs.x.ai/docs/models/grok-4.3) is live and whether all capability flags (e.g. audio input) are correctly captured — both are P2-level and unverifiable without docs access.

No files require special attention beyond confirming the xAI model page is live and pricing is current.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds two new top-level entries — xai/grok-4.3 and xai/grok-4.3-latest — with pricing, context-window limits, and capability flags; JSON structure and pricing values are consistent with the file's existing xAI entries and the PR author's sourced math.

Reviews (1): Last reviewed commit: "feat(xai): add grok-4.3 and grok-4.3-lat..." | Re-trigger Greptile

@krrish-berri-2

Copy link
Copy Markdown
Contributor

merge to internal staging, not main @ishaan-berri

@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor

🤖 litellm-agent: This PR's commits have been merged into the staging branch litellm_agent_oss_staging_05_05_2026.

Staging PR: #27162

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