Models

glm-5.2 — API, Pricing & Context Window | Vivgrid

glm-5.2 on Vivgrid: Zhipu AI's coding model with a 1M-token context window, function calling, and competitive pricing.

glm-5.2 is Zhipu AI's latest coding and reasoning model, pairing reliable function calling with a major upgrade: a 1M-token context window, up from 200K in glm-5.1. It's a strong, low-cost option for agentic coding workloads that need to reason over large codebases.

On Vivgrid, glm-5.2 is reachable through the unified, OpenAI-compatible endpoint, so it integrates cleanly alongside models from OpenAI, Anthropic, Google, and DeepSeek under one API key.

Specifications

ProviderZhipu AI
Model IDglm-5.2
Best forCoding
Available onVibe coding
Context window1,000,000 tokens
Max output128,000 tokens
ModalitiesText
Tool / function callingYes
Knowledge cutoff2026-06
Acceleration🌐 Global (Centralized)

Pricing

Pricing in USD per 1M tokens, matching the provider's rates.

InputCached inputOutput
$1.20$0.30$4.20

What one request costs

The rates above applied to a 20K-token prompt with a 2K-token reply — a typical single agent turn, small enough that every request is billed at the base rate.

RequestCost
Cold prompt, nothing cached$0.0324
Warm prompt, 90% of the input served from cache$0.0162

API surfaces

The Vivgrid Console catalogs glm-5.2 on one surface, all behind the same API key. The endpoint shown is the one the Console previews for that surface.

SurfacePrimary endpointUse it for
Vibe coding/chat/completionsCoding CLIs and IDE agents that drive the model themselves — point the tool at Vivgrid and keep your own loop.

Quick start

Get an API key from the Vivgrid Console, then call glm-5.2 directly.

curl https://api.vivgrid.com/v1/chat/completions \
  -H "Authorization: Bearer $VIVGRID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.2",
    "messages": [
      { "role": "user", "content": "Say hello in English, Chinese and Spanish." }
    ],
    "stream": true
  }'

Ideal use cases

  • Cost-effective coding agents and CLIs
  • Whole-repository reasoning within a 1M-token context
  • Tool-calling workflows on Chat Completions
  • Teams diversifying beyond US-based providers

On this page