Seedance 2.0 | Special Offer ✦ 10% OFF NOW | Ends May 13 (UTC+0)
chatglm
z-ai/glm-5.1

z-ai/glm-5.1

202,752 context · $1.40/M input tokens · $4.40/M output tokens

GLM-5.1 delivers a major leap in coding capability, with particularly significant gains in handling long-horizon tasks. Unlike previous models built around minute-level interactions, GLM-5.1 can work independently and continuously on a single task for more than 8 hours, autonomously planning, executing, and improving itself throughout the process, ultimately delivering complete, engineering-grade results.

Pricing

Pay-per-use

No upfront costs, pay only for what you use

Input$1.40 / M Tokens
Output$4.40 / M Tokens

Try the model

z-ai/glm-5.1
Online
chatglm
Hi! I am a helpful AI assistant. What can I do for you?

API Usage

Use the following code examples to integrate with our API:

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://llm.wavespeed.ai/v1"
)

response = client.chat.completions.create(
    model="z-ai/glm-5.1",
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)

print(response.choices[0].message.content)

Info

Providerchatglm
Typellm

Supported Functionality

Input
Text
Output
Text
Context202,752
Max Output-
Vision-
Function Calling✓ Supported

API Access Guide

Base URLhttps://llm.wavespeed.ai/v1
API Endpointchat/completions
Model IDz-ai/glm-5.1

GLM 5.1 API

z-ai/glm-5.1

GLM-5.1 delivers a major leap in coding capability, with particularly significant gains in handling long-horizon tasks. Unlike previous models built around minute-level interactions, GLM-5.1 can work independently and continuously on a single task for more than 8 hours, autonomously planning, executing, and improving itself throughout the process, ultimately delivering complete, engineering-grade results.

Input

$1.4 /M

Output

$4.4 /M

Context

203K

Tool Use

Supported

Try GLM 5.1 on WaveSpeedAI

Access GLM 5.1 through our unified API — OpenAI-compatible, no cold starts, transparent pricing.

Frequently Asked Questions about GLM 5.1

How much does GLM 5.1 cost via the API?+

Pricing on WaveSpeedAI: $1.40 per million input tokens and $4.40 per million output tokens. Prompt caching and batch processing are billed separately and reduce effective cost on long, repetitive workloads.

What is the context window of GLM 5.1?+

GLM 5.1 supports up to 203K tokens of context with up to — tokens of output per request.

Is GLM 5.1 OpenAI-compatible?+

Yes. WaveSpeedAI exposes GLM 5.1 through an OpenAI-compatible endpoint at https://llm.wavespeed.ai/v1. Point the official OpenAI SDK at this base URL with your WaveSpeedAI API key — no other code changes required.

How do I get started with GLM 5.1?+

Sign in to WaveSpeedAI, create an API key in Access Keys, then send a request to https://llm.wavespeed.ai/v1/chat/completions with model id set to the value shown above. New accounts receive free credits to evaluate GLM 5.1 before paying per token.

Related LLM APIs