GLM 4.7 FlashX API

High-speed GLM-4.7 text model for coding, reasoning, long-context writing, and chat, with 200K context, function calling, and web search.

Z.aiText Generation200K contextReleased Jan 19, 2026SingaporeProprietary Endpoint

About GLM 4.7 FlashX

High-speed GLM-4.7 text model for coding, reasoning, long-context writing, and chat, with 200K context, function calling, and web search.

Built-in web search is optional through tool_web_search and adds $0.033 per request when enabled. Supports function tools, tool_choice auto, JSON response_format, thinking controls, tool_stream, temperature, top_p, do_sample, max_tokens, stop, and streaming.

Also known as GLM FlashX, Z.ai GLM 4.7 FlashX

reasoningfunction callingweb searchcache

GLM 4.7 FlashX specs

Model ID
glm-4-7-flashx
Author
Z.ai
Category
Text Generation
Released
Jan 19, 2026
Context window
200K tokens
Max output
131,072 tokens
Input
Text
Output
Text
Structured output
JSON Mode
Region
Singapore
Endpoints
POST/v1/chat/completionsPOST/v1/responsesPOST/v1/messagesPOST/v1beta/models/glm-4-7-flashx:generateContent
Alternate model IDs
glm-4.7-flashxzai/glm-4.7-flashxzhipu/glm-4.7-flashx

GLM 4.7 FlashX API pricing

Live pay-as-you-go rates from the EmpirioLabs catalog. You are billed only for what you use, with no monthly minimum.

Type
Spec
Rate
Input
per 1M prompt tokens
$0.07
Output
per 1M generated tokens
$0.40
Implicit cache read
per 1M cached input tokens
$0.063
Web search
per request when enabled
$0.033
Compare on the full pricing page

How to call the GLM 4.7 FlashX API

GLM 4.7 FlashX serves the OpenAI-compatible Chat Completions API. Point any OpenAI SDK at https://api.empiriolabs.ai/v1 with your EmpirioLabs API key and use the model id glm-4-7-flashx. Get an API key from the EmpirioLabs dashboard.

cURL
curl https://api.empiriolabs.ai/v1/chat/completions \
  -H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-4-7-flashx",
    "messages": [
      {"role": "user", "content": "Write a haiku about the ocean."}
    ]
  }'
Python (OpenAI SDK)
from openai import OpenAI

client = OpenAI(
    base_url="https://api.empiriolabs.ai/v1",
    api_key="YOUR_EMPIRIOLABS_API_KEY",
)

response = client.chat.completions.create(
    model="glm-4-7-flashx",
    messages=[{"role": "user", "content": "Write a haiku about the ocean."}],
)
print(response.choices[0].message.content)
Full GLM 4.7 FlashX API reference

GLM 4.7 FlashX API parameters

Request parameters supported by the GLM 4.7 FlashX API on EmpirioLabs. Defaults apply when a field is omitted.

ParameterTypeDefaultRange / valuesDescription
temperaturenumber10 to 1Sampling temperature. Lower values are more deterministic.
top_pnumber0.950.01 to 1Nucleus sampling cutoff.
max_tokensnumber40961 to 131072Maximum output tokens.
stoparray--Stop word list. Z.AI currently supports one stop string in array form.
do_samplebooleantrue-Enable sampling. When false, temperature and top_p do not affect generation.
enable_thinkingbooleantrue-Turns thinking on or off. On by default, and the model thinks; turn it off for simple low-latency turns.
thinkingobject--Advanced thinking object. Use {"type":"enabled"} or {"type":"disabled"}. The model thinks when enabled.
toolsarray--Function tools and the built-in web_search tool are supported.
tool_choiceenumautoautoOnly auto is supported. Omit tools to disable tool use.
tool_streambooleanfalse-Stream function-call tool output when stream is true. Z.AI documents tool_stream for GLM-4.6 and newer models.
tool_web_searchbooleanfalse-Enable built-in web search. Adds $0.033 per request when enabled.
search_resultbooleantrue-Return structured web search result metadata when web search is enabled.
search_promptstring--Optional instruction for summarizing retrieved web search results.
countnumber101 to 50Number of web search results to retrieve.
3 more parameters in the docs

Good to know

Built-in web search is optional through tool_web_search and adds $0.033 per request when enabled.

GLM 4.7 FlashX API: common questions

How much does the GLM 4.7 FlashX API cost?

On EmpirioLabs, GLM 4.7 FlashX is billed pay as you go: Input $0.07 per 1M prompt tokens; Output $0.40 per 1M generated tokens; Implicit cache read $0.063 per 1M cached input tokens; Web search $0.033 per request when enabled. The live rate card on this page always matches what the API charges.

What is the context window of GLM 4.7 FlashX?

GLM 4.7 FlashX supports a 200K-token context window with up to 131,072 output tokens per response.

Is the GLM 4.7 FlashX API OpenAI-compatible?

Yes. GLM 4.7 FlashX serves the OpenAI-compatible Chat Completions API, so existing OpenAI SDKs work by pointing base_url at https://api.empiriolabs.ai/v1 and setting the model id to glm-4-7-flashx.

Can I try GLM 4.7 FlashX in the browser before integrating?

Yes. The EmpirioLabs playground runs GLM 4.7 FlashX in the browser with the same parameters the API exposes, so you can test prompts before writing code.

How do I get a GLM 4.7 FlashX API key?

Create an EmpirioLabs account, then generate a key under API Keys in the dashboard. Billing is pay-as-you-go credits, so you only pay for the requests you make.

Ready to use better endpoints?

Check out our pricing or reach out if you want your own model deployed on our stack.