glm-5.2 — harga, konteks dan performa
glm-5.2 adalah model Z.AI dengan konteks 1M dan dukungan Reasoning, Tools, Open Weights. Input $1.40, output $4.40 per 1 juta token.
Ringkasan
| Vendor | Z.AI |
|---|---|
| Konteks | 1M |
| Kemampuan | Reasoning, Tools, Open Weights |
| Format API | openai, openai-response, openai-response-compact, anthropic, gemini, openai-alpha-search |
| Rumus penagihan | p * 1.4 + cr * 0.26 + cc * 0 + c * 4.4 |
Open flagship GLM for long-horizon coding agents and million-token context workHarga
| Paket | Pengali | Input | Output | Cache (input) | Catatan |
|---|---|---|---|---|---|
| Harga dasar | 1× | $1.40 | $4.40 | $0.26 | |
| default | 0.6× | $0.84 | $2.64 | $0.16 | Standard — standard reasoning, moderate stability. |
| Plus | 1× | $1.40 | $4.40 | $0.26 | High — strong reasoning, stable. |
| Pro | 2× | $2.80 | $8.80 | $0.52 | Enterprise — full reasoning, high stability. |
| Max | 4× | $5.60 | $17.60 | $1.04 | Premium — max reasoning & stability. |
Hanya grup yang diaktifkan untuk model ini yang dicantumkan.
Performa
| Endpoint API | https://api.airai.cc/v1 |
|---|---|
| Kompatibel OpenAI | OpenAI-compatible |
FAQ
Berapa harga glm-5.2?
Input $1.40, output $4.40 per 1 juta token.
Berapa jendela konteks glm-5.2?
glm-5.2 memiliki jendela konteks 1M: batas gabungan token input dan output dalam satu permintaan.
Bagaimana memanggil glm-5.2 dari kode?
Arahkan base_url ke https://api.airai.cc/v1 dan set model ke glm-5.2. API sepenuhnya kompatibel dengan OpenAI.
Mengapa glm-5.2 mengembalikan error 429?
429 adalah respons pembatasan laju. Kurangi konkurensi, coba lagi dengan jeda, atau beralih ke paket dengan kuota lebih besar.
Perbandingan model
| Model | Vendor | Input | Output | Konteks |
|---|---|---|---|---|
| glm-5.2 | Z.AI | $1.40 | $4.40 | 1M |
| glm-4.7 | Z.AI | $0.60 | $2.20 | 204.8K |
| glm-4.5-air | Z.AI | $0.20 | $1.10 | 131.1K |
| glm-5.3 | Z.AI | $1.40 | $4.40 | 1M |
| glm-5.1 | Z.AI | $1.40 | $4.40 | 200K |
| glm-5 | Z.AI | $1.00 | $3.20 | 204.8K |
| glm-4.5 | Z.AI | $0.60 | $2.20 | 131.1K |
| glm-4.6 | Z.AI | $0.60 | $2.20 | 204.8K |
| glm-5.3-flash | Z.AI | $0.15 | $0.50 | 1M |
Pemecahan masalah
429 adalah respons pembatasan laju. Kurangi konkurensi, coba lagi dengan jeda, atau beralih ke paket dengan kuota lebih besar.
Penyebab umum
- Terlalu banyak permintaan bersamaan
- Kuota paket saat ini habis
- Mencoba ulang tanpa jeda
Cara mengatasi
- Batasi konkurensi dan coba ulang dengan jeda eksponensial
- Beralih ke paket dengan kuota lebih besar
- Simpan cache permintaan yang berulang
Cara menghubungkan
curl https://api.airai.cc/v1/chat/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.2",
"messages": [{"role": "user", "content": "Hello"}]
}'from openai import OpenAI
client = OpenAI(
api_key="<YOUR_API_KEY>",
base_url="https://api.airai.cc/v1"
)
response = client.chat.completions.create(
model="glm-5.2",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: "<YOUR_API_KEY>",
baseURL: "https://api.airai.cc/v1"
});
const response = await client.chat.completions.create({
model: "glm-5.2",
messages: [{ role: "user", content: "Hello" }]
});
console.log(response.choices[0].message.content);const OpenAI = require("openai");
const client = new OpenAI({
apiKey: "<YOUR_API_KEY>",
baseURL: "https://api.airai.cc/v1"
});
client.chat.completions.create({
model: "glm-5.2",
messages: [{ role: "user", content: "Hello" }]
}).then((r) => console.log(r.choices[0].message.content));Ganti <YOUR_API_KEY> dengan API Key dari pengaturan token Anda.
Endpoint kompatibel
openaiopenai-responseopenai-response-compactanthropicgeminiopenai-alpha-search
Gemini SDK · TypeScript
import { GoogleGenerativeAI } from "@google/generative-ai";
const genAI = new GoogleGenerativeAI("<YOUR_API_KEY>");
const model = genAI.getGenerativeModel({ model: "glm-5.2" });
const result = await model.generateContent(
"Explain quantum entanglement in one paragraph."
);
console.log(result.response.text());Autentikasi
Semua permintaan harus menyertakan header Authorization: Bearer <TOKEN>. Endpoint format Anthropic juga menerima header x-api-key. Buat API Key Anda di halaman Token, tempat Anda dapat membatasinya berdasarkan model, grup, IP, dan laju.
Parameter yang didukung
| Parameter | Tipe | Bawaan | Rentang | Deskripsi |
|---|---|---|---|---|
temperature | float | 1 | 0–2 | Suhu sampling; lebih rendah lebih stabil |
top_p | float | 1 | 0–1 | Probabilitas kumulatif nucleus sampling |
max_tokens | integer | — | — | Token maksimum dalam respons |
frequency_penalty | float | 0 | −2–2 | Hukuman pengulangan token frekuensi tinggi |
presence_penalty | float | 0 | −2–2 | Mendorong topik baru |
stop | string[] | null | ≤ 4 | Hingga 4 string penghentian |
seed | integer | null | — | Seed untuk sampling lebih dapat direproduksi |
n | integer | 1 | — | Jumlah kandidat yang dihasilkan |
stream | boolean | false | — | Streaming token via SSE |
response_format | object | — | — | Memaksa output JSON atau hasil sesuai skema |
tools | array | — | — | Deklarasi alat / fungsi yang dapat dipanggil model |
tool_choice | string | object | auto | — | Strategi pemilihan alat atau nama alat tertentu |
logprobs | boolean | false | — | Mengembalikan log-probabilitas tiap token |
top_logprobs | integer | null | 0–20 | Jumlah probabilitas teratas per token |
logit_bias | map | — | — | Pemetaan logit bias per token |
user | string | — | — | Identitas pengguna akhir untuk audit risiko |
Batas laju
| Tingkat | RPM | TPM | RPD |
|---|---|---|---|
| Eco | 990 | 398K | 20K |
| Test | 980 | 393K | 20K |
Data diperbarui: 2026-10-10 18:30