认证
authorization string 必填
所有 API 均使用 Bearer Token 鉴权
获取 API Key:
访问 API Key 管理页面 获取 API Key
用法:
将以下 Header 添加到请求中:
Authorization: Bearer YOUR_API_KEY
接口与兼容性
POST https://cloud.vtrix.ai/llm/chat/completions
该接口返回 OpenAI Chat Completions 格式:顶层包含 choices 与 usage。它不是异步任务接口,因此响应中没有 status、output、资源 url、jobId、cost 或 discount 字段。
模型能力
GLM-5.3-Flash 是原生多模态模型,支持视频、图像、文本和文件输入,上下文窗口为 1M token,最大输出为 131072 个 token。多模态请求可在内容数组中使用 image_url、video_url 和 file 内容块。模型始终开启思考:thinking.type 必须为 enabled,reasoning_effort 支持 low、high、max,默认值为 max。
参数
model string 必填
请求使用的模型 ID。
值: glm-5.3-flash
messages array 必填
表示对话历史的消息对象数组。
role
string必填消息角色。可选值:
user、assistant、system、tool。
content
string | array必填文本字符串,或包含文本、图像、视频和文件项的 OpenAI 兼容内容数组。多模态输入可使用
image_url、video_url或file内容块。
thinking object
GLM-5.3-Flash 始终开启思考模式。thinking.type 必须为 enabled,不支持关闭思考。如需在多轮对话中保留历史思考内容,可将 clear_thinking 设置为 false。
type
string值:
enabled。
clear_thinking
boolean是否保留历史轮次中的推理内容。
默认值:
true。如需在多轮对话中保留思考内容,请设置为false。
reasoning_effort string
始终开启的思考模式的推理强度。默认值: max。
可选值: low、high、max。
max_tokens integer
单次完成生成的最大 token 数。范围: 1 - 131072。思考 token 也会占用该预算,因此启用思考模式时应留出足够的 max_tokens。
temperature number
采样温度。默认值: 1.0;范围: 0.0 - 1.0。
top_p number
核采样参数,可作为 temperature 的替代采样控制。默认值: 0.95;范围: 0.01 - 1.0。
stream boolean
是否以 Server-Sent Events (SSE) 方式增量返回。默认值: false。流式响应同样使用 OpenAI Chat Completions 的 chunk 格式,并以 data: [DONE] 结束。
tool_stream boolean
是否以流式方式增量返回 Function Calling 参数。
默认值: false。
tools array
模型可调用的工具列表,使用 OpenAI function tool 结构。
type
string必填值:
function。
function
object必填函数定义。
tool_choice string | object
控制工具选择策略。可使用 auto、none、required,或指定某个 function 工具。
stop string | array
模型停止生成的一个或多个序列;最多 4 个字符串。
response_format object
输出格式约束。type 可为 text 或 json_object。
响应格式
id string
本次 Chat Completion 的请求 ID。
object string
固定为 chat.completion。
created integer
响应创建时间的 Unix 时间戳(秒)。
model string
实际处理本次请求的模型 ID。
choices array
一个或多个生成结果。
index
integer结果序号。
message
object助手消息。
role
string固定为
assistant。content
string | null最终回答文本。
reasoning_content
string(可选)GLM-5.3-Flash 始终开启思考时生成的推理文本。
finish_reason
string生成结束原因,例如
stop、length或tool_calls。
usage object
本次请求的 token 使用统计。
prompt_tokens
integer输入 token 数。
completion_tokens
integer输出 token 数。
total_tokens
integer输入与输出 token 总数。
completion_tokens_details.reasoning_tokens
integer(可选)思考模式消耗的 token 数。