⌘K

GLM-5

glm-5

GLM-5 is Zhipu AI's fifth-generation large language model, released in February 2026. It features approximately 745 billion parameters in a Mixture-of-Experts (MoE) architecture, with 40B active parameters per token and a 200K token context window.

Authentication

authorization string required

All APIs require authentication via Bearer Token.

Get API Key:

Visit API Key Management Page to get your API Key.

Usage:

Add to request header:

Authorization: Bearer YOUR_API_KEY

Parameters

model string required

Model ID to use for the request

Value: glm-5


messages array required

Array of message objects representing the conversation history

role string required

Message role

Options: user, assistant, system, developer

content string | array required

Text string or multimodal array


max_tokens integer

Maximum tokens to generate in the completion

Range: 1 - 16384


temperature number

Sampling temperature to use

Default: 1.0

Range: 0.0 - 2.0


top_p number

Nucleus sampling parameter

Default: 1.0

Range: 0.0 - 1.0


stream boolean

Whether to stream response incrementally

Default: false


Response Format

error object

Error information, only present when status is failed

code string

Error code

message string

Detailed error message


output array

Generation results, only present when status is completed

content array

List of generated resource content

type string

Resource type

Value: image|video

url string

Processed resource URL

jobId string

Remote task ID


usage object

Usage statistics, only present when status is completed

cost string

Total cost in USD

discount number

Discount amount


metadata object

Metadata information