跳转至

MaaS_Seed_2.1

模型概览

项 值
模型 ID(model) doubao-seed-2-1-lite-260915
上下文长度 1024k tokens
最大输入 1024k tokens
最大输出 256k tokens(默认 4k)
最大思维链 256k tokens
输入模态 Text、Image、Video、Document(不支持文件上传接口)、Audio
输出模态 Text
默认思考模式 深度思考默认开启;reasoning_effort / reasoning.effort 默认档位 high
兼容协议 Chat Completions ✅、Responses ✅

请求协议

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_Seed_2.1_lite_20260915(厂商原始 model:doubao-seed-2-1-lite-260915)
messages - - - array 是 对话消息列表
role - - string 是 system / user / assistant / tool
content - - string 或 array 是 纯文本或多模态 part 数组
type - string 条件 text:文本
text - string 条件 文本内容
type - string 条件 image_url:图片
image_url - object 条件 图片对象
url string 是 公网可访问图片 URL
type - string 条件 input_audio:音频(MaaS 不用 file_id)
input_audio - object 条件 音频对象
url string 二选一 公网音频 URL;
data string 二选一 纯 Base64 字符串(不含 data: 前缀)
format string 是 如 mp3、wav、aac、m4a
stream - - - boolean 否 true 时 SSE 流式返回
max_completion_tokens - - - integer 否 最大生成 token(含思维链);上限见模型概览
max_tokens - - - integer 否 兼容字段;建议优先使用 max_completion_tokens
temperature - - - number 否 采样温度
top_p - - - number 否 核采样
thinking - - - object 否 深度思考开关
type - - string 否 enabled(默认)/ disabled / auto
reasoning_effort - - - string 否 思维链长度:none / minimal / low / medium / high(默认)/ xhigh / max;本模型:minimal 关闭思考;none→minimal;xhigh/max→high;thinking.type=disabled 时仅允许 minimal
response_format - - - object 否 结构化输出
type - - string 否 如 json_object
tools - - - array 否 工具/函数定义(Function Calling)
tool_choice - - - string 或 object 否 工具选择策略

请求示例(最简文本)

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_Seed_2.1_lite_20260915",
    "messages": [
      {"role": "user", "content": "用一句话介绍什么是大语言模型"}
    ]
  }'

响应示例(非流式,节选)

{
  "id": "chatcmpl-xxx",
  "object": "chat.completion",
  "model": "MaaS_Seed_2.1_lite_20260915",
  "choices": [{
    "index": 0,
    "message": {"role": "assistant", "content": "..."},
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 128,
    "total_tokens": 148,
    "completion_tokens_details": {"reasoning_tokens": 64}
  }
}

更多请求示例

system + 多轮 messages

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_Seed_2.1_lite_20260915",
    "messages": [
      {"role": "system", "content": "你是简洁、准确的中文助手。"},
      {"role": "user", "content": "Redis 和 Memcached 的主要区别?"},
      {"role": "assistant", "content": "Redis 支持丰富数据结构并可持久化;Memcached 主要是纯内存 KV。"},
      {"role": "user", "content": "做会话缓存更推荐哪个?只给结论和一句理由。"}
    ],
    "temperature": 0.7,
    "max_completion_tokens": 512
  }'

关闭深度思考

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_Seed_2.1_lite_20260915",
    "messages": [{"role": "user", "content": "1+1等于几?只回答数字。"}],
    "thinking": {"type": "disabled"},
    "reasoning_effort": "minimal"
  }'

调节思考强度(默认 high)

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_Seed_2.1_lite_20260915",
    "messages": [{"role": "user", "content": "分析微服务与单体架构的适用场景"}],
    "reasoning_effort": "low"
  }'

图文理解(image_url)

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_Seed_2.1_lite_20260915",
    "messages": [{
      "role": "user",
      "content": [
        {"type": "text", "text": "图片里主要是什么?用中文简要描述。"},
        {"type": "image_url", "image_url": {"url": "https://example.com/sample.jpg"}}
      ]
    }],
    "max_completion_tokens": 1024
  }'

JSON 结构化输出

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_Seed_2.1_lite_20260915",
    "messages": [
      {"role": "system", "content": "只输出合法 JSON,不要 markdown。"},
      {"role": "user", "content": "列举三种常见编程语言,每项包含 name 和 paradigm 字段"}
    ],
    "response_format": {"type": "json_object"},
    "thinking": {"type": "disabled"},
    "reasoning_effort": "minimal"
  }'

音频 URL(input_audio.url)

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_Seed_2.1_lite_20260915",
    "messages": [{
      "role": "user",
      "content": [
        {
          "type": "input_audio",
          "input_audio": {
            "url": "https://example.com/demo.mp3",
            "format": "mp3"
          }
        },
        {"type": "text", "text": "请识别音频中的内容,以文字返回"}
      ]
    }]
  }'

音频 Base64(input_audio.data)

BASE64_FILE=$(base64 < /path/to/demo.mp3)
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_Seed_2.1_lite_20260915",
    "messages": [{
      "role": "user",
      "content": [
        {"type": "input_audio", "input_audio": {"data": "$BASE64_FILE", "format": "mp3"}},
        {"type": "text", "text": "请识别音频中的内容"}
      ]
    }]
  }"

流式请求示例

curl -N -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/chat/completions' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_ak}' \
  -d '{
    "model": "MaaS_Seed_2.1_lite_20260915",
    "messages": [{"role": "user", "content": "写一首关于秋天的四句短诗"}],
    "stream": true
  }'

SDK 调用方式

from openai import OpenAI

