Grok
Endpoint: https://mmu.vod-qcloud.com/v1认证: VOD ApiToken / Bearer
Grok 是文本生成 / 对话模型,通过兼容 OpenAI 的接口调用,支持 JSON 与 SSE 流式响应。支持 Chat Completions、Responses 与 Messages 协议,提供推理与非推理版本可选。
基本信息
| 项目 | 取值 |
|---|---|
| 调用地址 | https://mmu.vod-qcloud.com |
| 认证 | VOD 应用签发的 ApiToken / Bearer |
| 输出 | 文本 / 结构化响应 |
| 响应方式 | JSON / SSE |
支持的协议
| 规格 | 路径 | 对象 |
|---|---|---|
| Chat Completions | POST /v1/chat/completions | 下方所有模型 |
| Responses | POST /v1/responses | 下方所有模型 |
| Messages | POST /v1/messages | 下方所有模型 |
下方模型 ID 使用对应规格。认证与公共字段遵循 API Reference。
采样选项
对本文档中列出的所有模型通用。
| 参数 | 设置 |
|---|---|
temperature | 可设置 |
top_p | 可设置 |
temperature 指定采样温度,top_p 指定累积概率范围。以一种方式为主进行调整。
各版本推理设置
| 模型 ID | 设置方式 | 停用 |
|---|---|---|
gk-4.6 | reasoning_effort | 无专用停用选项 |
gk-4.3 | reasoning_effort | 无专用停用选项 |
gk-4.1-fast-non-reasoning | 非推理模型 | 以模型 ID 选择 |
gk-4-20-reasoning | reasoning_effort | 以模型 ID 选择 |
gk-4-20-non-reasoning | 非推理模型 | 以模型 ID 选择 |
gk-4-1-fast-reasoning | reasoning_effort | 以模型 ID 选择 |
以 Chat Completions 为基准。推理内容从 reasoning_content 读取,最终答案从 content 读取。对无法停用的版本不传递停用选项。
请求参数
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
model | 必填 | String | 各版本选项表中的模型 ID |
messages | 必填 | Array | Chat Completions / Messages 的对话输入 |
input | 必填 | String / Array | Responses 的输入。代替 messages 使用 |
max_tokens | 可选 | Integer | Chat Completions / Messages 的生成上限。在 Messages 中为必填 |
max_output_tokens | 可选 | Integer | Responses 的生成上限 |
stream | 可选 | Boolean | true:SSE / false:JSON |
请求示例
Chat Completions
json
{
"model": "gk-4.6",
"messages": [
{
"role": "user",
"content": "Reply with exactly OK and nothing else."
}
],
"max_tokens": 2048,
"stream": false,
"reasoning_effort": "low"
}响应
json
{
"id": "01a0de40-a5ff-78b0-ba00-93d96f5698c7",
"object": "chat.completion",
"model": "grok-4.6",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "OK"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0,
"text_tokens": 12
},
"prompt_cached_tokens_details": {
"audio_tokens": 0
},
"completion_tokens": 1,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 114,
"rejected_prediction_tokens": 0
},
"total_tokens": 127
}
}Responses
json
{
"model": "gk-4.6",
"input": "Reply with exactly OK and nothing else.",
"max_output_tokens": 512,
"stream": false
}响应
json
{
"id": "resp_0c703ed2c27d9a19006ab7dc7cd99481949e814740a80465ed",
"object": "response",
"model": "grok-4.6",
"status": "completed",
"output": [
{
"id": "msg_0c703ed2c27d9a19006ab7dc80bf7481948c2eaf253c24e43e",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": ,
"logprobs": ,
"text": "OK"
}
],
"role": "assistant"
}
],
"usage": {
"input_tokens": 8,
"input_tokens_details": {
"cache_write_tokens": 0,
"cached_tokens": 0
},
"output_tokens": 116,
"output_tokens_details": {
"reasoning_tokens": 115
},
"total_tokens": 124
}
}Messages
json
{
"model": "gk-4.6",
"messages": [
{
"role": "user",
"content": "Reply with exactly OK and nothing else."
}
],
"max_tokens": 512,
"stream": false
}响应
json
{
"id": "01a0de33-5952-783e-9e51-bb6ca79ca5b8",
"model": "grok-4.6",
"type": "message",
"role": "assistant",
"content": [
{
"text": "OK",
"type": "text"
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 12,
"output_tokens": 1
}
}特殊设置
在 Chat Completions 中用 reasoning_effort 指定推理强度。推理令牌包含在输出令牌用量中。在返回推理内容的响应中,分别处理 reasoning_content 与最终的 content。