90 days of the enterprise, pro and team plans free, no card needed. See the plans
Model comparison
Google's Gemma 4 31B against Z.ai's GLM 4.7 Flash: vendor list prices, limits, abilities and the Artificial Analysis indexes side by side - and what OpenSmartRoute does when both are available.
GLM 4.7 Flash lists at $0.145 per million tokens blended against $0.25 for Gemma 4 31B - 1.7x less.
Intelligence index 15 against 15: within a point of each other.
Gemma 4 31B reads 262k tokens at once, GLM 4.7 Flash 200k.
only Gemma 4 31B offers image input.
Gemma 4 31B was released about 2 months later.
Vendor list prices per million tokens and published limits; indexes are Artificial Analysis composites (0-100).
| Specification | Gemma 4 31B | GLM 4.7 Flash |
|---|---|---|
| Input price / 1M tokens | $0.20 | $0.06 |
| Output price / 1M tokens | $0.40 | $0.40 |
| Blended (3 in : 1 out) | $0.25 | $0.15 |
| Cached input / 1M | - | - |
| Context window | 262K | 200K |
| Max output | 16K | 118K |
| Input | image, text, video | text |
| Output | text | text |
| Tool calls | ||
| Structured output | ||
| Reasoning | ||
| Open weights | ||
| Intelligence index | 15 | 15 |
| Coding index | 43 | - |
| Agentic index | 4 | - |
| Released | Apr 2, 2026 | Jan 19, 2026 |
| Available on this deployment |
List price times tokens for three typical workloads; your mix of input and output decides which model's pricing suits you.
| Workload | Gemma 4 31B | GLM 4.7 Flash | Difference |
|---|---|---|---|
| Support chat20M tokens in, 5M out a month - a help desk answering a few thousand conversations. | $6.00 | $3.21 | $2.79 less on GLM 4.7 Flash |
| Document summaries100M in, 5M out - long inputs, short answers. | $22.00 | $8.05 | $13.95 less on GLM 4.7 Flash |
| Coding assistant60M in, 20M out - a team's editor assistant, output-heavy. | $20.00 | $11.63 | $8.37 less on GLM 4.7 Flash |
The two measure the same on the intelligence index, so the router treats them as peers and lets price, observed latency and your outcomes decide: GLM 4.7 Flash wins on cost, and a few bad outcomes on either move the next requests to the other.
# targets.yaml - both models as routing targets (metadata.model links each to the catalogue entry)
targets:
- { id: glm-4.7-flash, kind: llm, metadata: { model: z-ai/glm-4.7-flash } }
- { id: gemma-4-31b-it, kind: llm, metadata: { model: google/gemma-4-31b-it } }
# rules.yaml - the cheaper model by default, the stronger one when the request is hard
rules:
- name: simple-requests-stay-cheap
when: { max_complexity: 0.45 }
prefer: [glm-4.7-flash]
weight: 0.8
- name: hard-requests-escalate
when: { min_complexity: 0.45 }
prefer: [gemma-4-31b-it]
weight: 0.8