G
Zhipu AIActive

GLM-5.2 API

Zhipu's open-weight coding flagship. A 753B-parameter MoE with 1M context and MIT weights — the strongest open-weight coding model of 2026 at $1.40/$4.40.

💰 Save up to 70% vs official Zhipu AI pricing
TL;DR
Price: $1.40/1M input · $4.40/1M output
Context: 1M · max 131,072 output
Provider: Zhipu AI
Cost advantage: Cheaper than official API · No credit card

GLM-5.2 — cheaper than the official Zhipu AI API

Access GLM-5.2 through AI API Hub and pay less per token. Same OpenAI-compatible endpoint, lower cost.

$1.40/1M
input token price
INPUT / 1M tokens
$1.40
OUTPUT / 1M tokens
$4.40
CONTEXT WINDOW
1M

Technical Specifications

ProviderZhipu AI
Model FamilyGLM-5.2
Release Date2026-06
Context Window1M
Max Output Tokens131,072
Input Price$1.40 / 1M tokens
Output Price$4.40 / 1M tokens
Vision SupportNo
Function CallingYes ✓
JSON ModeNo
StreamingYes ✓
Fine TuningAvailable
StatusActive ✓

Overview

GLM-5.2 is Zhipu AI's current glm model, released in 2026-06. Zhipu's open-weight coding flagship. A 753B-parameter MoE with 1M context and MIT weights — the strongest open-weight coding model of 2026 at $1.40/$4.40.

For developers, the headline numbers are a 1M context window and up to 131,072 output tokens per response — enough headroom for open-weight (mit) and repo-scale coding without chunking your input. Priced at $1.40/1M input and $4.40/1M output, it sits in the mid-range — a sensible default for most production workloads.

On the capability side, GLM-5.2 exposes 4 features: Code Generation, Tool Use, Bilingual, Streaming. Fine-tuning is on the table if you need to specialize behavior on your own data. It's text-only, so route image or audio workloads elsewhere.

The practical appeal of routing GLM-5.2 through AI API Hub is simplicity: one OpenAI-compatible endpoint, USDT & USDC payments, no credit card, and you're calling the API in under 30 seconds — just swap your base URL.

What Makes GLM-5.2 Different

How GLM-5.2 is used

GLM-5.2 is used for code completion, inline suggestions, test generation, and bulk refactoring. It's tuned for low-latency developer-facing workflows. For reasoning-heavy or multi-step architecture decisions, consider a reasoning-tuned sibling model.

Pricing position within Zhipu AI

GLM-5.2 is the most expensive active model from Zhipu AI at $1.40/1M input — the premium tier. The cheapest sibling costs $0.00/1M (100% less). Reserve GLM-5.2 for tasks where its capabilities justify the premium; route bulk traffic to cheaper siblings.

GLM-5.2's role in the lineup

Within Zhipu AI's lineup, GLM-5.2 is the flagship — the most capable and most expensive option. It's part of the glm family (5 active variants share this family). Use it when quality matters more than cost; switch to a cheaper sibling for high-volume or less demanding tasks.

Real-world use cases

Real-world deployments: inline code completion in IDEs, automated test generation, bulk code refactoring pipelines, and code review bots. GLM-5.2 is tuned for low-latency developer workflows where response speed matters as much as code quality.

vs sibling models

What makes GLM-5.2 different from sibling models: compared to GLM-5.1 ($0.55/1M cheaper, 128K vs 1M context (smaller)); GLM-5-Turbo ($0.70/1M cheaper, 128K vs 1M context (smaller)); GLM-4.5-Air ($1.29/1M cheaper, 128K vs 1M context (smaller)). Choose GLM-5.2 when code generation is the primary task.

API Examples

Python

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.apiyihe.org/v1"
)

response = client.chat.completions.create(
    model="glm-5.2",
    messages=[
        {"role": "user", "content": "Hello"}
    ]
)

print(response.choices[0].message.content)

