feat(pricing): add xai/grok-4.5 model pricing and metadata - #32549
Conversation
Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
Greptile SummaryThis PR adds pricing and capability metadata for
Confidence Score: 5/5Safe to merge — two JSON pricing files updated with well-sourced, structurally consistent metadata. The change is additive-only (two new JSON objects), the per-token prices match the xAI public documentation, the above-200k tier follows the same doubling pattern as grok-4.3, and both files are kept in sync. No logic, tests, or existing entries are touched. No files require special attention.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds xai/grok-4.5 and xai/grok-4.5-latest with pricing and capability metadata; values match xAI docs and are structurally consistent with existing xAI model entries. |
| litellm/model_prices_and_context_window_backup.json | Backup JSON updated in sync with the main pricing file; identical entries for xai/grok-4.5 and xai/grok-4.5-latest. |
Reviews (1): Last reviewed commit: "feat(pricing): add xai/grok-4.5 model pr..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…2549) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
xAI just shipped Grok 4.5 (
grok-4.5, withgrok-4.5-latestas an alias). This adds both to the cost map so cost tracking and context-window metadata resolve for the modelPricing and metadata are taken from https://docs.x.ai/docs/models. The docs express per-token prices in internal units where the existing
grok-4.3entry (docs value 12500) maps to1.25e-06, i.e. units x 1e-10. Applying that to grok-4.5's docs values gives input2e-06, output6e-06, cached input5e-07, and the >200k long-context tier at input4e-06, output1.2e-05, cached1e-06, with a 500k context window and reasoning, vision, function calling, structured outputs, prompt caching and web search all supportedLive billed call against the real xAI API, captured at commit
fbad6ad8ad:The
$0.0006LiteLLM computes matches the tiered pricing exactly: 91 uncached input x2e-06+ 128 cached input x5e-07+ 59 output x6e-06=6.0e-04, which also lines up with xAI's owncost_in_usd_ticks=6000000(ticks x 1e-10)Metadata resolution from the local cost map:
Type
🆕 New Feature
Changes
Add
xai/grok-4.5and itsxai/grok-4.5-latestalias tomodel_prices_and_context_window.jsonand the bundledlitellm/model_prices_and_context_window_backup.jsonLink to Devin session: https://app.devin.ai/sessions/e8043e650ee9475195e2caead0d4bd46
Requested by: @ishaan-berri