Skip to content

fix(model-prices): add missing xAI and Moonshot models and fix an OpenRouter context limit - #44227

Closed
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
litellm_model_registry_audit_1790969119
Closed

devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
litellm_model_registry_audit_1790969119

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Two models had no cost map entry and one OpenRouter entry had a wrong context limit

How it solves it:

  • Adds the two entries with official source URLs and fixes the OpenRouter limit in both registry copies

User Flow

Before: a proxy admin routing to a newly released model sees it logged as unmapped, or with a wrong context limit

  1. The admin adds moonshot/kimi-k2.7-code-highspeed or xai/grok-imagine-video-1.5-lite to their config
  2. LiteLLM raises "This model isn't mapped yet" when it looks up cost or context
  3. openrouter/z-ai/glm-5.3-flash reports a 1,310,720 token input limit while OpenRouter lists 1,048,576

After: the same models resolve with the provider's published prices and limits

  1. The admin adds the same models to their config
  2. Cost and context lookups return the official values below
  3. openrouter/z-ai/glm-5.3-flash reports a 1,048,576 token input limit

Changes by provider

Moonshot

Added moonshot/kimi-k2.7-code-highspeed: $1.90 per 1M cache-miss input, $0.38 per 1M cached input, $8.00 per 1M output, 262,144 token context, reasoning, tool calling, image and video input. Sources: https://platform.kimi.ai/docs/pricing/chat-k27-code and https://platform.kimi.ai/docs/guide/kimi-k2-7-code-quickstart

xAI

Added xai/grok-imagine-video-1.5-lite as video_generation: $0.01 per input image, $0.02 per second at 480p, $0.03 at 720p, $0.14 at 1080p, text and image in, video out. Sources: https://docs.x.ai/developers/pricing and https://docs.x.ai/docs/models/grok-imagine-video-1.5-lite

OpenRouter

#44287 landed on main during this run and already synced kimi-k3, glm-5.3, inkling, qwen3.5-35b-a3b and ling-3.1-flash to the values this PR originally carried, so after merging main the only OpenRouter change left is openrouter/z-ai/glm-5.3-flash max_input_tokens 1,310,720 -> 1,048,576, matching context_length in https://openrouter.ai/api/v1/models

A fresh read of the same API agrees with main for deepseek-v4.1-flash, nemotron-3.5-lightning, hy3, hy4-preview and glm-5.2, so my earlier values for those were dropped. For mimo-v2.6-flash and mimo-v2.6-pro the API reports context_length 1,050,000 but top_provider.context_length 1,048,576, so main's 1,048,576 was kept

Checked and left unchanged

Gemini Antigravity preview models and AQA are listed by the Gemini models API, but https://ai.google.dev/gemini-api/docs/pricing publishes no per-token price for them, so they were not added. Groq allam-2-7b is listed by the Groq models API with a 4,096 context, but Groq publishes no per-token price for it. Fireworks accounts/fireworks/models/qwen3p8-2p4t-a95b is confirmed by https://api.fireworks.ai/inference/v1/models (262,144 context, tools, no image input), but no price was found on https://fireworks.ai/models/fireworks/qwen3p8-2p4t-a95b via curl or https://r.jina.ai/, and the browser fallback could not run here. openrouter/deepseek/deepseek-v4-flash-0731 looked drifted on a first pass, but a second API read did not confirm it, so it was left alone. Anthropic (Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 4.5), Together, DeepSeek, Bedrock and Voyage entries were checked against their official pricing pages and already matched. Mistral context and capability differences seen in its models API were not changed without a matching docs page

Open registry PRs were reviewed for absorption. #43879 and #43753 add bare kimi-k2.5 and deepseek-v3 aliases for models that main already maps as moonshot/kimi-k2.5 and deepseek/deepseek-v3, so they were not absorbed. #43859 (Tinker models) was not absorbed because its prices were not field-verified against Tinker's docs in this run. #42726, #44138, #44163, #44167 and #44168 change code or behavior and only touch the JSON incidentally, so they were left alone

Pre-Submission checklist

  • The handful of test files covering my change pass locally: tests/unit/test_model_prices_schema.py and tests/unit/test_model_cost_aliases.py (74 passed), plus python3 ci_cd/check_files_match.py
  • My PR's scope is as isolated as possible; it only solves 1 specific problem

Screenshots / Proof of Fix

Each side runs litellm.get_model_info on the model with LITELLM_LOCAL_MODEL_COST_MAP=True, which is the same lookup the proxy uses for spend tracking

