---
title: GLM-5.1 | Runware Docs
url: https://runware.ai/docs/models/zai-glm-5-1
description: Flagship agentic coding model with 200K context, deep thinking, and long-horizon task execution
---
# GLM-5.1

GLM-5.1 is Z.ai’s flagship language model for agentic engineering, coding, reasoning, and tool-driven workflows. It supports a 200K token context window with up to 128K output tokens, deep thinking, function calling, structured output, and streaming tool calls, and is designed to stay effective over long multi-step sessions rather than only short-horizon tasks.

- **ID**: `zai:glm@5.1`
- **Status**: coming-soon
- **Creator**: Z.ai
- **Release Date**: April 7, 2026
- **Capabilities**: Text to Text

## Request Parameters

**API Options**

Platform-level options for task execution and delivery.

### [taskType](https://runware.ai/docs/models/zai-glm-5-1#request-tasktype)

- **Type**: `string`
- **Required**: true
- **Value**: `textInference`

Identifier for the type of task being performed

### [taskUUID](https://runware.ai/docs/models/zai-glm-5-1#request-taskuuid)

- **Type**: `string`
- **Required**: true
- **Format**: `UUID v4`

UUID v4 identifier for tracking tasks and matching async responses. Must be unique per task.

### [webhookURL](https://runware.ai/docs/models/zai-glm-5-1#request-webhookurl)

- **Type**: `string`
- **Format**: `URI`

Specifies a webhook URL where JSON responses will be sent via HTTP POST when generation tasks complete. For batch requests with multiple results, each completed item triggers a separate webhook call as it becomes available.

**Learn more** (1 resource):

