Direct
Direct upstream connection — best when you need native behavior and the full context window.
| Input | Output | Cache read |
|---|---|---|
| 1.18/M | 4.12/M | 0.29/M |

GLM-5.2GLM 5.2 is Z.ai's large-scale reasoning model. It supports text input and output with a 1M token context window, suitable for long-horizon agent workflows, project-level software engineering, and complex multi-step automation. Supports reasoning effort high and xhigh; xhigh maps to maximum reasoning. It is particularly adept at coding and tool use across long-running tasks, capable of maintaining engineering environments within a single task and consistently following standards throughout the entire development workflow (from requirements to multi-platform deployment).
The same model is available through multiple service channels — choose based on latency, reliability and cost.
Prices in $ / 1M tokensprovider field to the request body, for example "provider": { "channel": "direct" }. Valid values are direct / stable / economical; omit it to use the default channel.Direct upstream connection — best when you need native behavior and the full context window.
| Input | Output | Cache read |
|---|---|---|
| 1.18/M | 4.12/M | 0.29/M |
GLM-5.2 is a large-scale reasoning model released and open-sourced by Zhipu (Z.ai) in June 2026, under the MIT license. It supports a 1 million token context window, focusing on long-horizon agentic workflows, project-level software engineering, and complex multi-step automation.
On mainstream coding benchmarks, GLM-5.2 maintains open-source SOTA status, sitting in a comparable range with Claude Opus 4.8—trailing Opus 4.8 by only a few percentage points on Terminal-Bench 2.1, and surpassing Gemini 3.1 Pro. In three long-context benchmarks, it ranks first among open-source models.
SeaWhale AI provides GLM-5.2 via an OpenAI-compatible interface, with support for tool calling, reasoning effort control, and streaming output.
Get an API Key · Model ID:
GLM-5.2
high and xhigh reasoning effort — xhigh maps to maximum reasoning depthGLM-5.2 excels at coding and tool use across long-running tasks. Compared with the previous generation GLM-5.1, it has improved significantly in frontend, backend, and long-horizon task development scenarios, with greater stability in complex systems engineering and debugging.
A 1 million token context lets the model read at once long texts of millions of characters, complex PDFs of hundreds of pages, or an entire medium-to-large software code repository; it ranks first among open-source models in three long-context benchmarks.
GLM-5.2 can maintain the engineering environment in a single task and stay consistent throughout the entire development process, making it suitable for agentic scenarios that require long periods of autonomous execution.
The MIT license means free commercial use, further development, and private deployment. For scenarios with sensitive data or a need for full autonomy and control, this is an option closed-source models cannot provide.
| Scenario | Description |
|---|---|
| Project-level coding | Full frontend/backend feature development and systems engineering |
| Long-context analysis | One-shot processing of entire code repositories and hundreds of pages of PDFs |
| Long-horizon agents | Automated workflows that require long-term state maintenance |
| Complex debugging | Cross-module long-chain issue localization |
| Domestic substitution | Enterprise deployment requiring autonomy and control |
| Cost optimization | Cost advantages from an open-source model |
| Capability | GLM-5.2 | GLM-5.1 | Claude Opus 4.8 |
|---|---|---|---|
| Model ID | GLM-5.2 |
GLM-5.1 |
claude-opus-4-8 |
| Context window | 1M tokens | 130K tokens | 1M tokens |
| Max output | 128K tokens | 131K tokens | 128K tokens |
| Open-source license | MIT | MIT | Closed-source |
| Coding benchmarks | Open-source SOTA, close to Opus 4.8 | Open-source leader | Frontier |
| Reasoning effort | high / xhigh | Supported | low → max |
Actual billing is subject to the real-time price card at the top of the page.
1. Create a SeaWhale AI API Key Generate a key in the console and top up your balance.
2. Use xhigh reasoning effort for long tasks
GLM-5.2 supports two levels, high and xhigh; xhigh maps to the maximum reasoning depth and is recommended for complex engineering tasks.
3. Call the API
curl -X POST https://api.atalk-ai.com/v1/chat/completions \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "GLM-5.2",
"messages": [
{"role": "user", "content": "Read all the code in this repository, design an extensible plugin mechanism, and provide an implementation."}
],
"stream": true
}'
When was GLM-5.2 released? It was first made available to GLM Coding Plan users in mid-June 2026, then released via API and open-sourced under the MIT license.
How far is it from Claude Opus 4.8? On mainstream coding benchmarks it is in a comparable range, trailing by a few percentage points on Terminal-Bench 2.1 and surpassing Gemini 3.1 Pro. It ranks first among open-source models in long-context benchmarks.
What improvements does it bring over GLM-5.1? The context window expanded from 130K to 1 million tokens, with significantly improved success rates in frontend, backend, and long-horizon task development, and greater stability in complex systems engineering and debugging.
Are there restrictions in the open-source license? It is under the MIT license, allowing free commercial use, modification, and private deployment; it is one of the most permissive open-source licenses.
Can the full 1 million context be used? Yes. GLM-5.2 ranks first among open-source models in three long-context benchmarks, and performs stably in real-world long-document and large-repository scenarios.
Does it support tool calling? Yes. Function calling, streaming output, and reasoning effort control are all available.
GLM-5.2https://api.atalk-ai.com/v2/"provider": { "channel": "direct" }SeaWhale AI is compatible with the OpenAI API protocol, so you can call it with the OpenAI SDK or plain HTTP requests. Streaming is enabled by default.
About the provider parameter (optional, a SeaWhale AI extension): most models are served over several channels that differ slightly in price and reliability. Add a provider field to the request body to pick one; omit it and the system selects the default channel — normal calls are unaffected.
provideris not part of the official OpenAI protocol — it is a SeaWhale AI extension that only takes effect on this platform. The OpenAI SDK allows custom fields like this to pass through; see the examples below.
| Value | Channel | Best for |
|---|---|---|
direct | Direct | The official upstream link, for native behavior and the full context window |
stable | Preferred | Balanced availability and speed — a good default for production traffic |
economical | Economy | Cost first, well suited to batch processing and price-sensitive workloads |
Available channels and their prices are listed under "Pricing" above (channels vary by model). Additional notes:
"provider": { "channel": "direct" }.extra_body; in Node.js put it directly on the request object and it passes through. In TypeScript projects, add a // @ts-expect-error line to skip the type check.curl https://api.atalk-ai.com/v2/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "GLM-5.2",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"provider": { "channel": "direct" },
"stream": true
}'
# provider is optional — remove this line to use the default channelfrom openai import OpenAI
client = OpenAI(
base_url="https://api.atalk-ai.com/v2",
api_key="<API_KEY>",
)
stream = client.chat.completions.create(
model="GLM-5.2",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"},
],
stream=True,
# Optional: pick a service channel; omit to use the default
extra_body={"provider": {"channel": "direct"}},
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://api.atalk-ai.com/v2',
apiKey: '<API_KEY>',
})
const stream = await client.chat.completions.create({
model: 'GLM-5.2',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Hello!' },
],
stream: true,
// Optional: pick a service channel; omit to use the default
// @ts-expect-error provider is a SeaWhale AI extension, not in the OpenAI SDK types
provider: { channel: 'direct' },
})
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '')
}