GLM-5.1
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.1 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.1",
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.1",
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.1",
"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.1",
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.1")
.addUserMessage("Summarize this diff")
.reasoningEffort(ReasoningEffort.MEDIUM)
.build());
System.out.println(resp.choices().get(0).message().content().orElse(""));About GLM-5.1
GLM-5.1 is Z.AI's flagship foundation model designed for long-horizon tasks, officially described as able to work continuously and autonomously on a single task for up to 8 hours, covering planning, execution, testing, fixing, and delivery.
- Building on GLM-5, it emphasizes an experiment-analyze-optimize loop rather than single-pass generation, enabling autonomous exploration, continuous improvement, and stable delivery in complex engineering environments.
- The model offers a 200K context window with up to 128K output tokens, plus thinking modes and function calling.
- Synthorai exposes GLM-5.1 behind its OpenAI-compatible endpoint for drop-in integration.
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 | Next-gen agentic-engineering flagship (744B-A40B): works autonomously up to 8 hours in a single run across thousands of tool calls; 200K context / 128K max output. |
| Prompt caching | automatic |
FAQ
Is the GLM-5.1 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.1.
What is GLM-5.1 best at?
Works autonomously up to 8 hours, plus experiment-analyze-optimize loop over single-pass generation and covers planning through testing and delivery. See the About section for the full picture from the vendor's own release notes.
How much does GLM-5.1 cost?
GLM-5.1 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.1 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.1?
Point your existing OpenAI SDK at base_url="https://synthorai.io/v1", set model="glm-5.1", and you're done. One API key covers every model on the gateway.
Is GLM-5.1 open source?
Yes: the weights are published under the MIT license. Or skip the GPUs: the hosted version here is pay-as-you-go with no infrastructure to run. Running open-weight models →