GLM-5 API

zhipu/glm-5
Designed to power modern AI products, GLM-5 API delivers strong performance across text generation, structured outputs, and code understanding.
Context
200K tokens
Input
$1.3 / 1M tokens
Output
$4.16 / 1M tokens
Released
Feb 12, 2026

Overview

What Is GLM-5?

GLM-5 is an advanced LLM developed to support complex reasoning, long-context understanding, and multilingual text generation. It combines deep semantic comprehension with strong instruction following, enabling developers to build reliable AI assistants, automation workflows, coding copilots, and knowledge systems. The model is optimized for both conversational AI and structured outputs, making it suitable for chat interfaces, data extraction pipelines, agentic systems, and enterprise integrations.

Performance and Reliability

GLM-5 is optimized for stable inference and predictable behavior in production environments. It demonstrates strong instruction adherence, reduced hallucination patterns compared to earlier-generation models, and improved contextual retention in extended conversations.

GLM-5 API Pricing

  • Input: $1.3 per 1M tokens
  • Output: $4.16 per 1M tokens

Key Capabilities

Advanced Reasoning and Structured Output

GLM-5 is built to handle analytical tasks, multi-step reasoning, and structured data generation. It can reliably produce JSON outputs, formatted reports, and schema-aligned responses, making it ideal for backend integrations and automation tools.

Long Context Understanding

GLM-5 supports extended context windows, allowing it to process large documents, maintain conversation continuity, and reason over complex multi-paragraph inputs. This makes it well-suited for research assistants, legal document analysis, and enterprise knowledge management systems.

Code Generation and Technical Tasks

GLM-5 performs effectively in code completion, debugging assistance, and technical documentation generation. It supports modern programming workflows and can be integrated into developer tools, CI/CD pipelines, and AI-powered IDE assistants.

Use Cases for GLM-5

AI-Driven Content Generation

Create high-quality blog posts, technical documentation, marketing copy, and multilingual content with strong consistency and structure.

Intelligent Data Processing

Leverage structured output capabilities for data extraction, document parsing, and transformation into machine-readable formats.

Developer and Coding Copilots

Integrate GLM-5 into engineering workflows to accelerate development, improve code quality, and streamline debugging processes.

Agentic Workflows and Automation

Use GLM-5 as the reasoning core for AI agents that perform multi-step tasks, decision-making operations, and contextual execution flows.

Uptime and performance

  • Uptime (7d): 100%

Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.

Use cases

GLM-5 is documented as suited to complex systems engineering and long-horizon agentic tasks. It is also described as strong for real-world coding and end-to-end software development tasks.

The model is documented for building agentic applications that use native tool calling, function execution, and long-horizon task planning. It is also suited to office workflows that require stable completion of complex, multi-step tasks across stages.

GLM-5 is documented for roleplay, with support for maintaining character settings consistently over time. It is also documented for text data extraction from complex documents such as contracts, announcements, and financial reports.

How to use GLM-5 API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to zhipu/glm-5.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "zhipu/glm-5",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "zhipu/glm-5",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/chat/completions \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"zhipu/glm-5","messages":[{"role":"user","content":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

GLM-5 API Pricing

TypePrice
Input
$1.3 / 1M tokens
Output
$4.16 / 1M tokens
Cached input
$0.26 / 1M tokens

GLM-5 Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
Intelligence
27.9
Composite score across standardised reasoning, knowledge and problem-solving evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026

GLM-5 vs other models

ModelInputOutputContextBest for
GLM-5
This page
$1.3 / 1M tokens
$4.16 / 1M tokens
200K tokens
Coding + agents
$6.5 / 1M tokens
$39 / 1M tokens
1M tokens
Reasoning + agents
$2.6 / 1M tokens
$13 / 1M tokens
1M tokens
Balanced coding + agents
$3.9 / 1M tokens
$19.5 / 1M tokens
1M tokens
Long-context, multimodal & agentic workflows
$1.95 / 1M tokens
$11.7 / 1M tokens
1M tokens
Reasoning + agents

Frequently asked questions

GLM-5 has a 200,000 tokens context window and can return up to 128,000 tokens.

GLM-5 takes text as input and returns text.

Use zhipu/glm-5 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

GLM-5 became available on February 12, 2026.

GLM-5 is priced at input $1.3 / 1M tokens, output $4.16 / 1M tokens, cached input $0.26 / 1M tokens.

Yes, GLM-5 can stream responses as they are generated.

GLM-5 was built by Zhipu AI.

GLM-5 is a 745B parameter mixture-of-experts (MoE) model.

Start building with GLM-5

Get API Key
1000+ models, one API.