# An open-source AI just beat OpenAI's GPT-5.5 at coding (1/6th the price)

> Source: <https://docs.z.ai/guides/llm/glm-5.2>
> Published: 2026-06-18 06:40:39+00:00

## Overview

**GLM-5.2** is a flagship model built for the era of long-horizon tasks. With truly usable 1M-token context, it has been tested to handle project-scale engineering context, delivering more stable long-task execution, more reliable adherence to engineering standards, and higher success rates in development scenarios. A single task can complete the full development workflow—from requirements to deployable products across multiple platforms.

## Positioning

## Input Modalities

## Output Modalitie

## Context Length

## Maximum Output Tokens

## Capability

## Thinking Mode

## Streaming Output

## Function Call

## Context Caching

## Structured Output

## MCP

## Usage

Project-Level Codebase Takeover: Let the Model Understand an Entire Project in One Go

Project-Level Codebase Takeover: Let the Model Understand an Entire Project in One Go

**Recommended way to try it**: Choose a real business codebase, preferably one that includes backend, frontend or client-side code, configuration files, tests, documentation, and engineering conventions. First, ask the model to perform a technical audit:

Please read the current project and output a system architecture map, core module responsibilities, key API contracts, major data flows, core call chains, potential technical debt, and the engineering constraints that must be followed in future refactoring.

Long-Horizon Refactoring: Let It Run a Real Engineering Task End to End

Long-Horizon Refactoring: Let It Run a Real Engineering Task End to End

**Recommended way to try it**: Choose a medium-sized refactoring task, define clear boundaries, and enable

`/goal`

mode:Please complete the decoupling and refactoring of the current module without changing the business logic, API signatures, or runtime behavior. First provide the execution plan, impact scope, risk boundaries, and verification method. After completion, run the necessary tests and output the verification results.

Production-Grade Standards Stress Test: See Whether It Can Hold the Line on Hard Engineering Constraints

Production-Grade Standards Stress Test: See Whether It Can Hold the Line on Hard Engineering Constraints

**Recommended way to try it**: Provide the model with your team’s real engineering standards, such as lint rules, build commands, testing requirements, commit conventions, and prohibited actions in

`CLAUDE.md`

or `Agent.md`

. Then give it a real modification task:Please strictly follow the engineering standards of the current repository. Do not introduce new dependencies, do not modify API contracts, and do not commit changes proactively. After completing the modification, run the build, lint, and tests, then report the verification results and any uncovered risks.

Mobile On-Device Debugging Loop: From Code Implementation to Device Validation

Mobile On-Device Debugging Loop: From Code Implementation to Device Validation

**Recommended way to try it**: Choose a real Android or Mini Program task and let the model go from implementation to validation:

Please implement a native Android client in Kotlin that connects to the existing server-side API and supports multi-session conversations, streaming messages, voice input, notifications, and reconnection after disconnection. After completion, install it on a real device using ADB, and debug it with logcat and screenshots.

WeChat Mini Program Development: Migrating from a Web App to a WeChat Mini Program

WeChat Mini Program Development: Migrating from a Web App to a WeChat Mini Program

`wx.request`

wrapping and API-layer adaptation, authentication and login state maintenance (`wx.login`

+ custom login state), app/page/component lifecycle management, and exception handling in Mini Program development. It is suitable for testing whether the model can reorganize an existing Web page, official website, or backend capability into a runnable project that complies with Mini Program platform requirements.**Recommended way to try it**: Choose an existing Web project, specify the target technology stack — native Mini Program, Taro, or uni-app — and migrate all Web features into a Mini Program version:

Please migrate all features of the current Web project into a WeChat Mini Program. Use the [native/Taro/uni-app] technology stack. First analyze the page structure, core user paths, backend API contracts, and platform constraints, including package size limits, domain allowlists, and HTTPS requirements. Then complete the implementation of pages, components, page navigation, and data flows. After completion, explain how to run the project, which APIs have been integrated, which features remain uncovered, and what can be optimized next.

Mini Game Development: From Gameplay Rules to a Playable Loop

Mini Game Development: From Gameplay Rules to a Playable Loop

**Recommended way to try it**: Provide a complete but not overly detailed gameplay goal, and let the model first design the rules, then implement a runnable version:

Please develop a lightweight level-based mini game. First design the core gameplay loop, state machine, level structure, scoring rules, failure and settlement logic, then implement basic features including start, pause, resume, settlement, restart, and local save. After completion, explain the project structure, verified features, and possible next-step extensions.

Research Reproduction: From Paper and Data to a Runnable Engineering Project

Research Reproduction: From Paper and Data to a Runnable Engineering Project

**Recommended way to try it**: Pick a paper with a model and experiments, preferably one with open-source code or public metrics, and provide the paper and data to the model. See whether it can implement the model, run it successfully, and align the results with the paper:

Please reproduce the experiments based on this paper and dataset. Fill in implementation details not explicitly described in the paper. Use PyTorch to build the model architecture and loss functions, construct the data pipeline and training/inference scripts, and ensure the project runs successfully with consistency across multiple files. Autonomously identify and fix runtime issues, verify the paper’s metrics item by item until they are aligned, and explain the reproduction path, key changes, and any remaining gaps.

Code-to-Video Loop: From Natural-Language Ideas to a Demo-Ready Video

Code-to-Video Loop: From Natural-Language Ideas to a Demo-Ready Video

**Recommended way to try it**: Choose a real video creation task and let the model start from a single natural-language idea, then gradually produce a renderable, playable, and iterable video:

Please create a new composition in Remotion and add a map. Start from Los Angeles, zoom the camera out while keeping LA in focus. Then draw an animated route from Los Angeles to New York and have the camera follow the route. Add one more stop to the journey — this time, we are going to Paris.

## Introducing GLM-5.2

### 1M Context: Making Long-Horizon Tasks Stable and Practical

### Coding Capabilities Validated by Both Benchmarks and Developers

- Stronger project-level context capacity, enabling an entire codebase to be placed within a single reasoning workflow;
- More stable long-horizon task execution, allowing complex tasks to progress continuously without easily going off track;
- More reliable adherence to production-grade engineering standards, helping enforce hard constraints in team development workflows;
- Stronger client-side and mobile engineering capabilities, going beyond app generation to support a complete on-device debugging loop.

[↗ Blog](https://z.ai/blog/glm-5.2)

## Resources

[API Documentation](/api-reference/llm/chat-completion): Learn how to call the API.

## Quick Start

The following is a full sample code to help you onboard GLM-5.2 with ease.- cURL
- Official Python SDK
- Official Java SDK
- OpenAI Python SDK

**Basic Call**

**Streaming Call**
