跳转至

Qwen_3.8_flash

模型概览

模型 ID(model) qwen3.8-flash
上下文长度 1,000,000 tokens
最大输入 991,808(思考模式 983,616)
最大输出 131,072
最大思维链 262,144
输入模态 Image、Text、Video
输出模态 Text
默认思考模式 开启
前缀续写 支持
上下文缓存 支持(显式 cache_control)

请求协议

https

参数名 类型 必填 描述
Content-Type string application/json
Authorization string Bearer ${your_AK}

OpenAI Chat Completions

请求 URL

POST https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/chat/completions

请求 Body 参数

参数名 二级参数 三级参数 四级参数 类型 必填 描述
model - - - string 固定为 MaaS_Qwen_3.8_flash_20260826(厂商原始 model:qwen3.8-flash)
messages - - - array[json] 对话消息,按顺序排列
role - - string system / user / assistant / tool
content - - string 或 array 纯文本为 string;多模态或显式缓存为 array
type - string 是(array 时) text / image_url / video / video_url
text - string 是(type=text) 文本内容
cache_control - object 显式缓存断点,{"type":"ephemeral"}
image_url - object 是(type=image_url) 图片信息
url string 图片 URL 或 Base64 Data URL
min_pixels - integer Qwen3.8 图像默认/最小 65536
max_pixels - integer Qwen3.8 图像默认 2621440,最大 16777216
video - array 是(type=video) 图片列表形式的视频帧 URL 列表
min_pixels - integer Qwen3.8 视频帧默认 65536,最小 4096
max_pixels - integer Qwen3.8 视频帧默认 655360,最大 2048000
total_pixels - integer Qwen3.8 视频总像素默认/最大 819200000
video_url - object 是(type=video_url) 视频文件信息
url string 视频 URL 或 Base64 Data URL
min_pixels - integer 同 video 类型
max_pixels - integer 同 video 类型
total_pixels - integer 同 video 类型
partial - - boolean 前缀续写,默认 false;assistant 消息上开启
tool_calls - - array assistant 消息中的工具调用(多轮回传)
id - string 工具响应 ID
type - string 固定 function
function - object 工具与入参
name string 工具名称
arguments string JSON 字符串入参
tool_call_id - - string 是(tool 角色) 对应 tool_calls 的 id
reasoning_content - - string assistant 历史思考;preserve_thinking 开启时须完整回传
stream - - - boolean 是否流式,默认 false
stream_options - - - object 流式配置,仅 stream=true 生效
include_usage - - boolean 末 chunk 返回 usage,默认 false
max_completion_tokens - - - integer 推荐;限制思维链 + 最终回答合计;默认/最大均为模型最大输出 131072
max_tokens - - - integer 即将废弃;新接入请用 max_completion_tokens
temperature - - - float 范围 [0, 2);思考模式默认 0.6,低于 0.6 自动调整为 0.6
top_p - - - float 核采样,思考模式默认 0.95;范围 (0, 1.0]
response_format - - - object 输出格式,默认 {"type":"text"};qwen3.8 支持严格 json_object
type - - string textjson_object
tools - - - array Function Calling 工具列表
type - - string 固定 function
function - - object 工具定义
name - string 工具名称,最长 64 token
description - string 工具描述
parameters - object JSON Schema 参数描述
tool_choice - - - string/object auto / none / 指定 function;思考模式不支持强制指定
parallel_tool_calls - - - boolean 并行工具调用,默认 false
enable_thinking - - - boolean 混合思考开关;qwen3.8-flash 默认开启;HTTP 直调可放 body 顶层
reasoning_effort - - - string qwen3.8 默认 xhigh;有效档 xhigh/medium/lowmax/highxhighminimallownone→关闭思考;其他值报错;不可与 thinking_budget 同设
thinking_budget - - - integer 思维链最大 token;不可与 reasoning_effort 同时设置;与 reasoning_effort 可互转映射
preserve_thinking - - - boolean qwen3.8-flash 默认 true;须完整回传 reasoning_content,不可拼接到 content
top_k - - - integer 采样候选 token 数,默认 20;非 OpenAI 标准,SDK 用 extra_body
repetition_penalty - - - float 重复度惩罚,Qwen3.8 默认 1.0
presence_penalty - - - float 内容重复度,非思考模式默认 1.5;范围 [-2.0, 2.0]
vl_high_resolution_images - - - boolean 高分辨率图像,默认 false
tool_stream - - - boolean 复杂工具参数流式输出,仅 stream=true;qwen3.8-flash 全模态支持
enable_code_interpreter - - - boolean Chat 侧代码解释器开关,默认 false(与 Responses 内置 code_interpreter 工具不同)
stop - - - string/array 停止词
seed - - - integer 随机种子,默认 1234

