OpenAI compatible API · Attested · Public status

Z.ai: GLM 5.2 vs Google: Gemma 4 31B

Compare Z.ai: GLM 5.2 and Google: Gemma 4 31B by providers, context, price, and TrustedRouter route support.

Verify gateway
Onebase URL to migrate
100sof models and routes
Noneprompt logs by default
Compare routesProviders, price, context, and policy posture in one view.
Use auto when uptime mattersKeep a primary model and let fallback handle provider failures.
Same API shapeUse the OpenAI client and set the model you want.

Practical read

Google: Gemma 4 31B has the lower cheapest prompt+completion route on TrustedRouter. Z.ai: GLM 5.2 has more provider fallback routes, while Z.ai: GLM 5.2 has the larger context window. Current TrustedRouter probes show Google: Gemma 4 31B with the lower p50 TTFT.

$2.07942/1MZ.ai: GLM 5.2 cheapest route
$0.5355/1MGoogle: Gemma 4 31B cheapest route
1832 msZ.ai: GLM 5.2 measured p50 TTFT
896 msGoogle: Gemma 4 31B measured p50 TTFT
Z.ai: GLM 5.2Google: Gemma 4 31B
Model idz-ai/glm-5.2google/gemma-4-31b-it
PublisherZ.AIGoogle AI Studio
Context1,048,576 tokens262,144 tokens
Provider routes3923
Cheapest route$2.07942/1M$0.5355/1M
Privacy posturehas provider E2EE routehas provider E2EE route
Modes chat chat

Z.ai: GLM 5.2 routes

Google: Gemma 4 31B routes

Production choice

Pick a default model. Keep fallback enabled.

TrustedRouter is useful when you know the model you want, but still need provider rollover, budget limits, usage records, and a prompt path you can verify.

OpenAI clientPython
client = OpenAI(
    base_url="https://api.trustedrouter.com/v1",
    api_key="sk-tr-v1-..."
)

response = client.chat.completions.create(
    model="z-ai/glm-5.2",
    messages=messages,
)
Workspace access

Sign in

Choose a sign in method. New email and OAuth accounts include $0.10 in starter credit; wallet-only accounts start at $0.

By signing in you agree to the terms of service and privacy policy.