# Z.ai GLM 5.2 API

> GLM-5.2 is Z.ai's open-weight flagship text model released in June 2026 for long-horizon tasks, and the first GLM model to deliver that capability on a usable 1M-token context. Z.ai positions it for project-scale software engineering, deep debugging and full development workflows from requirements to deployable products, with steadier long-task execution and closer adherence to engineering standards. GLM-5.3 builds on the same base model with further post-training for coding.

Source: https://www.sandbase.ai/models/z-ai/glm-5.2
API reference: https://www.sandbase.ai/models/z-ai/glm-5.2/docs

## Facts

- Provider: Z.ai
- Type: Language model
- Model ID: `z-ai/glm-5.2`
- Price: $1.26 per 1M input tokens, $3.96 per 1M output tokens (10% off list price)
- Context window: 1M tokens, up to 32.8K output tokens
- Capabilities: chat, reasoning, structured output, function calling
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Chat Completions API: `POST https://api.sandbase.ai/v1/chat/completions`

```bash
curl -X POST https://api.sandbase.ai/v1/chat/completions \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "z-ai/glm-5.2",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ],
  "max_tokens": 2048
}'
```

## FAQ

### How do I call Z.ai GLM 5.2 through SandBase?

Create a SandBase API key, then send requests with the model ID "z-ai/glm-5.2" to Chat Completions API (/v1/chat/completions) at https://api.sandbase.ai. The request examples on this page show the exact payload.

### How much does Z.ai GLM 5.2 cost?

$1.26 per 1M input tokens and $3.96 per 1M output tokens with the current 10% discount (list price $1.40 / $4.40), billed per request from your SandBase balance.

### What is the context window of Z.ai GLM 5.2?

1M tokens of context, with up to 32.8K output tokens per response.

### How does Z.ai GLM 5.2 score on benchmarks?

Z.ai GLM 5.2 scores 33.7 on the Artificial Analysis Intelligence Index (v4.3), ranking #36 of 83 models on SandBase; Coding Index 68.8, Agentic Index 38.4. Source: Artificial Analysis, measured as GLM-5.2 (Max).

### Which features does Z.ai GLM 5.2 support?

Z.ai GLM 5.2 supports reasoning, function calling, structured output. See Specifications above for the full list.

### Do I need a separate Z.ai account?

No. One SandBase API key and balance gives you access to Z.ai GLM 5.2 and the other models in the catalog; you do not need to sign up with Z.ai separately.
