GLM 5.4 API

Flagship coding and agentic model with a 1M token context, 128K output, image, video, and file input, always-on reasoning at low, high, or max effort, native web search, and tool calling.

Z.ai 文本生成 1M 上下文 发布日期 2026年12月2日 Singapore 专有端点 新

关于 GLM 5.4

Flagship coding and agentic model with a 1M token context, 128K output, image, video, and file input, always-on reasoning at low, high, or max effort, native web search, and tool calling.

Notes: - Context window: 1M tokens - Maximum output: 128K tokens - Accepts text, image, video, and file input - Always reasons; thinking cannot be disabled - Reasoning effort: low, high, or max (max recommended for complex coding) - A request for a different effort, or to turn thinking off, is served at the nearest supported level - Built-in web search adds $0.033 per request when used - Supports function calling (tool choice auto or none), structured output (JSON mode), and streaming

也称为 Z.ai GLM 5.4

reasoning vision video understanding document understanding function calling web search

GLM 5.4 规格

模型 ID
glm-5-4
开发方
Z.ai
类别
文本生成
发布日期
2026年12月2日
上下文窗口
1M 个 token
最大输出
131,072 个 token
输入
文本图像视频文件
输出
文本
结构化输出
JSON 模式
区域
Singapore
端点
POST/v1/chat/completionsPOST/v1/responsesPOST/v1/messagesPOST/v1beta/models/glm-5-4:generateContent
备用模型 ID
glm-5.4zai/glm-5.4zhipu/glm-5.4

GLM 5.4 API 价格

来自 EmpirioLabs 目录的实时按量计费价格。也可以选择包含每周用量额度的套餐。

类型
规格
价格
输入
per 1M prompt tokens
$1.40
输出
per 1M generated tokens
$4.40
Web search
per request
$0.033
在完整价格页比较

如何调用 GLM 5.4 API

GLM 5.4 提供 OpenAI 兼容的 Chat Completions API。用你的 EmpirioLabs API 密钥把任意 OpenAI SDK 指向 https://api.empiriolabs.ai/v1,并使用模型 ID glm-5-4。 在EmpirioLabs 控制台获取 API 密钥。

cURL
curl https://api.empiriolabs.ai/v1/chat/completions \
  -H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5-4",
    "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-5-4",
    messages=[{"role": "user", "content": "Write a haiku about the ocean."}],
)
print(response.choices[0].message.content)
GLM 5.4 API 完整参考

GLM 5.4 API 参数

EmpirioLabs 上 GLM 5.4 API 支持的请求参数。省略字段时使用默认值。

参数类型默认值范围 / 值描述
max_tokensinteger655361 到 131072Maximum number of output tokens to generate.
temperaturenumber10 到 1Controls randomness. Lower values make responses more deterministic.
top_pnumber0.950.01 到 1Nucleus sampling cutoff.
reasoning_effortenummaxlow, high, maxThis model always reasons and cannot be turned off. low is lightweight, high is enhanced, and max is deep reasoning. max is recommended for complex coding.
preserve_thinkingbooleanfalse-Include 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...
do_samplebooleantrue-Enable sampling. Turn off for greedy deterministic output (temperature and top_p are ignored).
tool_web_searchbooleanfalse-Enable built-in web search. Adds $0.033 per request when used.
search_recency_filterenumnoLimitoneDay, oneWeek, oneMonth, oneYear, noLimitLimit web search results to a recency window.
countinteger101 到 50Number of web search results to retrieve when web search is enabled.
search_domain_filterstring--Restrict web search to a specific domain.
search_promptstring--Optional prompt used to summarize retrieved web search results.
search_resultbooleantrue-Return web search result metadata in the response when web search is enabled.
tool_streambooleanfalse-Stream function-call arguments incrementally when streaming.
toolsarray[]-OpenAI-compatible function calling tool definitions. A web_search tool sent here keeps its own search options as written, with count from 1 to 50.
文档中还有 3 个参数

GLM 5.4 相关博客文章

涵盖这个模型的公告、提示词测试和对比文章。

GLM 5.4 API:常见问题

GLM 5.4 API 收费多少?

在 EmpirioLabs,GLM 5.4 按量计费:输入 $1.40 per 1M prompt tokens; 输出 $4.40 per 1M generated tokens; Web search $0.033 per request。也可以选择包含每周用量额度的套餐。本页的实时价格表始终与 API 的实际计费一致。

GLM 5.4 支持哪些输入和输出?

GLM 5.4 接受 文本, 图像, 视频, 文件 作为输入,并返回 文本。

GLM 5.4 的上下文窗口有多大?

GLM 5.4 支持 1M token 的上下文窗口,每次响应最多 131,072 个输出 token。

GLM 5.4 API 兼容 OpenAI 吗?

兼容。GLM 5.4 提供 OpenAI 兼容的 Chat Completions API,现有 OpenAI SDK 只需把 base_url 指向 https://api.empiriolabs.ai/v1 并把模型 ID 设为 glm-5-4 即可使用。

GLM 5.4 的模型 ID 是什么?

在请求中将 glm-5-4 作为 model 发送。备用 ID glm-5.4, zai/glm-5.4, zhipu/glm-5.4 同样可用。

GLM 5.4 是什么时候发布的?

Z.ai 于 2026年12月2日 发布了 GLM 5.4。

GLM 5.4 从哪里提供服务?

EmpirioLabs 上的 GLM 5.4 从 Singapore 提供服务。

集成之前可以在浏览器里试用 GLM 5.4 吗?

可以。EmpirioLabs Playground在浏览器中以与 API 相同的参数运行 GLM 5.4,你可以在写代码之前先测试提示词。

如何获取 GLM 5.4 API 密钥?

创建 EmpirioLabs 账户,然后在控制台的 API Keys生成密钥。计费使用按量付费的额度,只为实际发出的请求付费。也可以选择包含每周用量额度的套餐。

将 GLM 5.4 与其他模型比较

全部模型比较

准备好使用更好的终端了吗?

查看我们的定价,或者如果你想将自己的模型部署到我们的堆栈中,请联系我们。