GLM-5.2 API
Z.ai's open-weight frontier challenger, strong coding and reasoning with one of the best free tiers in class.
Model spec
- Input
- $1.40per 1M tokens
- Output
- $4.40per 1M tokens
- Context
- 128K
Model ID
OpenAI-compatible · api.companyfabric.com/v1
Overview
About GLM-5.2
GLM-5.2 is Z.ai's open-weight frontier challenger, strong coding and reasoning with one of the most generous free tiers in class, which is exactly why 'glm 5.2 free' is one of the fastest-growing model queries. Through CompanyFabric it runs metered on the same key as everything else, with starter credits covering your first calls. Every model on CompanyFabric shares the same API key, billing balance, and rate-limit envelope, one integration covers the entire library.
Facts
At a glance
Availability
Live
Added 1 Aug 2026
Pricing
$1.40 in · $4.40 out
Per 1M tokens, metered exactly per call
Context window
128K tokens
Commercial use
See license
Open weights; commercial use permitted per the Z.ai model license.
Variants
All endpoints
GLM-5.3-Flash
$0.15/Mtok inNative multimodal coding model at the lowest rate in the catalog.
Chat Completions
GLM-5.2
$1.4/Mtok inZ.ai's open-weight frontier challenger, strong coding and reasoning with one of the best free tiers in class.
Chat Completions
GLM-5.3
$1.4/Mtok inZ.ai's flagship coding and agent model, GLM-5.2's base post-trained further, at the same price.
Chat Completions
GLM-Legal
Coming soonZ.ai's legal model, built on GLM-5.3-Flash, for contract review, evidence analysis and compliance. API access by application for now.
Chat Completions
Quickstart
How to use the GLM-5.2 API
- 1
Create a free CompanyFabric account, starter credits are included, no card required.
- 2
Copy your API key from the dashboard. One key covers every model in the library.
- 3
Point any OpenAI SDK at api.companyfabric.com/v1 and set model to "z-ai/glm-5.2".
- 4
Read the exact metered cost of the call from the response, the same number shown in the playground.
Use cases
What teams build with it
Agents & copilots
Drive agent loops, tool calls, and user-facing assistants over the OpenAI-compatible endpoint.
agentstool useassistants
Content pipelines
Summarization, rewriting, and structured generation at metered per-token cost.
contentsummarization
Extraction & classification
Turn unstructured input into typed JSON with schema-constrained output.
extractionjson mode
Get better output
Prompting tips
- State the output format before the task, models follow contracts declared early.
- Few-shot beats description: two worked examples outperform a paragraph of rules.
- Cap output length explicitly when cost matters; output tokens dominate most bills.
Exact, metered, prepaid
GLM-5.2 pricing
GLM-5.2 pricing is per token: $1.4 / M input · $4.4 / M output. Output tokens cost 3.1× input tokens, so long generations, not long prompts, are what actually drive most bills. A typical call with a 2k-token prompt and a 1k-token answer costs about $0.0072.
Every call is metered exactly and attributed to your key, the dashboard, the API usage response, and your invoice all read from the same ledger row. Cap any key's monthly spend with a budget cap, and bring your own provider key (BYOK) at 0% platform fee if you already have a direct contract.
| Endpoint | Type | Price |
|---|---|---|
| GLM-5.3-Flash | Chat | $0.15 / M input · $0.5 / M output |
| GLM-5.2 | Chat | $1.4 / M input · $4.4 / M output |
| GLM-5.3 | Chat | $1.4 / M input · $4.4 / M output |
| GLM-Legal | Chat | Price not announced |
Starter credits
Use GLM-5.2 free
Your CompanyFabric starter credits cover your first GLM-5.2 calls at no cost, create a free account, no card required, and the credits apply to GLM-5.2 and every other model on the key. When they run out, prepaid credits or BYOK (0% fee) take over with no plan to pick.
All ways to use AI models free →Run GLM-5.2 locally (open weights) →
Production-grade
Code samples
import OpenAI from "openai"
const client = new OpenAI({
baseURL: "https://api.companyfabric.com/v1",
apiKey: process.env.COMPANYFABRIC_API_KEY,
})
const res = await client.chat.completions.create({
model: "z-ai/glm-5.2",
max_tokens: 1024,
temperature: 0.7,
messages: [{ role: "user", content: "Say hello from the fabric." }],
})
console.log(res.choices[0].message.content)Playground
Try it in the browser
Comparisons
GLM-5.2 vs the alternatives
GLM-5.2 vs DeepSeek V4.1 Flash
GLM-5.2 and DeepSeek V4.1 Flash compete for the same text workloads. Both run behind the same CompanyFabric key at exact metered prices, A/B them on your real prompts and let the outputs decide, then switch with a one-line change.
Full comparison: GLM-5.2 vs DeepSeek V4.1 Flash →GLM-5.2 vs Kimi K3
GLM-5.2 and Kimi K3 compete for the same text workloads. Both run behind the same CompanyFabric key at exact metered prices, A/B them on your real prompts and let the outputs decide, then switch with a one-line change.
Full comparison: GLM-5.2 vs Kimi K3 →Compare
GLM-5.2 head to head
FAQ
Frequently asked questions
How much does the GLM-5.2 API cost?
$1.4 / M input · $4.4 / M output. Every call is metered exactly and shown before you run it.
How do I get a GLM-5.2 API key?
Create a CompanyFabric account, and one key unlocks GLM-5.2 and every other model in the library. Free starter credits are included, no subscription, no card required to try it.
Why use GLM-5.2 on CompanyFabric instead of going direct?
One key, one prepaid balance, and one rate-limit envelope across the whole library, at pricing at parity with or below the direct API. Model switching is a one-line change, and BYOK routing is 0% fee.
Is the API OpenAI-compatible?
Yes, point any OpenAI SDK at api.companyfabric.com/v1 and set model to "z-ai/glm-5.2".
Can I use the output commercially?
Open weights; commercial use permitted per the Z.ai model license.
How does billing work?
Prepaid credits via card, or BYOK with your own provider keys at 0% platform fee. No subscription required; balances never expire.
Can I use GLM-5.2 for free?
Your CompanyFabric starter credits cover initial GLM-5.2 calls at no cost, no card required. Being open-weights, it can also be self-hosted; the API route is for when you'd rather not operate GPUs.
Provider
About Z.ai
Z.ai publishes the glm family. Also in this family: GLM-5.3-Flash, GLM-5.3, GLM-Legal. License: Open weights; commercial use permitted per the Z.ai model license.
One key. Every model. Exact prices.
Run GLM-5.2 with free starter credits. Free starter credits included, no subscription required.