Skip to content

Add OpenRouter pricing for z-ai/glm-5.3-flash - #39919

Closed
jlui17 wants to merge 1 commit into
BerriAI:mainfrom
jlui17:add-openrouter-glm-5.3-pricing
Closed

jlui17 wants to merge 1 commit into
BerriAI:mainfrom
jlui17:add-openrouter-glm-5.3-pricing

Conversation

@jlui17

@jlui17 jlui17 commented Sep 5, 2026

Copy link
Copy Markdown

TLDR

Problem this solves:

  • openrouter/z-ai/glm-5.3-flash has no pricing row, so spend logs $0 or a fallback estimate
  • The direct zai/glm-5.3-flash row exists, but not the OpenRouter one

How it solves it:

  • Adds openrouter/z-ai/glm-5.3-flash to model_prices_and_context_window.json and the backup copy
  • Prices are Z.ai's list prices, matching the existing zai/glm-5.3-flash row (OpenRouter is running a temporary 50% promo through 2026-09-09; not encoded)
  • Context and max output are from https://openrouter.ai/api/v1/models

User Flow

Before: a developer routing GLM 5.3 Flash through OpenRouter sees no cost for those calls

  1. They send POST https://litellm-domain/v1/chat/completions with "model": "openrouter/z-ai/glm-5.3-flash"
  2. The response comes back fine, but the spend recorded for the request is $0 because the model has no pricing row
  3. They open https://litellm-domain/ui/?page=logs and see the request at $0 spend

After: the same request records real spend

  1. They send the same POST with "model": "openrouter/z-ai/glm-5.3-flash"
  2. The response comes back the same, and spend is computed from $0.15/M input, $0.50/M output, $0.03/M cache read
  3. They open https://litellm-domain/ui/?page=logs and see the request with a real dollar figure

Caveats

  • OpenRouter currently shows a limited-time 50% discount for this model (through September 9, 2026). This row uses the undiscounted list price, consistent with the zai/glm-5.3-flash row.

Type

🆕 New Feature

Changes

  • model_prices_and_context_window.json: add openrouter/z-ai/glm-5.3-flash
  • litellm/model_prices_and_context_window_backup.json: same row

@jlui17
jlui17 requested a review from mateo-berri as a code owner September 5, 2026 17:50
@CLAassistant

CLAassistant commented Sep 5, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds OpenRouter pricing, token limits, and capability metadata for z-ai/glm-5.3-flash in both model registries

  • Uses the existing direct Z.AI model prices
  • Keeps the primary and backup registries synchronized
  • Needs functional cost-calculation coverage required for new features

Confidence Score: 4/5

The metadata looks consistent, but the repository’s required functional coverage should be added before merge

The pricing and limits follow existing registry conventions, but this new spend-calculation behavior has no test proving the model resolves and calculates costs correctly

Files Needing Attention: model_prices_and_context_window.json, litellm/model_prices_and_context_window_backup.json

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds consistent OpenRouter model metadata but lacks required functional pricing coverage
litellm/model_prices_and_context_window_backup.json Mirrors the new model metadata from the primary registry

Reviews (1): Last reviewed commit: "Add OpenRouter pricing for z-ai/glm-5.3-..." | Re-trigger Greptile

"supports_reasoning": true,
"supports_tool_choice": true
},
"openrouter/z-ai/glm-5.3-flash": {

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 Missing functional pricing test

This adds pricing behavior without a functional cost-calculation test. Repository guidance requires meaningful tests for new features, so this requirement must be satisfied before merging

Context Used: CLAUDE.md (source)

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 Sep 5, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing jlui17:add-openrouter-glm-5.3-pricing (f8dd867) with main (7d5b645)

Open in CodSpeed

@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by the rolling registry PR #31884. The openrouter/z-ai/glm-5.3-flash entry already exists on litellm_internal_staging with the live OpenRouter API prices (7.5e-8 input, 2.5e-7 output, 1.5e-8 cache read), which differ from the values proposed here. Thanks for flagging the gap.

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.

2 participants