跳到内容

Kimi ​

更新时间

Endpoint: https://mmu.vod-qcloud.com/v1认证: VOD ApiToken / Bearer

Kimi 是文本生成 / 对话模型,支持图片输入(image_url)。通过兼容 OpenAI 的接口调用,支持 Chat Completions 与 Messages 协议及 JSON / SSE 流式响应,k2.7-code 面向代码场景。

基本信息 ​

项目取值
调用地址https://mmu.vod-qcloud.com
认证VOD 应用签发的 ApiToken / Bearer
输出文本 / 结构化响应
响应方式JSON / SSE

支持的协议 ​

规格路径对象
Chat CompletionsPOST /v1/chat/completions下方所有模型
MessagesPOST /v1/messages下方所有模型

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

各版本采样选项 ​

模型 IDtemperaturetop_p
kimi-k3可设置可设置
kimi-k2.7-code不支持不支持
kimi-k2.6可设置可设置

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

各版本推理设置 ​

模型 ID设置方式停用
kimi-k3thinking_enabledfalse
kimi-k2.7-codethinking_enabled无法停用
kimi-k2.6thinking_enabledfalse

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

请求参数 ​

参数必填类型说明
model必填String各版本选项表中的模型 ID
messages必填ArrayChat Completions / Messages 的对话输入
max_tokens可选IntegerChat Completions / Messages 的生成上限。在 Messages 中为必填
stream可选Booleantrue:SSE / false:JSON

请求示例 ​

Chat Completions ​

json
{
  "model": "kimi-k3",
  "messages": [
    {
      "role": "user",
      "content": "Reply with exactly OK and nothing else."
    }
  ],
  "max_tokens": 2048,
  "stream": false,
  "reasoning_effort": "low"
}

响应 ​

json
{
  "id": "01a0de40-e125-7362-86bf-77c3082b129e",
  "object": "chat.completion",
  "model": "kimi-k3",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "OK",
        "reasoning_content": "The user wants exactly OK and nothing else. Final should be just OK. Need ensure no extra whitespace? Provide exactly OK."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 94,
    "prompt_tokens_details": {
      "audio_tokens": 0,
      "cached_tokens": 64
    },
    "prompt_cached_tokens_details": {
      "audio_tokens": 0
    },
    "completion_tokens": 39,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 0,
      "audio_tokens": 0,
      "reasoning_tokens": 25,
      "rejected_prediction_tokens": 0
    },
    "total_tokens": 133
  }
}

Messages ​

json
{
  "model": "kimi-k3",
  "messages": [
    {
      "role": "user",
      "content": "Reply with exactly OK and nothing else."
    }
  ],
  "max_tokens": 512,
  "stream": false
}

响应 ​

json
{
  "id": "01a0de34-c2f3-71f6-9a0f-32e6bfd963e1",
  "model": "kimi-k3",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "text": "OK",
      "type": "text"
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 93,
    "output_tokens": 146
  }
}

特殊设置 ​

将推理文本与最终响应分开,并同时确认 finish_reason。工具调用响应通过 tool_calls 处理,并在后续请求中保留工具 ID 与对话顺序。图片输入请使用对应版本的 image_url Part。

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