高速GLM-4.6V视觉模型,用于图像、视频、文件和文本理解,支持128K上下文和原生函数调用。
内置网页搜索可通过tool_web_search选择,启用时可按请求添加$0.033。支持文本、图片、视频和文件输入,以及功能工具、tool_choice自动、JSON response_format、思维控制、心tool_stream、温度、top_p、do_sample、max_tokens、停止和流媒体。
也称为 Z.ai GLM 4.6V FlashX
glm-4-6v-flashx/v1/chat/completionsPOST/v1/responsesPOST/v1/messagesPOST/v1beta/models/glm-4-6v-flashx:generateContentglm-4.6v-flashxzai/glm-4.6v-flashxzhipu/glm-4.6v-flashx来自 EmpirioLabs 目录的实时按量计费价格。只为实际用量付费,没有月度最低消费。
GLM 4.6V FlashX 提供 OpenAI 兼容的 Chat Completions API。用你的 EmpirioLabs API 密钥把任意 OpenAI SDK 指向 https://api.empiriolabs.ai/v1,并使用模型 ID glm-4-6v-flashx。 在EmpirioLabs 控制台获取 API 密钥。
curl https://api.empiriolabs.ai/v1/chat/completions \
-H "Authorization: Bearer $EMPIRIOLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-4-6v-flashx",
"messages": [
{"role": "user", "content": "Write a haiku about the ocean."}
]
}'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-6v-flashx",
messages=[{"role": "user", "content": "Write a haiku about the ocean."}],
)
print(response.choices[0].message.content)EmpirioLabs 上 GLM 4.6V FlashX API 支持的请求参数。省略字段时使用默认值。
| 参数 | 类型 | 默认值 | 范围 / 值 | 描述 |
|---|---|---|---|---|
| temperature | number | 1 | 0 到 1 | 采样温度。较低的数值则更具确定性。 |
| top_p | number | 0.95 | 0.01 到 1 | 核采样截止。 |
| max_tokens | number | 4096 | 1 到 32768 | 最大输出令牌。 |
| stop | array | - | - | 停止词列表。Z.AI 目前支持数组形式的单点字符串。 |
| do_sample | boolean | true | - | 启用采样。如果不确定,温度和top_p不会影响发电。 |
| enable_thinking | boolean | true | - | 开启或关闭思考。默认为开启;开启时,模型决定是否思考。 |
| thinking | object | - | - | 高级思考对象。使用 {“type”:“enabled” 或 {“type”:“disabled”}。启用后,模型决定是否思考。 |
| tools | array | - | - | 支持函数工具和内置web_search工具。 |
| tool_choice | enum | auto | auto | 只支持自动。省略工具以禁用工具使用。 |
| tool_stream | boolean | false | - | 当流为真时,流函数调用工具输出。Z.AI 文档tool_stream GLM-4.6及更新型号。 |
| tool_web_search | boolean | false | - | 启用内置的网页搜索功能。启用后每个请求会增加$0.033个请求。 |
| search_result | boolean | true | - | 启用网页搜索时返回结构化的网页搜索结果元数据。 |
| search_prompt | string | - | - | 可选的总结检索网页搜索结果的说明。 |
| count | number | 10 | 1 到 50 | 需要检索的网络搜索结果数量。 |
内置网页搜索通过tool_web_search为可选功能,启用后每个请求添加$0.033。
在 EmpirioLabs,GLM 4.6V FlashX 按量计费:输入 $0.04 每100万个提示词标记; 产出 $0.40 每100万个生成代币; 隐式缓存读取 $0.036 每 1M 缓存输入标记; 网络搜索 $0.033 启用时每个请求。本页的实时价格表始终与 API 的实际计费一致。
GLM 4.6V FlashX 支持 128K token 的上下文窗口,每次响应最多 32,768 个输出 token。
兼容。GLM 4.6V FlashX 提供 OpenAI 兼容的 Chat Completions API,现有 OpenAI SDK 只需把 base_url 指向 https://api.empiriolabs.ai/v1 并把模型 ID 设为 glm-4-6v-flashx 即可使用。
可以。EmpirioLabs Playground在浏览器中以与 API 相同的参数运行 GLM 4.6V FlashX,你可以在写代码之前先测试提示词。
创建 EmpirioLabs 账户,然后在控制台的 API Keys生成密钥。计费使用按量付费的额度,只为实际发出的请求付费。