API · Models
Text
GLM 5.2
GLM 5.2 is Z.AI's flagship open-weight model with a 1M token context window, delivering strong performance across reasoning, coding, agentic workflows, and long-context tasks.
ReasoningTools
Context 1.0M·Max out 128K
Quickstart
import { streamText } from 'ai';
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
const blackbox = createOpenAICompatible({
name: 'blackbox',
apiKey: process.env.BLACKBOX_API_KEY!,
baseURL: 'https://api.blackbox.ai/v1',
});
const result = streamText({
model: blackbox('blackboxai/z-ai/glm-5.2'),
prompt: 'Why is the sky blue?',
});
for await (const chunk of result.textStream) {
process.stdout.write(chunk);
}Specs & pricing
- Input $/M
- 0.93
- Output $/M
- 3
- Context window
- 1.0M
- Max output
- 128K
- Supported parameters
- tool-usereasoningstreamingjson-mode
Related models
| Model | Type | Context | Input $/M |
|---|---|---|---|
| NVIDIA: Nemotron 3 Ultra | Text | 1M | 0.5 |
| Kimi K2.7 Code | Text | 262.1K | 0.74 |
| Gemma 4 31B | Text | 262.1K | 0.12 |
| GPT-OSS 120B | Text | 131K | 0.35 |
| MiniMax M2.7 | Text | 200K | 0.3 |