GLM-5.2
Provider list prices: no platform markup, pay-as-you-go. These are official list prices. Logged-in customers may see effective prices including workspace discounts on /console/pricing. Effective input at a 70% cache-hit rate:$0.602/M. Automatic prompt caching: repeated prompt prefixes bill at the cache-hit rate shown in the pricing table, no code changes required.
Use GLM-5.2 in 30 seconds
OpenAI-compatible: swap the base_url, keep your SDK. POST /v1/chat/completions
from openai import OpenAI
client = OpenAI(
base_url="https://synthorai.io/v1",
api_key="sk-syn-...",
)
resp = client.chat.completions.create(
model="glm-5.2",
messages=[{"role": "user", "content": "Summarize this diff"}],
reasoning_effort="medium",
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://synthorai.io/v1",
apiKey: "sk-syn-...",
});
const resp = await client.chat.completions.create({
model: "glm-5.2",
messages: [{ role: "user", content: "Summarize this diff" }],
reasoning_effort: "medium",
});
console.log(resp.choices[0].message.content);curl https://synthorai.io/v1/chat/completions \
-H "Authorization: Bearer sk-syn-..." \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.2",
"messages": [{"role": "user", "content": "Hello"}],
"reasoning_effort": "medium"
}'package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option"
)
func main() {
client := openai.NewClient(
option.WithBaseURL("https://synthorai.io/v1"),
option.WithAPIKey("sk-syn-..."),
)
resp, _ := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
Model: "glm-5.2",
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Summarize this diff"),
},
ReasoningEffort: openai.ReasoningEffortMedium,
})
fmt.Println(resp.Choices[0].Message.Content)
}import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.chat.completions.*;
import com.openai.models.ReasoningEffort;
OpenAIClient client = OpenAIOkHttpClient.builder()
.baseUrl("https://synthorai.io/v1")
.apiKey("sk-syn-...")
.build();
ChatCompletion resp = client.chat().completions().create(
ChatCompletionCreateParams.builder()
.model("glm-5.2")
.addUserMessage("Summarize this diff")
.reasoningEffort(ReasoningEffort.MEDIUM)
.build());
System.out.println(resp.choices().get(0).message().content().orElse(""));About GLM-5.2
GLM-5.2 is Z.AI's flagship model built for the era of long-horizon tasks, extending the context window to 1M tokens with up to 128K output; the docs stress making 1M context truly usable for project-scale work.
- Over GLM-5.1, the official page highlights more stable long-horizon task execution, stronger consistency in following engineering standards across extended contexts, project-scale understanding with multi-file refactoring, and complete on-device debugging loops for mobile and client development.
- When you call GLM-5.2 on Synthorai, the OpenAI-compatible endpoint makes it a drop-in upgrade for long-context agent workloads.
Specs & limits
| Max output (vendor spec) | 131,072 |
| Modalities | text → text |
| Parameters | 744B total · 40B active (MoE) |
| Features | tools · structured_output · streaming · reasoning · caching |
| License | MIT ↗ |
| Notable | Long-horizon flagship (744B-A40B) with usable 1M-token context / 128K max output, configurable thinking-effort levels, and IndexShare sparse-attention efficiency at 1M context. |
| Prompt caching | automatic |
FAQ
Is the GLM-5.2 API free to try?
Yes: new accounts get 10 trial calls and up to $1 in free credit, no card required. At $1.4/M input tokens, that credit alone covers roughly 89 requests of ~8K tokens against GLM-5.2.
What is GLM-5.2 best at?
Context extended to 1M usable tokens, plus project-scale understanding with multi-file refactoring and on-device debugging loops for mobile development. See the About section for the full picture from the vendor's own release notes.
How much does GLM-5.2 cost?
GLM-5.2 costs $1.4 per million input tokens and $4.4 per million output tokens on Synthorai. That is the provider's list price, with no platform markup. Cached input tokens bill at $0.26/M.
Does GLM-5.2 support prompt caching?
Yes, automatically: Z.ai-served prompts cache with no code changes. Cached input tokens bill at $0.26/M vs $1.4/M uncached. Prompt caching guide →
How do I get access to GLM-5.2?
Point your existing OpenAI SDK at base_url="https://synthorai.io/v1", set model="glm-5.2", and you're done. One API key covers every model on the gateway.
Is GLM-5.2 open source?
Yes: the weights are published under the MIT license (official repository linked in the About section). Or skip the GPUs: the hosted version here is pay-as-you-go with no infrastructure to run. Running open-weight models →