JavaScript / Node.js

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.API_KEY,
  baseURL: "https://api.apiyihe.org/v1"
});

const response = await client.chat.completions.create({
  model: "glm-5.2",
  messages: [
    { role: "user", content: "Hello" }
  ]
});

console.log(response.choices[0].message.content);

cURL

curl https://api.apiyihe.org/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "glm-5.2",
    "messages": [
      {"role": "user", "content": "Hello"}
    ]
  }'

Supported Features

Vision / Image Input❌ Not Available
Audio / Voice Input❌ Not Available
Function Calling✅ Supported
JSON Mode❌ Not Available
Streaming✅ Supported
Fine-Tuning✅ Available
Multimodal❌ Not Available

Benchmark Scores

BenchmarkScore
MMLUNot Publicly Available
GPQANot Publicly Available
SWE-BenchNot Publicly Available
HumanEvalNot Publicly Available
GSM8KNot Publicly Available
MATHNot Publicly Available
MMMUNot Publicly Available
Scores are from official provider publications. Empty fields indicate benchmarks not yet publicly disclosed.

Pricing History

GLM-5.2 was released in 2026-06 by Zhipu AI and is currently publicly available via AI API Hub.

Current Pricing: $1.40 per 1M input tokens · $4.40 per 1M output tokens. Pay-as-you-go with no minimum commitment.

Pricing Model: Token-based billing (pay per use). No subscription fees. No hidden costs. Fine-tuning incurs additional costs at training and inference time.

💡 Zhipu AI occasionally updates pricing. AI API Hub reflects current pricing in real-time. All prices in USD. Pay with USDT or USDC — no currency conversion fees.

Compare Alternatives

Frequently Asked Questions

What is GLM-5.2?

GLM-5.2 is Zhipu AI's current glm model. Zhipu's open-weight coding flagship. A 753B-parameter MoE with 1M context and MIT weights — the strongest open-weight coding model of 2026 at $1.40/$4.40. It offers a 1M context window and supports Code Generation, Tool Use, Bilingual. You can access it through AI API Hub using USDT or USDC — no credit card required.

How much does GLM-5.2 cost?

GLM-5.2 is priced at $1.40 per 1M input tokens and $4.40 per 1M output tokens, billed pay-as-you-go with no minimum. Through AI API Hub you can start with as little as $5 and scale from there.

GLM-5.2 vs GPT-5.6 Sol?

They're built for different jobs. GLM-5.2 costs $1.40/1M input with a 1M window; GPT-5.6 Sol runs $5.00/1M input with 1M. GLM-5.2 is the more cost-effective pick and still brings open-weight (mit). See the full side-by-side at /compare/glm-5.2-vs-gpt-5.6-sol/.

GLM-5.2 context window?

GLM-5.2 has a 1M context window, capable of processing up to 1,048,576 tokens in a single request. Maximum output tokens: 131,072.

Does GLM-5.2 support function calling?

Yes, GLM-5.2 supports function/tool calling, allowing you to define functions that the model can invoke. This enables AI agents, API integrations, and structured data extraction.

Is GLM-5.2 multimodal?

No, GLM-5.2 is a text-only model. For multimodal use cases, consider models with vision/audio capabilities.

GLM-5.2 API rate limits?

GLM-5.2 rate limits: 5K RPM. Higher tier plans offer increased throughput. For high-volume production use, consider Zhipu AI's faster variant models.

How to access GLM-5.2 API?

Access GLM-5.2 through AI API Hub: (1) Register at api.apiyihe.org/register?aff=8JZC, (2) Deposit USDT/USDC, (3) Get your API key instantly, (4) Use the OpenAI-compatible endpoint https://api.apiyihe.org/v1 with model name "glm-5.2". Start building in under 30 seconds.

Get GLM-5.2 API Access

Pay with USDT & USDC. Same model, up to 70% less.

Crear Cuenta
Obtener Clave API