MaaS_Hy
模型规格
| 能力说明 |
上下文窗口 |
最大输入 |
最大输出 |
| 新一代生产力模型,Agent 与复杂任务执行能力全面升级 |
1024k |
960k |
64k |
请求协议
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_Hy_4_preview_20260828 |
| messages |
- |
- |
array[json] |
是 |
聊天上下文,顺序:[system(可选)→ user → assistant → user → ...] |
|
role |
- |
string |
是 |
system / user / assistant / tool |
|
content |
- |
string |
是 |
纯文本;Hy4 不支持 image_url / video_url / file_url |
|
reasoning_content |
- |
string |
否 |
思维链;多轮 + 工具调用时需原样回填 |
|
tool_calls |
- |
array |
否 |
工具调用列表 |
|
tool_call_id |
- |
string |
条件 |
role=tool 时必填 |
| stream |
- |
- |
boolean |
否 |
流式输出(SSE),默认 false |
| stream_options |
- |
- |
object |
否 |
仅 stream=true 生效 |
|
include_usage |
- |
boolean |
否 |
流式最后一 chunk 是否含 usage,默认 false |
| temperature |
- |
- |
float |
否 |
[0.0, 2.0],默认 1.0 |
| top_p |
- |
- |
float |
否 |
(0.0, 1.0],默认 1.0 |
| max_tokens |
- |
- |
integer |
否 |
最大输出 Token,≥ 1,上限 64k |
| max_completion_tokens |
- |
- |
integer |
否 |
同 max_tokens,两者传其一 |
n
|
- |
- |
integer |
否 |
默认 1;思考模式开启时须为 1 |
| stop |
- |
- |
string 或 array |
否 |
停止序列,最多 4 个 |
| seed |
- |
- |
integer |
否 |
随机种子 |
| frequency_penalty |
- |
- |
float |
否 |
[-2.0, 2.0],默认 0 |
| presence_penalty |
- |
- |
float |
否 |
[-2.0, 2.0],默认 0 |
| thinking |
- |
- |
object |
否 |
深度思考;Hy4 默认开启 |
|
type |
- |
string |
条件 |
"enabled" / "disabled" |
|
budget_tokens |
- |
integer |
否 |
思考最大 Token;未指定时自动补 8192 |
| reasoning_effort |
- |
- |
string |
否 |
推理深度;默认 high,支持 none、high |
| response_format |
- |
- |
object |
否 |
响应格式,默认 {"type":"text"} |
|
type |
- |
string |
是 |
text / json_object / json_schema |
|
json_schema |
- |
object |
条件 |
type=json_schema 时必选 |
|
- |
name |
string |
是 |
Schema 名称 |
|
- |
schema |
object |
是 |
JSON Schema |
|
- |
strict |
boolean |
否 |
严格匹配,默认 false |
| tools |
- |
- |
array |
否 |
Function Calling 工具列表 |
|
type |
- |
string |
是 |
固定 "function" |
|
function |
- |
object |
是 |
函数定义 |
|
- |
name |
string |
是 |
函数名 |
|
- |
description |
string |
否 |
函数描述 |
|
- |
parameters |
object |
否 |
JSON Schema 入参 |
| tool_choice |
- |
- |
string 或 object |
否 |
默认 "auto" |
| parallel_tool_calls |
- |
- |
boolean |
否 |
并行工具调用,默认 true |
| user |
- |
- |
string |
否 |
终端用户标识 |
请求示例
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_Hy_4_preview_20260828",
"messages": [
{"role": "user", "content": "你好,请简单介绍一下你自己。"}
],
"stream": false,
"temperature": 0.9,
"reasoning_effort": "high"
}'
响应示例
{
"id": "chatcmpl-xxxxxxxx",
"object": "chat.completion",
"model": "MaaS_Hy_4_preview_20260828",
"created": 1775146513,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "我是混元,是由腾讯开发的大模型...",
"reasoning_content": "用户让我简单介绍一下自己..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 28,
"completion_tokens": 221,
"total_tokens": 249,
"completion_tokens_details": {"reasoning_tokens": 175}
}
}
流式请求示例
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_Hy_4_preview_20260828",
"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}",
)
response = client.chat.completions.create(
model="MaaS_Hy_4_preview_20260828",
messages=[{"role": "user", "content": "你好,请简单介绍一下你自己。"}],
temperature=0.9,
extra_body={"reasoning_effort": "high"},
)
print(response.choices[0].message.content)
OpenAI Responses
请求 URL
POST https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses
请求 Body 参数
| 参数名 |
二级参数 |
类型 |
必填 |
描述 |
| model |
- |
string |
是 |
固定为 MaaS_Hy_4_preview_20260828 |
| input |
- |
string 或 array |
是 |
纯文本 string,或输入条目 array |
| instructions |
- |
string |
否 |
系统/开发者指令 |
| stream |
- |
boolean |
否 |
SSE 流式 |
| max_output_tokens |
- |
number |
否 |
输出 Token 上限(含推理 Token),≥ 1 |
| temperature |
- |
number |
否 |
[0, 2] |
| top_p |
- |
number |
否 |
(0, 1] |
| truncation |
- |
string |
否 |
"auto" / "disabled"(默认) |
| tools |
- |
array |
否 |
工具数组;兼容模式仅支持 function |
| tool_choice |
- |
string 或 object |
否 |
"none" / "auto" / 指定 function |
| parallel_tool_calls |
- |
boolean |
否 |
是否并行调用工具 |
| text |
- |
object |
否 |
输出格式控制 |
|
format |
object |
否 |
text / json_schema / json_object |
| reasoning |
- |
object |
否 |
推理模型配置 |
|
effort |
string |
否 |
"none" / "low" / "medium" / "high" |
|
summary |
string |
否 |
"auto" / "concise" / "detailed" |
| metadata |
- |
object |
否 |
附加元数据(最多 16 对键值) |
请求示例
curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ${your_AK}' \
-d '{
"model": "MaaS_Hy_4_preview_20260828",
"input": "你好,请简单介绍一下你自己。",
"reasoning": {"effort": "high"}
}'
响应示例
{
"id": "resp_xxxxxxxx",
"object": "response",
"created_at": 1741476542,
"status": "completed",
"model": "MaaS_Hy_4_preview_20260828",
"output": [
{
"type": "reasoning",
"summary": [{"type": "summary_text", "text": "用户请求自我介绍..."}]
},
{
"type": "message",
"role": "assistant",
"content": [{"type": "output_text", "text": "我是混元,是由腾讯开发的大模型..."}]
}
],
"usage": {
"input_tokens": 20,
"output_tokens": 221,
"total_tokens": 241
}
}
流式请求示例
curl -X POST 'https://genaiapi.cloudsway.net/v1/ai/{endpoint}/responses' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ${your_AK}' \
-d '{
"model": "MaaS_Hy_4_preview_20260828",
"input": "你好",
"stream": true
}'
SDK 调用方式
from openai import OpenAI
client = OpenAI(
api_key="${your_AK}",
base_url="https://genaiapi.cloudsway.net/v1/ai/{endpoint}",
)
response = client.responses.create(
model="MaaS_Hy_4_preview_20260828",
input="你好,请简单介绍一下 yourself。",
extra_body={"reasoning": {"effort": "high"}},
)
print(response.output_text)
Anthropic Messages
请求 URL
POST https://genaiapi.cloudsway.net/{endpoint}/v1/messages
| 参数名 |
类型 |
必填 |
描述 |
| anthropic-version |
string |
是 |
2023-06-01 |
请求 Body 参数
| 参数名 |
二级参数 |
三级参数 |
四级参数 |
类型 |
必填 |
描述 |
| model |
- |
- |
- |
string |
是 |
固定为 MaaS_Hy_4_preview_20260828 |
| messages |
- |
- |
- |
array[json] |
是 |
对话消息列表,含完整上下文 |
|
role |
- |
- |
string |
是 |
user / assistant |
|
content |
- |
- |
string 或 array |
是 |
纯文本 string,或内容块 array |
|
- |
type |
- |
string |
否 |
text 等 |
|
- |
text |
- |
string |
否 |
type=text 时的文本 |
| system |
- |
- |
- |
string 或 array |
否 |
系统提示词(顶层字段,不在 messages 内) |
| max_tokens |
- |
- |
- |
integer |
是 |
单次输出 Token 上限;思维链计入此限制 |
| stream |
- |
- |
- |
boolean |
否 |
流式 SSE,默认 false |
| temperature |
- |
- |
- |
float |
否 |
[0, 1](Anthropic 范围) |
| top_p |
- |
- |
- |
float |
否 |
(0, 1] |
| top_k |
- |
- |
integer |
否 |
仅从 top K token 采样 |
|
| stop_sequences |
- |
- |
- |
string[] |
否 |
自定义停止序列 |
| tools |
- |
- |
- |
array |
否 |
工具定义(平铺结构) |
|
name |
- |
- |
string |
是 |
工具名称 |
|
description |
- |
- |
string |
否 |
工具描述 |
|
input_schema |
- |
- |
object |
是 |
JSON Schema 入参 |
| tool_choice |
- |
- |
- |
object |
否 |
{"type":"auto"} / none / any / 指定 tool |
| thinking |
- |
- |
- |
object |
否 |
扩展思维链 |
|
type |
- |
- |
string |
条件 |
"enabled" / "disabled" |
|
budget_tokens |
- |
- |
integer |
否 |
思维链 Token 预算 |
请求示例
curl -X POST 'https://genaiapi.cloudsway.net/{endpoint}/v1/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ${your_AK}' \
-H 'anthropic-version: 2023-06-01' \
-d '{
"model": "MaaS_Hy_4_preview_20260828",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "你好,请简单介绍一下你自己。"}
]
}'
响应示例
{
"id": "msg_xxxxxxxx",
"type": "message",
"role": "assistant",
"model": "MaaS_Hy_4_preview_20260828",
"content": [
{"type": "thinking", "thinking": "用户请求自我介绍..."},
{"type": "text", "text": "我是混元,是由腾讯开发的大模型..."}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 28,
"output_tokens": 221
}
}
流式请求示例
curl -X POST 'https://genaiapi.cloudsway.net/{endpoint}/v1/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ${your_AK}' \
-H 'anthropic-version: 2023-06-01' \
-d '{
"model": "MaaS_Hy_4_preview_20260828",
"max_tokens": 1024,
"stream": true,
"messages": [{"role": "user", "content": "你好"}]
}'
SDK 调用方式
import httpx
response = httpx.post(
"https://genaiapi.cloudsway.net/{endpoint}/v1/messages",
headers={
"Authorization": "Bearer ${your_AK}",
"Content-Type": "application/json",
"anthropic-version": "2023-06-01",
},
json={
"model": "MaaS_Hy_4_preview_20260828",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "你好,请简单介绍一下你自己。"}],
},
)
print(response.json())