Back to models
Try in Agents
Model · Z.ai
GLM 5.2
zai/glm-5.2
Z.ai's coding model with 1M-context support and long-horizon task strengths
reasoningcachinglegacy
Specs
Context
1M
Max output
16K
Provider
Z.ai
Input
$0.800/ 1M tokens
Output
$2.55/ 1M tokens
Cache read
$0.160/ 1M tokens
Try it
Chat with GLM 5.2Terramind API
⌘+Enter to run
Code
import { streamText } from "ai";
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
const terramind = createOpenAICompatible({
name: "terramind",
baseURL: "https://terramind.com/api/v1",
apiKey: process.env.TERRAMIND_API_KEY!,
});
const result = streamText({
model: terramind("glm-5.2"),
prompt: "Why is the sky blue?",
});
for await (const chunk of result.textStream) {
process.stdout.write(chunk);
}
Want to run this in your app? Grab an API key · Full chat reference
More by Z.ai
| Model | Context | In | Out | Capabilities |
|---|---|---|---|---|
| 203K | $1.40 | $4.40 | reasoningcaching | |
| 1M | $1.40 | $4.40 | reasoningcaching | |
| 1M | $0.150 | $0.500 | reasoningvisioncaching | |
| 1M | $0.370 | $1.25 | reasoningvisioncaching | |
| 1.0M | $2.10 | $6.60 | reasoningcaching | |
| 1M | $2.80 | $8.80 | reasoningcaching | |
| 200K | $1.20 | $4.00 | reasoningvisionvideo | |
| 197K | $1.00 | $3.20 |