Route requests to
GLM-4.7
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.7 costs to run

| Vendor | Input / 1M tokens | Output / 1M tokens | Zero data retention | | --- | ---: | ---: | --- | | Parasail | $0.4500 | $2.10 | Yes |

Test GLM-4.7
with Gateway’s Simulator

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

Route requests to GLM-4.7 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.7 FAQ

For anyone with more questions about GLM-4.7, we've covered a few more below. The details here reflect what was known in June, 2026 and are subject to change.

Heading

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

Zhipu AI's GLM family covers a range of tiers from lightweight, low-cost models to high-intelligence reasoning flagships. 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 deployments where budget is the primary constraint and peak accuracy is not required
  • GLM-4.5: A mid-range, general-purpose non-reasoning model suited for instruction-following, summarization, and text generation. It occupies a tier below GLM-4.7 in both reasoning capability and context length, making it a practical choice for teams with straightforward workloads
  • GLM-4.6: A non-reasoning model sharing the same 200k token context window and 357 billion parameter MoE architecture as GLM-4.7, but without chain-of-thought capability. It is priced at $0.60 per 1M input tokens and $2.20 per 1M output tokens, and is well-suited for general-purpose text tasks where reasoning output is unnecessary
  • GLM-4.7 Flash: A reasoning-capable model with the same 200k token context window as GLM-4.7 but at a significantly lower blended rate of approximately $0.10 per 1M tokens. It outputs 101.6 tokens per second and serves as the cost-efficient entry point for chain-of-thought workloads in the GLM family
  • GLM-5: Zhipu AI's large-scale reasoning flagship, scoring 50 out of 100 on the Artificial Analysis Intelligence Index and ranking #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 maximum reasoning depth is the priority

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

GLM-4.7 is Zhipu AI's mid-tier reasoning model, positioned above the non-reasoning GLM-4.6 and the cost-optimized GLM-4.7 Flash, but below the flagship GLM-5 in terms of raw intelligence benchmarks.

  • Intelligence ranking: GLM-4.7 achieves an Intelligence Index score of 42 out of 100 on Artificial Analysis, ranked #16 of 88 comparable reasoning models. GLM-5 scores 50 and ranks #6, while GLM-4.7 Flash scores 30 and GLM-4.6 scores 30 among non-reasoning models
  • Reasoning capability: GLM-4.7 includes extended chain-of-thought reasoning, which GLM-4.6 and GLM-4.5 models do not. This makes it suitable for multi-step logical inference, mathematical derivations, and tasks where traceable reasoning steps are required
  • Pricing: GLM-4.7 is priced at $0.60 per 1M input tokens and $2.20 per 1M output tokens, with a blended rate of $0.71 per 1M tokens. This is substantially cheaper than GLM-5 at $1.00 input and $3.20 output, and dramatically higher than GLM-4.7 Flash at approximately $0.07 per 1M input tokens
  • Speed: GLM-4.7 generates 89.3 output tokens per second, ranking #18 of 88 models on Artificial Analysis. This is considerably faster than GLM-4.6 at 49.0 tokens per second and GLM-5 at 84.2 tokens per second, making GLM-4.7 the fastest reasoning-capable model in the current GLM lineup
  • Context window: GLM-4.7 supports a 200k token context window, the same as GLM-4.6, GLM-4.7 Flash, and the GLM-5 series. All three tiers share this input capacity advantage over the 128k-window GLM-4.5 models
  • Verbosity: GLM-4.7 generates 170M output tokens during Artificial Analysis evaluation, which is notably high compared to peer reasoning models. This verbosity can increase per-request output costs and may affect latency in streaming applications

GLM-4.7 is the right choice within the Zhipu AI lineup when reasoning capability is required but GLM-5-level accuracy is not, and when output speed is a meaningful constraint alongside the need for chain-of-thought inference.

What models should I consider using alongside GLM-4.7?

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

  • GLM-4.7 Flash for routing lower-complexity reasoning requests within the Zhipu AI family. At a blended rate of approximately $0.10 per 1M tokens, it handles simpler chain-of-thought tasks at a small fraction of GLM-4.7's cost, freeing budget for requests that need GLM-4.7's stronger reasoning depth
  • GLM-5 when requests require the highest accuracy the Zhipu AI family can provide. For complex scientific reasoning, multi-step code generation, or tasks where GLM-4.7's Intelligence Index score of 42 is insufficient, GLM-5 at 50 on the same index provides a meaningful step up
  • Claude Sonnet 4.5 for structured output generation, long multi-turn conversations, and workloads where format reliability across a wide range of prompts is critical. It pairs well with GLM-4.7 in a multi-provider routing setup for teams that need both reasoning depth and predictable output structure
  • Gemini 2.0 Flash for burst-traffic workloads where per-request latency matters more than reasoning depth. Its high tokens-per-second output and low cost per token make it a practical overflow destination when GLM-4.7's capacity or response time does not meet throughput targets
  • GPT-4o mini for lightweight, classification, tagging, or extraction tasks where neither reasoning depth nor large context is required. Routing these to GPT-4o mini preserves GLM-4.7 capacity for requests that actually require chain-of-thought output

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

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

  • High verbosity: Artificial Analysis evaluation shows GLM-4.7 generating 170M output tokens, which is notably high relative to peer reasoning models. This verbosity raises per-request output costs and can increase response latency in applications that stream or post-process model output
  • Provider dependency: Relying on Zhipu AI as a single provider creates fragility when the provider has an outage or deprecates a model version. GLM-4.7 is one of several reasoning checkpoints in the GLM lineup, and Zhipu AI may move production users toward newer releases without extended deprecation windows
  • Cost at scale: At $2.20 per 1M output tokens, costs compound quickly as request volume and average response verbosity both increase. Without active budget controls and routing logic to redirect simpler requests to GLM-4.7 Flash or GLM-4.6, monthly spend can escalate unpredictably
  • No multimodal input: GLM-4.7 is a text-only model. Workloads that require image, audio, or document understanding must route to a multimodal model, adding pipeline complexity for teams that also need GLM-4.7's reasoning capability
  • English-language ecosystem: Zhipu AI's documentation and community support are primarily oriented toward Chinese-language markets. Teams building English-first products may find integration guidance, error debugging, and SDK tooling less mature than with major Western providers

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

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

  • One API, every provider: Access GLM-4.7 and every other major LLM through a single endpoint and API key. Change providers by swapping the model string — no application code changes required
  • 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 — particularly useful for tuning when to escalate from GLM-4.7 Flash to GLM-4.7
  • 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
  • Cost governance: Set hard or soft project budgets so GLM-4.7 spend stays within plan. Every request is attributed to a model, project, and tag in a unified billing dashboard across all providers
  • 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.7 via Merge Gateway?

Getting GLM-4.7 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.7, the model string is zhipu/glm-4.7. 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.7 as primary with one fallback.

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

Try GLM-4.7 through Merge Gateway

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