4 models · chat / code / reasoning / tools · from $1/M input
Why Z.ai via Synthorai
- Pay-as-you-go, no subscription. One key, every model; no Z.ai account required.
- Zero prompt retention. Zero prompt retention at the gateway by default; Z.ai's API data policies apply upstream. Details →
- Prompt caching. Automatic prompt caching: repeated prompt prefixes bill at the cache-hit rate shown in the pricing table, no code changes required. Cache reads from $0.2/M.
Z.ai models & pricing
| Model | Input /M | Output /M | Cache read /M | Context |
|---|---|---|---|---|
| GLM-5.1 | $1.4 | $4.4 | $0.26 | 200K |
| GLM-5.2 | $1.4 | $4.4 | $0.26 | 1M |
| GLM-5-Turbo | $1.2 | $4 | $0.24 | 205K |
| GLM-5 | $1 | $3.2 | $0.2 | 200K |
Provider list prices: no platform markup. Prices refresh live on each model's page. These are official list prices. Logged-in customers may see effective prices including workspace discounts on /console/pricing.
Use Z.ai models in 30 seconds
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 Z.ai
Z.ai (formerly Zhipu) builds the GLM family: frontier open-weight models with strong coding and agentic performance at aggressive price points; GLM-5.2 is one of the strongest value picks on the gateway. Synthorai serves GLM through the same OpenAI-compatible endpoint as every other model, with live pricing and prompt-cache reads where supported.
FAQ
How do I get a Z.ai API key without a subscription?
You don't need a Z.ai account: sign up on Synthorai, create one API key, and every Z.ai model on this page works through the OpenAI-compatible endpoint: pay-as-you-go, no subscription (models marked "invited beta" additionally need an approved application).
What does the Z.ai API cost?
Token-billed models start at $1/M input tokens; every model's live per-unit price is in the table above. These are provider list prices with no platform markup.
Can I use my own Z.ai key (BYOK)?
BYOK isn't available for Z.ai yet; requests run on Synthorai's managed channels at the listed rates.
What is Z.ai's data-retention policy via API?
Zero prompt retention at the gateway by default; Z.ai's API data policies apply upstream.