GLM-5.4 API Guide: Pricing, 1M Context and Coding Agent Setup (2026)

Zhipu's Loop Transformer flagship is built for autonomous coding and long-horizon agent work. Here is the price, the context limits, and the exact code to call it.

By NovAI Team · Reviewed by the NovAI platform team · Last updated 2026-12-05

What GLM-5.4 is

GLM-5.4 is Zhipu AI's November 2026 flagship. Its Loop Transformer runs the same 28-layer stack twice, which Zhipu says reaches 2-3T-parameter-class capability at a lower serving cost. For developers the practical details are: a 1M token context window, 128K maximum output, always-on reasoning at the highest effort tier, and native vision input for coding and document tasks.

That combination targets one workload in particular: autonomous software engineering. Multi-file refactors, repo-level migrations and plan-execute-revise agent loops all need a model that can hold a large state, reason for a long time and emit a long patch. GLM-5.4 is tuned in exactly that direction.

Pricing

ItemNovAI price
Input tokens$1.25 per 1M
Output tokens$4.00 per 1M
1M input + 1M output$5.25
10M input + 2M output per month$20.50

Billing is plain token accounting: input tokens ÷ 1,000,000 × $1.25 plus output tokens ÷ 1,000,000 × $4. No cache tier is listed at launch. The transparency record documents 0% platform markup, and the pricing feed is the machine-readable source of truth.

Quickstart: OpenAI SDK

from openai import OpenAI

client = OpenAI(
    api_key="sk-your-novai-key",
    base_url="https://aiapi-pro.com/v1",
)

resp = client.chat.completions.create(
    model="glm-5.4",
    messages=[
        {"role": "system", "content": "You are a senior engineer. Think before editing."},
        {"role": "user", "content": "Refactor this module to remove duplicated error handling."},
    ],
)
print(resp.choices[0].message.content)

curl equivalent:

curl https://aiapi-pro.com/v1/chat/completions \
  -H "Authorization: Bearer $NOVAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5.4","messages":[{"role":"user","content":"Write a migration plan for this repo."}]}'

Using the 1M context well

Cost tip: an agent that reads a 60K-token repo map, reasons, and writes a 4K-token patch costs about $0.09 per edit at these prices. If you run 1,000 such edits a month that is roughly $91 - which is why routing only deep-reasoning tasks to the flagship and simpler extraction to a cheaper model matters.

GLM-5.4 vs the alternatives

GLM-5.4 sits above GLM-5.2 and GLM-5.3 in Zhipu's lineup. If you are choosing between the newest Chinese flagships, see the side-by-side comparison of GLM-5.4 vs MiniMax-M4 vs Qwen4-Max. In short: GLM-5.4 for coding agents, MiniMax-M4 for the lowest cost per token, Qwen4-Max for image and video understanding.

Older Zhipu guides on this blog: GLM-5.2 API guide.

FAQ

How much does GLM-5.4 cost?

$1.25 per 1M input tokens and $4.00 per 1M output tokens on NovAI, at provider list price with 0% platform markup.

What is the context window?

1M tokens in, 128K tokens out, with always-on reasoning and native vision input.

Can I call it with the OpenAI SDK?

Yes - set base_url to https://aiapi-pro.com/v1 and model to glm-5.4.

Do I need a Chinese phone number or card?

No. Email signup, $2 free trial, card or USDT top-up.

Try GLM-5.4 free

Sign up for $2 in free credit and call GLM-5.4 with your existing OpenAI SDK.

Start free →

Related: GLM-5.4 model page · GLM-5.4 vs MiniMax-M4 vs Qwen4-Max · MiniMax-M4 API guide · Qwen4-Max API guide · Pricing