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

VendorZ.AI
Konteks1M
KemampuanReasoning, Tools, Open Weights
Format APIopenai, openai-response, openai-response-compact, anthropic, gemini, openai-alpha-search
Rumus penagihanp * 1.4 + cr * 0.26 + cc * 0 + c * 4.4
Open flagship GLM for long-horizon coding agents and million-token context work

Harga

PaketPengaliInputOutputCache (input)Catatan
Harga dasar1×$1.40$4.40$0.26
default0.6×$0.84$2.64$0.16Standard — standard reasoning, moderate stability.
Plus1×$1.40$4.40$0.26High — strong reasoning, stable.
Pro2×$2.80$8.80$0.52Enterprise — full reasoning, high stability.
Max4×$5.60$17.60$1.04Premium — max reasoning & stability.

Hanya grup yang diaktifkan untuk model ini yang dicantumkan.

Performa

Endpoint APIhttps://api.airai.cc/v1
Kompatibel OpenAIOpenAI-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

ModelVendorInputOutputKonteks
glm-5.2Z.AI$1.40$4.401M
glm-4.7Z.AI$0.60$2.20204.8K
glm-4.5-airZ.AI$0.20$1.10131.1K
glm-5.3Z.AI$1.40$4.401M
glm-5.1Z.AI$1.40$4.40200K
glm-5Z.AI$1.00$3.20204.8K
glm-4.5Z.AI$0.60$2.20131.1K
glm-4.6Z.AI$0.60$2.20204.8K
glm-5.3-flashZ.AI$0.15$0.501M

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

ParameterTipeBawaanRentangDeskripsi
temperaturefloat10–2Suhu sampling; lebih rendah lebih stabil
top_pfloat10–1Probabilitas kumulatif nucleus sampling
max_tokensinteger——Token maksimum dalam respons
frequency_penaltyfloat0−2–2Hukuman pengulangan token frekuensi tinggi
presence_penaltyfloat0−2–2Mendorong topik baru
stopstring[]null≤ 4Hingga 4 string penghentian
seedintegernull—Seed untuk sampling lebih dapat direproduksi
ninteger1—Jumlah kandidat yang dihasilkan
streambooleanfalse—Streaming token via SSE
response_formatobject——Memaksa output JSON atau hasil sesuai skema
toolsarray——Deklarasi alat / fungsi yang dapat dipanggil model
tool_choicestring | objectauto—Strategi pemilihan alat atau nama alat tertentu
logprobsbooleanfalse—Mengembalikan log-probabilitas tiap token
top_logprobsintegernull0–20Jumlah probabilitas teratas per token
logit_biasmap——Pemetaan logit bias per token
userstring——Identitas pengguna akhir untuk audit risiko

Batas laju

TingkatRPMTPMRPD
Eco990398K20K
Test980393K20K

Data diperbarui: 2026-10-10 18:30

Dukungan teknisDukungan langsung
Kembali ke atas