Skip to navigation

GLM 4.7 Flash

GLM 4.7 Flash
Z.ai · Text Generation
POST /v1/chat/completions

Free lightweight GLM-4.7 text model for coding, reasoning, long-context writing, and general chat.

See GLM 4.7 Flash pricing and specs or try it in the Playground.

At a glance

FieldValue
Model idglm-4-7-flash
Model release date2026-01-19
Input modalitiesText
Output modalitiesText
Context window202.8K
Weight precision-
Max output tokens131,072
RegionSingapore
Featuresreasoning, function_calling, web_search
Native inferenceNo
NewNo
Structured outputJSON Mode
Supported endpointsPOST /v1/chat/completions, POST /v1/responses, POST /v1/messages, POST /v1beta/models/glm-4-7-flash:generateContent
Alternate model idsglm-4.7-flash, zai/glm-4.7-flash, zhipu/glm-4.7-flash

Pricing

ChargeSpecRate
Inputper 1M prompt tokensFree
Outputper 1M generated tokensFree
Implicit cache readper 1M cached input tokensFree
Web searchper request when enabled$0.033

Example request

curl https://api.empiriolabs.ai/v1/chat/completions \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"model": "glm-4-7-flash", "messages": [{"role":"user","content":"Hello"}]}'

Parameters

ParameterTypeRequiredDefaultDescription
temperaturenumberno1Sampling temperature. Lower values are more deterministic. · Range: 0 – 1
top_pnumberno0.95Nucleus sampling cutoff. · Range: 0.01 – 1
max_tokensnumberno4096Maximum output tokens. · Range: 1 – 131072
stoparrayno-Stop word list. Z.AI currently supports one stop string in array form.
do_samplebooleannotrueEnable sampling. When false, temperature and top_p do not affect generation.
enable_thinkingbooleannotrueTurns thinking on or off. On by default, and the model thinks; turn it off for simple low-latency turns.
thinkingobjectno-Advanced thinking object. Use {“type”:“enabled”} or {“type”:“disabled”}. The model thinks when enabled.
preserve_thinkingbooleannofalseInclude the reasoning of earlier assistant turns in the model’s input on /v1/chat/completions. Return each turn’s reasoning unchanged in that assistant message’s reasoning_content field. The earlier reasoning is billed as input tokens.
toolsarrayno-Function tools and the built-in web_search tool are supported.
tool_choiceenumno"auto"Only auto is supported. Omit tools to disable tool use. · Allowed: auto
tool_streambooleannofalseStream function-call tool output when stream is true. Z.AI documents tool_stream for GLM-4.6 and newer models.
tool_web_searchbooleannofalseEnable built-in web search. Adds $0.033 per request when enabled.
search_resultbooleannotrueReturn structured web search result metadata when web search is enabled.
search_promptstringno-Optional instruction for summarizing retrieved web search results.
countnumberno10Number of web search results to retrieve. · Range: 1 – 50
search_domain_filterstringno-Optional domain whitelist for web search results.
search_recency_filterenumno"noLimit"Optional web search recency window. · Allowed: oneDay, oneWeek, oneMonth, oneYear, noLimit
response_formatenumno-Return the output as a valid JSON object (JSON mode). Describe the fields you want in your prompt.

Notes

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


Machine-readable schema: GET https://api.empiriolabs.ai/v1/models/glm-4-7-flash.