请求示例

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/chat/completions' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_AK}' \
  -d '{
    "model": "MaaS_Qwen_3.8_flash_20260826",
    "messages": [{"role": "user", "content": "你好"}],
    "reasoning_effort": "none"
  }'

响应示例

{
  "id": "chatcmpl-xxx",
  "object": "chat.completion",
  "model": "MaaS_Qwen_3.8_flash_20260826",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "你好!",
      "reasoning_content": "..."
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 20,
    "total_tokens": 30,
    "completion_tokens_details": {"reasoning_tokens": 5}
  }
}

流式请求示例

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/chat/completions' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_AK}' \
  -d '{
    "model": "MaaS_Qwen_3.8_flash_20260826",
    "messages": [{"role": "user", "content": "你好"}],
    "stream": true,
    "stream_options": {"include_usage": true}
  }'

SDK 调用方式

from openai import OpenAI

client = OpenAI(
    api_key="${your_AK}",
    base_url="https://genaiapi.cloudsway.net/v1/ai/{endpointPath}"
)
completion = client.chat.completions.create(
    model="MaaS_Qwen_3.8_flash_20260826",
    messages=[{"role": "user", "content": "你好"}],
    extra_body={"reasoning_effort": "none"}
)

OpenAI Responses

请求 URL

POST https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/responses

请求 Body 参数

参数名 二级参数 三级参数 类型 必填 描述
model - - string 固定为 MaaS_Qwen_3.8_flash_20260826
input - - string 或 array 纯文本如 "你好",或消息数组
role - string 是(array 时) user / assistant / system / developer
content - string 或 array 是(array 时) 消息内容
type string 是(content 为 array) input_text / input_image
text string 是(input_text) 文本内容
image_url string 是(input_image) 图片 URL 或 Base64 Data URI
stream - - boolean 是否流式,默认 false
max_output_tokens - - integer Qwen3.8:回复 + 思维链合计上限;最小 16
reasoning - - object 思考强度;优先级高于 enable_thinking
effort - string 默认 xhigh;支持 none/minimal/low/medium/high/xhigh/max 共 7 档;none 关闭思考;xhigh/max 仅华北2、新加坡可用
enable_thinking - - boolean 即将废弃;建议用 reasoning.effort;qwen3.8-flash 默认开启
tools - - array 内置工具或自定义 function;使用 code_interpreter 须开启思考(reasoning.effort 非 none 或依赖默认思考)
type - string web_search / code_interpreter / function
name - string 是(function) 自定义工具名称
description - string 是(function) 工具描述
parameters - object 否(function) JSON Schema
tool_choice - - string/object auto / none / required / allowed_tools 对象
previous_response_id - - string 上一轮 response id,有效期 7 天
instructions - - string 系统指令,插入上下文起始
temperature - - float 采样温度,范围 [0, 2)
top_p - - float 核采样,范围 (0, 1.0]
store - - boolean 是否存储响应供后续引用,默认 true

请求示例

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_AK}' \
  -d '{
    "model": "MaaS_Qwen_3.8_flash_20260826",
    "input": "用一句话介绍通义千问",
    "reasoning": {"effort": "none"}
  }'

响应示例

{
  "id": "resp_xxx",
  "object": "response",
  "model": "MaaS_Qwen_3.8_flash_20260826",
  "status": "completed",
  "output": [
    {"type": "reasoning", "summary": [{"type": "summary_text", "text": "..."}]},
    {"type": "message", "role": "assistant", "content": [{"type": "output_text", "text": "..."}]}
  ],
  "usage": {
    "input_tokens": 12,
    "output_tokens": 48,
    "total_tokens": 60
  }
}

