Route requests to
GLM-4.6
with Merge Gateway

Apply your own routing policies, reduce token costs automatically, and see every routing decision in real time with Merge Gateway.

What GLM-4.6 costs to run

| Vendor | Input / 1M tokens | Output / 1M tokens | Zero data retention | | --- | ---: | ---: | --- | | Z.AI | $0.6000 | $2.20 | No |

Test GLM-4.6
with Gateway’s Simulator

See a prompt's output, token spend, latency, and more with GLM-4.6.

Route requests to GLM-4.6 in minutes

To get started in seconds, add our Gateway Implementation skill to your project, or pick your preferred SDK below. Check out our other quick start skills here.
Install the Merge Gateway SDK
Python
Copied!
1$ pip install merge-gateway-sdk
Send a request
Python
Copied!
1from merge_gateway import MergeGateway
2
3client = MergeGateway(api_key="YOUR_API_KEY")
4
5response = client.responses.create(
6    model="openai/gpt-5.2",
7    input=[
8        {"type": "message", "role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
9        {"type": "message", "role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
10    ],
11)
12
13print(response.output[0].content[0].text)
Try a diffrent model
Swap the model string to route to a different provider. No other code changes needed.
Anthropic
Copied!
1response = client.responses.create(
2    model="anthropic/claude-sonnet-4-20250514",
3    input=[
4        {"type": "message", "role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
5        {"type": "message", "role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
6    ],
7)
Point to Gateway
Python
Copied!
1from openai import OpenAI
2
3client = OpenAI(
4    api_key="YOUR_API_KEY",
5    base_url="https://api-gateway.merge.dev/v1/openai",
6)
Send a request
Use the standard chat.completions.create method. No provider prefix needed on the model name.
Python
Copied!
1response = client.chat.completions.create(
2    model="gpt-5.2",
3    messages=[
4        {"role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
5        {"role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
6    ],
7)
8
9print(response.choices[0].message.content)
Install packages
Copied!
1npm install merge-gateway-ai-sdk-provider ai
Create the provider
TypeScript
Copied!
1import { createMergeGateway } from "merge-gateway-ai-sdk-provider";
2
3const gateway = createMergeGateway({
4  apiKey: "YOUR_API_KEY",
5});
Send a request
Use generateText to send a request. Model names use the provider/model format.
TypeScript
Copied!
1import { generateText } from "ai";
2
3const { text } = await generateText({
4  model: gateway("openai/gpt-4o"),
5  prompt: "Explain the concept of recursion in programming with a simple set of examples.",
6});
7
8console.log(text);
If you already have @ai-sdk/openai installed, point it at Gateway with a base URL change:
TypeScript
Copied!
1import { createOpenAI } from "@ai-sdk/openai";
2
3const gateway = createOpenAI({
4  apiKey: "YOUR_API_KEY",
5  baseURL: "https://api-gateway.merge.dev/v1/ai-sdk",
6});
7
8// All generateText/streamText calls work unchanged
Install the Merge Gateway SDK
Anthropic SDK
Copied!
1from anthropic import Anthropic
2
3client = Anthropic(
4    api_key="YOUR_API_KEY",
5    base_url="https://api-gateway.merge.dev/v1/anthropic",
6)
7
8message = client.messages.create(
9    model="claude-sonnet-4-20250514",
10    max_tokens=1024,
11    messages=[
12        {"role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
13    ],
14)
15
16print(message.content[0].text)

Explore other models available in Merge Gateway

model logo
Amazon Nova 2 Lite
model logo
Amazon Nova 2 Sonic
model logo
Amazon Nova Lite
model logo
Amazon Nova Micro
model logo
Amazon Nova Premier
model logo
Amazon Nova Pro
model logo
Claude 3.7 Sonnet
model logo
Claude Haiku 4.5 (20251001)
model logo
Claude Opus 4.6
model logo
Claude Opus 4.7
model logo
Claude Opus 4.8
model logo
Claude Sonnet 4.5
model logo
Claude Sonnet 4.6
model logo
Claude Sonnet 5
model logo
Codestral
model logo
Codestral 25.08
model logo
Command R 08-2024
model logo
Command R+ 08-2024
model logo
Command R7B 12-2024
model logo
DeepSeek R1
model logo
DeepSeek V3
model logo
DeepSeek V3.2
model logo
DeepSeek V4 Flash
model logo
DeepSeek V4 Pro

GLM-4.6 FAQ

Have more questions about GLM-4.6? We've answered a few more below. Note that this was written in June, 2026 and is subject to change.

Heading

What other models does Zhipu AI (Z.AI) offer?

Zhipu AI's GLM family spans cost-efficient general-purpose models, mid-tier non-reasoning options, and large-scale reasoning flagships suited for complex inference workloads. Here are some other models Zhipu AI supports:

  • GLM-4.5 Air: The most cost-efficient model in the GLM lineup, priced at $0.17 per 1M input tokens and $0.98 per 1M output tokens with a 128k token context window. It is designed for high-volume, budget-constrained deployments where peak accuracy is not the primary requirement
  • GLM-4.5: A mid-range general-purpose model suited for instruction-following, summarization, and text generation tasks. It sits below the GLM-4.6 and GLM-4.7 tiers in capability, making it a practical option for teams that do not need extended context or reasoning output
  • GLM-4.7 Flash: A reasoning-capable model with a 200k token context window and a blended rate of approximately $0.10 per 1M tokens, making it the lowest-cost entry point for chain-of-thought workloads in the GLM family. It generates output at 101.6 tokens per second on Artificial Analysis
  • GLM-4.7: Zhipu AI's reasoning-focused model sharing the same 200k token context window and 357 billion parameter MoE architecture as GLM-4.6, but with extended chain-of-thought capability for tasks requiring multi-step logic
  • GLM-5: A large-scale reasoning flagship scoring 50 out of 100 on the Artificial Analysis Intelligence Index, ranked #6 of 88 tracked reasoning models. Priced at $1.00 per 1M input tokens and $3.20 per 1M output tokens, it targets workloads where top-tier accuracy is worth the premium

How does GLM-4.6 differ from Zhipu AI's other models?

GLM-4.6 is Zhipu AI's non-reasoning general-purpose model, occupying the middle tier of the GLM lineup between the lightweight GLM-4.5 models and the reasoning-focused GLM-4.7 and GLM-5 series.

  • Intelligence ranking: GLM-4.6 achieves an Intelligence Index score of 30 out of 100 on Artificial Analysis, ranked #30 of 43 comparable open-weight non-reasoning models. This places it above the median intelligence score for its class, though well below the reasoning-capable GLM-4.7, which scores 42 and ranks #16 of 88 models
  • Pricing: GLM-4.6 is priced at $0.60 per 1M input tokens and $2.20 per 1M output tokens, with a blended rate of $0.76 per 1M tokens. This is significantly more expensive than GLM-4.7 Flash at approximately $0.10 blended, and moderately cheaper than GLM-5 at $1.00 input and $3.20 output
  • Context window: GLM-4.6 supports a 200k token context window, the same as GLM-4.7, GLM-4.7 Flash, and the GLM-5 series. This is a meaningful advantage over GLM-4.5 Air's 128k window for long-document or multi-turn workloads
  • Speed: GLM-4.6 generates 49.0 output tokens per second, which is below the median of 53 tokens per second for comparable models on Artificial Analysis. GLM-4.7 runs considerably faster at 89.3 tokens per second despite being the reasoning variant
  • Reasoning capability: GLM-4.6 is a non-reasoning model that produces direct responses without chain-of-thought output. GLM-4.7 and GLM-5 both support extended reasoning, making them better fits for tasks that require traceable multi-step logic

GLM-4.6 is best suited for teams that need a large-context, open-weight model from Zhipu AI for general-purpose text tasks, and where reasoning output and peak benchmark scores are less important than the 200k context window and MIT-licensed weights.

What models should I consider using alongside GLM-4.6?

No single model is optimal for every task. Here are models worth pairing with GLM-4.6 depending on what your product needs:

  • GLM-4.7 when a request requires multi-step reasoning or complex logical chains. The reasoning variant shares the same 200k context window and architecture, making it a natural escalation path within the Zhipu AI family for tasks GLM-4.6 is not optimized for
  • GLM-4.5 Air for high-volume, simple tasks where cost is the primary constraint. At a blended rate far below GLM-4.6, routing straightforward classification, extraction, or summarization requests there preserves budget for queries that genuinely benefit from GLM-4.6's larger context
  • Claude Sonnet 4.5 for instruction-following-heavy workloads where output consistency and format adherence under varied prompts are critical. It complements GLM-4.6 well in multi-provider pipelines where reliability benchmarks from a major Western provider matter
  • Gemini 2.0 Flash for high-throughput, latency-sensitive requests where tokens-per-second output speed matters most. Its combination of fast generation and low cost per token makes it a strong complement to GLM-4.6 for burst traffic and real-time streaming tasks
  • GPT-4o mini for short-form generation, lightweight tagging, or extraction tasks where OpenAI SDK compatibility is a requirement. It pairs cleanly with GLM-4.6 in a routing setup where the policy directs heavier workloads to GLM-4.6 and simpler ones elsewhere

What are the challenges of using GLM-4.6 in my product?

Like any production LLM, GLM-4.6 comes with tradeoffs worth planning for:

  • Cost relative to capability: Artificial Analysis notes that GLM-4.6 is "particularly expensive when comparing to other open weight non-reasoning models" at $0.60 per 1M input tokens and $2.20 per 1M output tokens. Several non-reasoning models at a similar intelligence tier are available at meaningfully lower blended costs
  • Below-average speed: At 49.0 tokens per second, GLM-4.6 generates output more slowly than the median for its model class. Streaming applications or latency-sensitive user interfaces may find this throughput insufficient at typical prompt lengths
  • Provider dependency: Routing all requests through Zhipu AI as a single provider creates fragility when the provider has an outage or deprecates a model version. Zhipu AI releases new GLM checkpoints frequently, and relying on GLM-4.6 without a fallback path adds operational risk
  • Cost at scale: Output costs of $2.20 per 1M tokens compound quickly at high request volumes. Without active cost governance and routing logic to redirect simpler requests to lower-cost models, monthly spend can escalate faster than anticipated
  • English-language support ecosystem: Zhipu AI's documentation, SDKs, and community resources are less comprehensive in English than those of OpenAI or Anthropic. Teams building primarily for English-language markets may encounter gaps in troubleshooting and integration guidance

Why should I use Merge Gateway to route LLM requests with GLM-4.6 and every other model?

Using GLM-4.6 through Merge Gateway gives you access to the model itself and the infrastructure layer around it:

  • Cost governance: Set hard or soft project budgets so GLM-4.6 spend stays within plan. Every request is attributed to a model, project, and tag in a unified billing dashboard across all providers, which is especially useful given GLM-4.6's above-average cost relative to comparable non-reasoning models
  • One API, every provider: Access GLM-4.6 and every other major LLM through a single endpoint and API key. Change providers by swapping the model string—no application code changes required
  • Intelligent routing and automatic failover: Merge routes around Zhipu AI outages automatically. Routing policies based on cost, latency, or quality can reduce spend by 40–60% without touching your application code
  • Build Your Own Router: Define what "best" means for your traffic by selecting from curated ML benchmarks or adding your own eval scores. The router scores each available model against your weights and picks the winner per request, with a plain-language explanation of every decision
  • Security and compliance controls: Apply DLP rules and prompt injection protection before every request reaches Zhipu AI. Enforce per-project model and region policies without adding that logic to your application

How can I start routing requests to GLM-4.6 via Merge Gateway?

Getting GLM-4.6 running through Merge Gateway takes a few minutes:

1. Create an account and get your API key from the dashboard.

2. Install the Merge Gateway SDK: run pip install merge-gateway-sdk (Python) or npm install merge-gateway-sdk (Node). Alternatively, if you're already using the OpenAI SDK, set base_url = "https://api-gateway.merge.dev/v1/openai" and your existing code works as-is.

3. Make your first request using the provider/model format. For GLM-4.6, the model string is zhipu/glm-4.6. Swap the model string to route to any other provider without changing anything else.

4. Configure a routing policy in the dashboard to set failover behavior, cost limits, and optimization strategy. Your first policy can be as simple as naming GLM-4.6 as primary with one fallback.

Full setup instructions and SDK references are in the Merge Gateway docs.

Try GLM-4.6 through Merge Gateway

Route, observe, and control AI requests across providers from one API.