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

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

Test GLM-4.7 FlashX
with Gateway’s Simulator

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

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

In case you have any other questions on GLM-4.7-Flash, we've answered a few more below. It's worth noting that the information below was written in June, 2026 and is subject to change.

Heading

What other models does Zhipu AI offer?

Zhipu AI (marketed as Z.ai) is a Chinese AI company that publishes both open-weight and proprietary models under the GLM family, spanning reasoning and non-reasoning variants across several size classes. Here are some other models Zhipu AI supports:

  • GLM-5.1: Zhipu AI's most capable open-weight reasoning model, released April 2026, it uses a Mixture of Experts architecture with 744 billion total parameters and 40 billion active, scores 51 on the Artificial Analysis Intelligence Index, supports a 200K token context window, and runs at approximately 78.8 tokens per second, priced at $1.40 per million input tokens and $4.40 per million output tokens
  • GLM-5-Turbo: A proprietary reasoning model released March 2026, it scores 47 on the Artificial Analysis Intelligence Index, offers a 200K token context window, and is listed at $0.00 per million tokens on Artificial Analysis, making it effectively free at that point in time. It uses extended thinking and is text-only
  • GLM-5V Turbo: The multimodal variant in Zhipu AI's GLM-5 generation, it scores 43 on the Artificial Analysis Intelligence Index with a 200K token context window, adding image input capability that the text-only GLM-5-Turbo lacks

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

GLM-4.7-Flash is Zhipu AI's open-weight efficiency-tier reasoning model from January 2026, positioned below the GLM-5 generation in both intelligence and cost, and notable for its Mixture of Experts architecture that keeps active parameter count well below total parameter count.

  • Architecture and parameters: GLM-4.7-Flash has 31.2 billion total parameters but only 3 billion active per forward pass due to its MoE design. This makes inference meaningfully cheaper than a dense 31B model, contrasting with GLM-5.1 which activates 40 billion parameters from a 744 billion total count
  • Intelligence Index ranking: Scoring 30 on the Artificial Analysis Intelligence Index and ranking 14th out of 126 comparable models, it is described as well above average among open-weight models in its size class. GLM-5.1 scores 51 and GLM-5-Turbo scores 47, placing the newer generation substantially higher
  • Pricing: At $0.07 per million input tokens and $0.40 per million output tokens, it is priced as an efficiency option relative to GLM-5.1 at $1.40 input/$4.40 output. The output-heavy pricing structure means generation-intensive workloads cost more than the input price alone suggests
  • Context window: All Zhipu AI models evaluated by Artificial Analysis share a 200K token context window, so there is no differentiation on context length within the GLM family at this tier
  • Capabilities: GLM-4.7-Flash is a reasoning model with extended thinking support and text-only input and output. It does not support image, video, or speech inputs, unlike GLM-5V Turbo which adds image input. Its open-weight status under MIT licensing means weights can be downloaded and self-hosted.

GLM-4.7-Flash is well-suited for cost-conscious deployments that need reasoning capability and open-weight flexibility, where the newer GLM-5 generation's higher intelligence scores don't justify the additional cost or where MIT licensing and self-hostability are requirements.

What models should I consider using alongside GLM-4.7-Flash?

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

  • GLM-5.1 (Zhipu AI): For the most demanding reasoning tasks in your pipeline where GLM-4.7-Flash's Intelligence Index score of 30 falls short, routing to GLM-5.1 at 51 handles those requests within the same provider family, keeping integration overhead low while accessing a significantly higher quality ceiling
  • DeepSeek R1 (DeepSeek): For open-weight reasoning workloads where you want to compare performance across Chinese AI labs before committing to a single provider, DeepSeek R1 provides a well-benchmarked alternative with strong performance on multi-step reasoning tasks and broad third-party hosting support
  • Gemini 2.0 Flash (Google): For requests requiring multimodal inputs including images, speech, or video that GLM-4.7-Flash can't handle, Gemini 2.0 Flash fills that gap via a managed API at $0.15 per million input tokens with a 1M token context window
  • Claude Haiku 3.5 (Anthropic): For latency-sensitive customer-facing tasks where consistent instruction-following and structured output formatting are priorities, Claude Haiku 3.5 offers a managed-API alternative when GLM-4.7-Flash's 1.63-second time to first token is too slow for the use case
  • Qwen 2.5 72B (Alibaba): For multilingual workloads, particularly those involving Chinese-language tasks, Qwen 2.5 72B provides a strong cross-provider comparison point from another Chinese AI lab, useful for validating quality across different model families before finalizing your routing configuration

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

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

  • Text-only modality: GLM-4.7-Flash accepts only text input and produces only text output. Any workload requiring image, video, or audio processing needs a separate model in the routing configuration, adding integration complexity that multimodal models like GLM-5V Turbo or Gemini 2.0 Flash eliminate
  • Latency at 73.2 tokens per second: Artificial Analysis measures GLM-4.7-Flash at 73.2 tokens per second (as of 06/08/2026), below the 100.6 token-per-second median for comparable models. Combined with a 1.63-second time to first token, latency-sensitive applications like real-time chat may notice slower response feel compared to faster alternatives
  • Output-skewed pricing: At $0.07 per million input tokens but $0.40 per million output tokens, output costs are approximately 5.7x the input rate. Generation-heavy tasks like long-form writing or document drafting will accumulate costs faster than the input price implies, requiring careful output length monitoring at scale
  • Provider dependency: Relying on a single Zhipu AI endpoint for GLM-4.7-Flash inference creates a fragility point if the provider experiences downtime or changes terms. Open-weight status means you can self-host, but that introduces separate infrastructure requirements rather than eliminating the dependency entirely
  • Cost at scale: Even at $0.07 per million input tokens, high request volumes compound total spend quickly. Without per-project budget caps and attribution tracking, costs can exceed projections especially for output-intensive workloads at the $0.40 per million output rate

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

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

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

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

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

Try GLM-4.7 FlashX through Merge Gateway

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