流式请求示例

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_AK}' \
  -d '{
    "model": "MaaS_Qwen_3.8_flash_20260826",
    "input": "你好",
    "stream": true,
    "reasoning": {"effort": "none"}
  }'

SDK 调用方式

from openai import OpenAI

client = OpenAI(
    api_key="${your_AK}",
    base_url="https://genaiapi.cloudsway.net/v1/ai/{endpointPath}"
)
response = client.responses.create(
    model="MaaS_Qwen_3.8_flash_20260826",
    input="你好",
    reasoning={"effort": "none"}
)

Anthropic Messages

请求 URL

POST https://genaiapi.cloudsway.net/{endpointPath}/v1/messages

Header(本协议额外)

参数名 类型 必填 描述
anthropic-version string 2023-06-01

请求 Body 参数

参数名 二级参数 三级参数 类型 必填 描述
model - - string 固定为 MaaS_Qwen_3.8_flash_20260826
max_tokens - - integer qwen3.8-flash:回复 + 思维链合计上限
messages - - array[json] 对话消息
role - string user / assistant / system
content - string 或 array 文本或 content block 数组
type string 是(array) text / image / video
text string 是(type=text) 文本内容
cache_control object 显式缓存,{"type":"ephemeral"}
source object 是(image/video) url 或 base64 来源
system - - string 或 array 系统提示;数组形式可含 cache_control
type - string 是(array) 固定 text
text - string 是(array) 系统提示词
cache_control - object 显式缓存断点
stream - - boolean 是否流式
thinking - - object 深度思考;qwen3.8-flash 默认开启
type - string enableddisabled
budget_tokens - integer 即将废弃;建议用 output_config.effort
output_config - - object 百炼扩展;SDK 需透传
effort - string qwen3.8 默认 xhigh;可选 xhigh/medium/lowmax/highxhigh
format - object 严格结构化输出 json_schema
type string 固定 json_schema
schema object JSON Schema
tools - - array 工具定义
name - string 工具名称
description - string 工具描述
input_schema - object 输入 JSON Schema
tool_choice - - object auto / any / none / 指定 tool
temperature - - float 范围 [0, 2);思考模式默认 0.6
top_p - - float 核采样
top_k - - integer 采样候选集大小
stop_sequences - - array 停止序列

请求示例

curl -X POST 'https://genaiapi.cloudsway.net/{endpointPath}/v1/messages' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_AK}' \
  -H 'anthropic-version: 2023-06-01' \
  -d '{
    "model": "MaaS_Qwen_3.8_flash_20260826",
    "max_tokens": 4096,
    "thinking": {"type": "disabled"},
    "messages": [{"role": "user", "content": "你好"}]
  }'

响应示例

{
  "id": "msg_xxx",
  "type": "message",
  "role": "assistant",
  "model": "MaaS_Qwen_3.8_flash_20260826",
  "content": [{"type": "text", "text": "你好!"}],
  "stop_reason": "end_turn",
  "usage": {"input_tokens": 10, "output_tokens": 15}
}

流式请求示例

curl -X POST 'https://genaiapi.cloudsway.net/{endpointPath}/v1/messages' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_AK}' \
  -H 'anthropic-version: 2023-06-01' \
  -d '{
    "model": "MaaS_Qwen_3.8_flash_20260826",
    "max_tokens": 4096,
    "stream": true,
    "thinking": {"type": "disabled"},
    "messages": [{"role": "user", "content": "你好"}]
  }'

SDK 调用方式

import anthropic

client = anthropic.Anthropic(
    api_key="${your_AK}",
    base_url="https://genaiapi.cloudsway.net/{endpointPath}/v1"
)
message = client.messages.create(
    model="MaaS_Qwen_3.8_flash_20260826",
    max_tokens=4096,
    thinking={"type": "disabled"},
    messages=[{"role": "user", "content": "你好"}]
)