Before (main at 9e31afb)

  1. get_model_info("xai/grok-imagine-video-1.5-lite") -> ModelNotMappedError: This model isn't mapped yet
  2. get_model_info("moonshot/kimi-k2.7-code-highspeed") -> ModelNotMappedError: This model isn't mapped yet
  3. get_model_info("openrouter/z-ai/glm-5.3-flash") -> max_input_tokens 1310720

After (29d5a9b)

  1. get_model_info("xai/grok-imagine-video-1.5-lite") -> output_cost_per_second 0.02
  2. get_model_info("moonshot/kimi-k2.7-code-highspeed") -> input 1.9e-06, output 8e-06, cache_read 3.8e-07, max_input_tokens 262144
  3. get_model_info("openrouter/z-ai/glm-5.3-flash") -> max_input_tokens 1048576

Type

🐛 Bug Fix

Caveats (if any)

Low

  • Proof uses cost map lookups, not paid live provider calls
  • ci_cd/cost_map_pins.json is absent on main, so no pins were checked
  • OpenRouter values reflect the API on 2026-10-03
  • osv-scan flags GHSA-vfj7-8cjw-p6xm in braces from ui/litellm-dashboard/package-lock.json, which this PR does not touch and which has no fixed release yet
  • rust-test fails at named::result_contracts_preserve_public_field_names, which also fails on main in https://github.com/BerriAI/litellm/actions/runs/37069683181

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

Link to Devin session: https://app.devin.ai/sessions/804e9537d3994f949f1d87d27f3976dc
Open in Devin Desktop: https://app.devin.ai/desktop/session/804e9537d3994f949f1d87d27f3976dc?variant=devin

…efresh OpenRouter prices

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot requested a review from a team October 2, 2026 19:28
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@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.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Critical risk] Updates pricing data that controls billing calculations.

The PR should not merge as a complete fix for the described routing flow until the newly mapped xAI video model can be called.

Findings

  1. P1 xAI video remains uncallable ▶
  2. P2 Off-peak window has no effect ▶
  3. P2 Corrected prices lack regression checks ▶

Summary

The PR adds registry entries for a Moonshot chat model, an xAI video model, and an OpenRouter chat model, and refreshes OpenRouter prices and context limits in both registry copies.

  • The xAI entry resolves as metadata but remains unavailable through LiteLLM video generation.
  • Two Tencent entries retain windowed pricing that is now identical to their base pricing.
  • Model-specific regression assertions would help protect the corrected rates.

Reviews (1) · Last reviewed commit: "fix(model-prices): add missing xAI, Moon..."

"xai/grok-imagine-video-1.5-lite": {
"input_cost_per_image": 0.01,
"litellm_provider": "xai",
"mode": "video_generation",

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.

P1 xAI video remains uncallable The new entry makes cost and metadata lookups succeed, but a video-generation request for xai/grok-imagine-video-1.5-lite still fails. LiteLLM resolves the provider to xai, finds no xAI video config, and raises video generation is not supported for xai. The model cannot complete the routing flow described in the PR.

Comment thread model_prices_and_context_window.json Outdated
Comment on lines +76336 to +76337
"cache_read_input_token_cost": 2.0625e-08,
"input_cost_per_token": 8.25e-08,

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.

P2 Off-peak window has no effect The new base input, output, and cache-read rates for openrouter/tencent/hy3 match its unchanged off-peak rates. The same is true for hy4-preview. LiteLLM switches rates during the configured 16:00–00:00 UTC window, but that switch now changes nothing. Reconcile or remove the windowed rates so the registry does not retain a misleading discount configuration.

Comment on lines +67682 to +67683
"cache_read_input_token_cost": 2.7e-07,
"input_cost_per_token": 2.7e-06,

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.

P2 Corrected prices lack regression checks The PR changes model-specific rates, including kimi-k3 input, output, and cache-read prices, without adding assertions for those values. The existing schema tests check that entries are valid, not that the corrected prices remain intact. A later registry refresh could silently reintroduce the billing drift; focused value assertions would catch it.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@codspeed

codspeed Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_model_registry_audit_1790969119 (29d5a9b) with main (9e31afb)

Open in CodSpeed

@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…y_audit_1790969119

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

# Conflicts:
#	litellm/model_prices_and_context_window_backup.json
#	model_prices_and_context_window.json
@devin-ai-integration devin-ai-integration Bot changed the title fix(model-prices): add missing xAI, Moonshot, OpenRouter models and refresh OpenRouter prices fix(model-prices): add missing xAI and Moonshot models and fix an OpenRouter context limit Oct 3, 2026
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