- [Webhooks](https://runware.ai/docs/platform/webhooks) (platform)

### [deliveryMethod](https://runware.ai/docs/models/zai-glm-5-1#request-deliverymethod)

- **Type**: `string`
- **Default**: `sync`

Determines how the API delivers task results.

**Allowed values**:

- `sync` Returns complete results directly in the API response.
- `async` Returns an immediate acknowledgment with the task UUID. Poll for results using getResponse.
- `stream` Streams results token-by-token as they are generated.

**Learn more** (1 resource):

- [Task Polling](https://runware.ai/docs/platform/task-polling) (platform)

### [includeCost](https://runware.ai/docs/models/zai-glm-5-1#request-includecost)

- **Type**: `boolean`
- **Default**: `false`

Include task cost in the response.

### [includeUsage](https://runware.ai/docs/models/zai-glm-5-1#request-includeusage)

- **Type**: `boolean`
- **Default**: `false`

Include token usage statistics in the response.

### [numberResults](https://runware.ai/docs/models/zai-glm-5-1#request-numberresults)

- **Type**: `integer`
- **Min**: `1`
- **Max**: `4`
- **Default**: `1`

Number of results to generate. Each result uses a different seed, producing variations of the same parameters.

**Generation Parameters**

Core parameters for controlling the generated content.

### [model](https://runware.ai/docs/models/zai-glm-5-1#request-model)

- **Type**: `string`
- **Required**: true
- **Value**: `zai:glm@5.1`

Identifier of the model to use for generation.

**Learn more** (3 resources):

- [Text To Image: Model Selection The Foundation Of Generation](https://runware.ai/docs/guides/text-to-image#model-selection-the-foundation-of-generation) (guide)
- [Image Inpainting: Model Specialized Inpainting Models](https://runware.ai/docs/guides/image-inpainting#model-specialized-inpainting-models) (guide)
- [Image Outpainting: Other Critical Parameters](https://runware.ai/docs/guides/image-outpainting#other-critical-parameters) (guide)

### [seed](https://runware.ai/docs/models/zai-glm-5-1#request-seed)

- **Type**: `integer`
- **Min**: `0`
- **Max**: `9223372036854776000`

Random seed for reproducible generation. When not provided, a random seed is generated in the unsigned 32-bit range.

**Learn more** (1 resource):

- [Text To Image: Seed Controlling Randomness Deterministically](https://runware.ai/docs/guides/text-to-image#seed-controlling-randomness-deterministically) (guide)

### [messages](https://runware.ai/docs/models/zai-glm-5-1#request-messages)

- **Path**: `messages.role`
- **Type**: `array of objects (2 properties)`
- **Required**: true

Array of chat messages forming the conversation context.

#### [role](https://runware.ai/docs/models/zai-glm-5-1#request-messages-role)

- **Path**: `messages.role`
- **Type**: `string`
- **Required**: true

The role of the message author.

**Allowed values**: `user` `assistant`

#### [content](https://runware.ai/docs/models/zai-glm-5-1#request-messages-content)

- **Path**: `messages.content`
- **Type**: `string`
- **Required**: true
- **Min**: `1`

The text content of the message.

**Settings**

Technical parameters to fine-tune the inference process. These must be nested inside the \`settings\` object.

### [systemPrompt](https://runware.ai/docs/models/zai-glm-5-1#request-settings-systemprompt)

- **Path**: `settings.systemPrompt`
- **Type**: `string`
- **Min**: `1`
- **Max**: `200000`

System-level instruction that guides the model's behavior and output style across the entire generation.

### [temperature](https://runware.ai/docs/models/zai-glm-5-1#request-settings-temperature)

- **Path**: `settings.temperature`
- **Type**: `float`
- **Min**: `0`
- **Max**: `1`
- **Step**: `0.01`
- **Default**: `1`

Controls randomness in generation. Lower values produce more deterministic outputs, higher values increase variation and creativity.

### [topP](https://runware.ai/docs/models/zai-glm-5-1#request-settings-topp)

- **Path**: `settings.topP`
- **Type**: `float`
- **Min**: `0.01`
- **Max**: `1`
- **Step**: `0.01`

Nucleus sampling parameter that controls diversity by limiting the probability mass. Lower values make outputs more focused, higher values increase diversity.

### [frequencyPenalty](https://runware.ai/docs/models/zai-glm-5-1#request-settings-frequencypenalty)

- **Path**: `settings.frequencyPenalty`
- **Type**: `float`
- **Min**: `-2`
- **Max**: `2`
- **Step**: `0.01`

Penalizes tokens based on their frequency in the output so far. A value of 0.0 disables the penalty.

### [maxTokens](https://runware.ai/docs/models/zai-glm-5-1#request-settings-maxtokens)

- **Path**: `settings.maxTokens`
- **Type**: `integer`
- **Min**: `1`
- **Max**: `131072`
- **Default**: `4096`

Maximum number of tokens to generate in the response.

### [presencePenalty](https://runware.ai/docs/models/zai-glm-5-1#request-settings-presencepenalty)

- **Path**: `settings.presencePenalty`
- **Type**: `float`
- **Min**: `-2`
- **Max**: `2`
- **Step**: `0.01`

Encourages the model to introduce new topics. A value of 0.0 disables the penalty.

### [stopSequences](https://runware.ai/docs/models/zai-glm-5-1#request-settings-stopsequences)

- **Path**: `settings.stopSequences`
- **Type**: `array of strings`
- **Min**: `1`
- **Max**: `50`

Array of sequences that will cause the model to stop generating further tokens when encountered.

### [thinkingLevel](https://runware.ai/docs/models/zai-glm-5-1#request-settings-thinkinglevel)

- **Path**: `settings.thinkingLevel`
- **Type**: `string`
- **Default**: `none`

Controls the depth of internal reasoning the model performs before generating a response.

**Allowed values**: `none` `low` `medium` `high`

### [toolChoice](https://runware.ai/docs/models/zai-glm-5-1#request-settings-toolchoice)

- **Path**: `settings.toolChoice`
- **Type**: `object (2 properties)`

Controls how the model selects which tool to call.

#### [type](https://runware.ai/docs/models/zai-glm-5-1#request-settings-toolchoice-type)

- **Path**: `settings.toolChoice.type`
- **Type**: `string`
- **Required**: true

Tool selection strategy.

**Allowed values**:

- `auto` Model decides whether to call a tool.
- `any` Model must call at least one tool.
- `tool` Model must call the specified tool.
- `none` Model must not call any tool.

#### [name](https://runware.ai/docs/models/zai-glm-5-1#request-settings-toolchoice-name)

- **Path**: `settings.toolChoice.name`
- **Type**: `string`

Name of the tool to call.

### [tools](https://runware.ai/docs/models/zai-glm-5-1#request-settings-tools)

- **Path**: `settings.tools`
- **Type**: `array of objects`

Function definitions available for the model to call. Each tool is a JSON Schema object describing the function signature.

### [topK](https://runware.ai/docs/models/zai-glm-5-1#request-settings-topk)

- **Path**: `settings.topK`
- **Type**: `integer`
- **Min**: `1`
- **Max**: `100647`

Top-K sampling parameter that limits the number of highest-probability tokens considered at each step.

## Response Parameters

### [taskType](https://runware.ai/docs/models/zai-glm-5-1#response-tasktype)

- **Type**: `string`
- **Required**: true
- **Value**: `textInference`

Type of the task.

### [taskUUID](https://runware.ai/docs/models/zai-glm-5-1#response-taskuuid)

- **Type**: `string`
- **Required**: true
- **Format**: `UUID v4`

UUID of the task.

### [text](https://runware.ai/docs/models/zai-glm-5-1#response-text)

- **Type**: `string`
- **Required**: true

Generated text content.

### [cost](https://runware.ai/docs/models/zai-glm-5-1#response-cost)

- **Type**: `float`

Task cost in USD. Present when `includeCost` is set to `true` in the request.

### [finishReason](https://runware.ai/docs/models/zai-glm-5-1#response-finishreason)

- **Type**: `string`
- **Required**: true

The reason why the model stopped generating tokens.

**Possible values**: `stop` `length` `content_filter` `unknown`

### [usage](https://runware.ai/docs/models/zai-glm-5-1#response-usage)

- **Path**: `usage.promptTokens`
- **Type**: `object (4 properties)`
- **Required**: true

Token usage statistics for the request.

#### [promptTokens](https://runware.ai/docs/models/zai-glm-5-1#response-usage-prompttokens)

- **Path**: `usage.promptTokens`
- **Type**: `integer`
- **Required**: true
- **Min**: `0`

Number of tokens in the input prompt.

#### [completionTokens](https://runware.ai/docs/models/zai-glm-5-1#response-usage-completiontokens)

- **Path**: `usage.completionTokens`
- **Type**: `integer`
- **Required**: true
- **Min**: `0`

Number of tokens generated in the response.

#### [totalTokens](https://runware.ai/docs/models/zai-glm-5-1#response-usage-totaltokens)

- **Path**: `usage.totalTokens`
- **Type**: `integer`
- **Required**: true
- **Min**: `0`

Total number of tokens used (prompt + completion).

#### [thinkingTokens](https://runware.ai/docs/models/zai-glm-5-1#response-usage-thinkingtokens)

- **Path**: `usage.thinkingTokens`
- **Type**: `integer`
- **Min**: `0`

Number of tokens used for internal reasoning. Billed separately.