GLM 5.2 API pricing and code examples
GLM 5.2 is a Z.ai model you can call through LivRouter's OpenAI-compatible endpoint. There is no separate Z.ai account and no separate invoice: one LivRouter API key reaches GLM 5.2 alongside every other model on the platform, billed per token from prepaid credits.
GLM 5.2 API at a glance
Compare GLM 5.2 API pricing, model ID, and OpenAI-compatible examples through LivRouter.
- Model ID
- glm-5.2
- Provider
- Z.ai
- API format
- OpenAI-compatible
- Billing
- Per token from LivRouter credits
- Common integration focus
- Z.ai API integrations
GLM 5.2 pricing
Rates are in USD per 1M tokens. The reference row is the provider base rate recorded in LivRouter's catalog; the plan rows show the published rates for each eligible plan.
| Plan | Input / 1M | Output / 1M | Cached input / 1M |
|---|---|---|---|
| Reference (Z.ai) | $1.40 | $4.40 | $0.26 |
| Start | $1.40 | $4.40 | $0.26 |
| Max Glm−84% | $0.224 | $0.704 | $0.0416 |
| Pro Glm−76% | $0.336 | $1.06 | $0.0624 |
Lowest listed LivRouter rate for GLM 5.2: $0.224 per 1M input tokens on the Max Glm plan — about 84% below the Z.ai reference rate. See every plan and rate.
Source: LivRouter model catalog. Catalog checked .
What does a GLM 5.2 request cost?
One million uncached input tokens plus 100,000 output tokens at the listed Max Glm rates cost $0.294. This example excludes subscription fees and assumes the selected plan is active. Actual charges depend on input, output, and cached-token usage.
Compare plan fees and credit allowancesCall GLM 5.2 with the OpenAI SDK
GLM 5.2 follows the OpenAI chat completions format, so existing OpenAI client code keeps working — change the base URL and the model name.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.livrouter.com/v1",
apiKey: process.env.LIVROUTER_API_KEY,
});
const completion = await client.chat.completions.create({
model: "glm-5.2",
messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);Prefer plain HTTP? The same request over curl:
curl https://api.livrouter.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LIVROUTER_API_KEY" \
-d '{
"model": "glm-5.2",
"messages": [{"role": "user", "content": "Hello"}]
}'Frequently asked questions about GLM 5.2
How much does glm-5.2 cost through LivRouter?
glm-5.2 is metered per token. The Z.ai reference rate is $1.40 per 1M input tokens and $4.40 per 1M output tokens. On the Max Glm plan LivRouter charges $0.224 per 1M input tokens, about 84% below the Z.ai reference rate. Cached input is $0.0416 per 1M tokens.
Can I call glm-5.2 with the OpenAI SDK?
Yes. glm-5.2 is reachable through the OpenAI-compatible endpoint at https://api.livrouter.com/v1. Keep your existing OpenAI client code and change the base URL and the model name to "glm-5.2".
Do I need a separate Z.ai account?
No. LivRouter routes the request for you. You only need a LivRouter API key and credits — no separate Z.ai subscription.
Is glm-5.2 available on the Start tier?
Yes. glm-5.2 is reachable from the Start tier group, billed pay-as-you-go at the rates shown above.