跳到内容

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 CompletionsPOST /v1/chat/completions下方所有模型
ResponsesPOST /v1/responses下方所有模型
MessagesPOST /v1/messages下方所有模型

下方模型 ID 使用对应规格。认证与公共字段遵循 API Reference。

采样选项 ​

对本文档中列出的所有模型通用。

参数设置
temperature可设置
top_p可设置

temperature 指定采样温度,top_p 指定累积概率范围。以一种方式为主进行调整。

各版本推理设置 ​

模型 ID设置方式停用
gk-4.6reasoning_effort无专用停用选项
gk-4.3reasoning_effort无专用停用选项
gk-4.1-fast-non-reasoning非推理模型以模型 ID 选择
gk-4-20-reasoningreasoning_effort以模型 ID 选择
gk-4-20-non-reasoning非推理模型以模型 ID 选择
gk-4-1-fast-reasoningreasoning_effort以模型 ID 选择

以 Chat Completions 为基准。推理内容从 reasoning_content 读取,最终答案从 content 读取。对无法停用的版本不传递停用选项。

请求参数 ​

参数必填类型说明
model必填String各版本选项表中的模型 ID
messages必填ArrayChat Completions / Messages 的对话输入
input必填String / ArrayResponses 的输入。代替 messages 使用
max_tokens可选IntegerChat Completions / Messages 的生成上限。在 Messages 中为必填
max_output_tokens可选IntegerResponses 的生成上限
stream可选Booleantrue: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。

基于 VitePress 构建 · 部署于腾讯云 EdgeOne Pages