认证
authorization string 必填
所有 API 均使用 Bearer Token 鉴权
获取 API Key:
访问 API Key 管理页面 获取 API Key
用法:
将以下 Header 添加到请求中:
Authorization: Bearer YOUR_API_KEY
参数
model string 必填
请求使用的模型 ID
值: qwen3.7-flash
messages array 必填
表示对话历史的消息对象数组
role
string必填消息角色
可选值:
user,assistant,system,developer
content
string | array必填文本字符串或多模态数组. 支持文本、图像和视频输入
max_tokens integer
生成的最大 token 数量
范围: 1 - 65536
temperature number
采样温度
默认值: 1.0
范围: 0.0 - 2.0
top_p number
核采样参数
默认值: 1.0
范围: 0.0 - 1.0
stream boolean
是否增量流式返回响应
默认值: false
functions array
模型可生成 JSON 输入的函数列表
name
string必填函数名称
description
string函数功能描述
parameters
object函数接受的参数, 使用 JSON Schema 对象描述
function_call string | object
控制模型如何调用函数
可选值: none, auto, 或 {"name": "function_name"}
默认值: auto
response_format object
模型必须输出的格式. 用于结构化输出
type
string必填输出格式类型
可选值:
text,json_object,json_schema
响应格式
id string
completion 的唯一标识符
object string
对象类型, 始终为 chat.completion
created integer
创建 completion 时的 Unix 时间戳
model string
用于 completion 的模型
choices array
completion 选择数组
index
integer该选择在数组中的索引
message
object生成的消息
role
string消息作者的角色
content
string消息的内容
finish_reason
string模型停止生成 token 的原因
可选值:
stop,length,function_call,content_filter
usage object
token 使用统计
prompt_tokens
integer提示中的 token 数量
completion_tokens
integercompletion 中的 token 数量
total_tokens
integer本次请求消耗的总 token 数量