client = OpenAI(
    api_key="${your_ak}",
    base_url="https://genaiapi.cloudsway.net/v1/ai/{endpointPath}",
    timeout=1800,
)

completion = client.chat.completions.create(
    model="MaaS_Seed_2.1_lite_20260915",
    messages=[
        {"role": "system", "content": "你是 helpful assistant。"},
        {"role": "user", "content": "Hello"},
    ],
    max_completion_tokens=1024,
)
print(completion.choices[0].message.content)

OpenAI Responses

请求 URL

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

请求 Body 参数

参数名 二级参数 三级参数 类型 必填 描述
model - - string 是 固定为 MaaS_Seed_2.1_lite_20260915
input - - string 或 array 是 用户输入:纯字符串,或消息/多模态 item 数组
role - string 条件 消息角色(数组形式时)
content - string 或 array 条件 文本或多模态 part
type string 条件 input_text:文本
text string 条件 文本内容
type string 条件 input_image:图片
image_url string 条件 图片 URL
type string 条件 input_audio:音频
audio_url
string 条件 公网 URL 或 data:audio/mpeg;base64,...;≤25MB、≤120 分钟
instructions - - string 否 系统级指令(类似 system prompt)
stream - - boolean 否 流式 SSE
max_output_tokens - - integer 否 最大输出 token;默认 4k,上限 256k
thinking - - object 否 深度思考
type - string 否 enabled(默认)/ disabled(本模型不支持 auto)
reasoning - - object 否 推理配置
effort - string 否 同 Chat 档位与映射规则;字段名为 reasoning.effort
previous_response_id - - string 否 多轮续聊,引用上一轮 response.id
text - - object 否 输出文本配置
format - object 否 如 {"type": "json_object"}
tools - - array 否 工具定义

请求示例(input 字符串)

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_ak}' \
  -d '{
    "model": "MaaS_Seed_2.1_lite_20260915",
    "input": "用三句话解释什么是 REST API"
  }'

响应示例(节选)

{
  "id": "resp_xxx",
  "object": "response",
  "model": "MaaS_Seed_2.1_lite_20260915",
  "status": "completed",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [{"type": "output_text", "text": "..."}]
    }
  ],
  "usage": {
    "input_tokens": 42,
    "output_tokens": 256,
    "output_tokens_details": {"reasoning_tokens": 120},
    "total_tokens": 298
  }
}

更多请求示例

instructions + 消息数组

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_ak}' \
  -d '{
    "model": "MaaS_Seed_2.1_lite_20260915",
    "instructions": "你是技术文档助手,回答要分点、简洁。",
    "input": [
      {"role": "user", "content": "Kubernetes 里 Pod 和 Deployment 的区别是什么?"}
    ],
    "max_output_tokens": 2048
  }'

关闭深度思考

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_ak}' \
  -d '{
    "model": "MaaS_Seed_2.1_lite_20260915",
    "input": "今天星期几?",
    "thinking": {"type": "disabled"},
    "reasoning": {"effort": "minimal"}
  }'

多轮 previous_response_id

第一轮:

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_ak}' \
  -d '{
    "model": "MaaS_Seed_2.1_lite_20260915",
    "input": "讲一个关于程序员的冷笑话"
  }'

第二轮(将 resp_xxx 替换为第一轮返回的 id):

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_ak}' \
  -d '{
    "model": "MaaS_Seed_2.1_lite_20260915",
    "previous_response_id": "resp_xxx",
    "input": "这个笑话的笑点在哪里?"
  }'

图文 input

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_ak}' \
  -d '{
    "model": "MaaS_Seed_2.1_lite_20260915",
    "input": [{
      "role": "user",
      "content": [
        {"type": "input_image", "image_url": "https://example.com/sample.jpg"},
        {"type": "input_text", "text": "你看见了什么?"}
      ]
    }]
  }'

音频 URL(input_audio.audio_url)

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_ak}' \
  -d '{
    "model": "MaaS_Seed_2.1_lite_20260915",
    "input": [{
      "role": "user",
      "content": [
        {"type": "input_audio", "audio_url": "https://example.com/demo.mp3"},
        {"type": "input_text", "text": "请识别这段音频内容"}
      ]
    }]
  }'

音频 Base64(data URL)

BASE64_FILE=$(base64 < /path/to/demo.mp3)
curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_ak}' \
  -d "{
    "model": "MaaS_Seed_2.1_lite_20260915",
    "input": [{
      "role": "user",
      "content": [
        {"type": "input_audio", "audio_url": "data:audio/mpeg;base64,$BASE64_FILE"},
        {"type": "input_text", "text": "请识别音频中的内容"}
      ]
    }]
  }"

JSON 输出(text.format)

curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_ak}' \
  -d '{
    "model": "MaaS_Seed_2.1_lite_20260915",
    "thinking": {"type": "disabled"},
    "reasoning": {"effort": "minimal"},
    "input": [{"role": "user", "content": "返回 JSON:city=北京, temp=25, unit=celsius"}],
    "text": {"format": {"type": "json_object"}}
  }'

流式请求示例

curl -N -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer ${your_ak}' \
  -d '{
    "model": "MaaS_Seed_2.1_lite_20260915",
    "input": [{"role": "user", "content": "流式输出:从 1 数到 5"}],
    "stream": true
  }'

SDK 调用方式

from openai import OpenAI

client = OpenAI(
    api_key="${your_ak}",
    base_url="https://genaiapi.cloudsway.net/v1/ai/{endpoint}",
    timeout=1800,
)

response = client.responses.create(
    model="MaaS_Seed_2.1_lite_20260915",
    input=[{"role": "user", "content": "Hello"}],
    reasoning={"effort": "medium"},
)
print(response)