跳转至

MaaS_GP_5.5

基本信息

项目 说明
基础URL https://genaiapi.cloudsway.net/v1/
认证方式 Bearer Token (API Key)
响应格式 JSON
请求格式 JSON

请求参数

参数 类型 必填 说明
model string 模型名称
messages array 对话消息列表
temperature float 采样温度 (0-2),默认1.0
top_p float 核采样参数 (0-1),默认1.0
max_tokens int 最大生成token数
stream boolean 是否流式输出,默认false
presence_penalty float -2.0 到 2.0
frequency_penalty float -2.0 到 2.0
seed int 确定性生成种子

GPT 5.5 调用示例

/responses:非流式同步请求

curl "https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/responses" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer {YOUR_API_KEY}" \
    -d '{
        "input": [
            {
                "role": "developer",
                "content": "Talk like a pirate."
            },
            {
                "role": "user",
                "content": "Are semicolons optional in JavaScript?"
            }
        ]
    }'

/responses:流式同步请求

curl "https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/responses" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer {YOUR_API_KEY}" \
    -d '{
        "input": [
            {
                "role": "developer",
                "content": "Talk like a pirate."
            },
            {
                "role": "user",
                "content": "Are semicolons optional in JavaScript?"
            }
        ],
        "stream": true
    }'

/responses:非流式异步请求

curl "https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/responses" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer {YOUR_API_KEY}" \
    -d '{
        "background": true,
        "input": [
            {
                "role": "developer",
                "content": "Talk like a pirate."
            },
            {
                "role": "user",
                "content": "Are semicolons optional in JavaScript?"
            }
        ]
    }'

/responses:流式异步请求

curl "https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/responses" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer {YOUR_API_KEY}" \
    -d '{
        "background": true,
        "stream": true,
        "input": [
            {
                "role": "developer",
                "content": "Talk like a pirate."
            },
            {
                "role": "user",
                "content": "Are semicolons optional in JavaScript?"
            }
        ]
    }'

/responses:获取异步请求结果

curl --location --request GET 'https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/responses/{responseId}' \
--header 'Authorization: Bearer {YOUR_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
}'

/chat/completions

/chat/completions 非流式请求

curl "https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/chat/completions" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer {YOUR_API_KEY}" \
    -d '{
        "input": [
            {
                "role": "developer",
                "content": "Talk like a pirate."
            },
            {
                "role": "user",
                "content": "Are semicolons optional in JavaScript?"
            }
        ]
    }'

响应示例

{
    "id": "chatcmpl-DaF0J1KUc86StE3bCpt3bnopw0KKi",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "Arrr, semicolons in JavaScript be **mostly optional**, but not because the language ignores ’em — because JavaScript has **Automatic Semicolon Insertion**, or **ASI**, which adds semicolons in certain places for ye.\n\nSo this works:\n\n```js\nconst x = 1\nconst y = 2\nconsole.log(x + y)\n```\n\nSame as:\n\n```js\nconst x = 1;\nconst y = 2;\nconsole.log(x + y);\n```\n\nBut beware, matey: ASI can surprise ye.\n\nExample:\n\n```js\nreturn\n{\n  value: 42\n}\n```\n\nJavaScript treats it like:\n\n```js\nreturn;\n{\n  value: 42\n}\n```\n\nSo the function returns `undefined`, not the object.\n\nAnother common danger:\n\n```js\nconst x = 1\n[1, 2, 3].forEach(console.log)\n```\n\nThis can be parsed like:\n\n```js\nconst x = 1[1, 2, 3].forEach(console.log)\n```\n\nwhich be trouble.\n\nA safe version:\n\n```js\nconst x = 1;\n[1, 2, 3].forEach(console.log);\n```\n\nOr, if ye prefer no semicolons, start risky lines with a defensive semicolon:\n\n```js\nconst x = 1\n;[1, 2, 3].forEach(console.log)\n```\n\nSo: **Aye, semicolons are usually optional, but not always harmless to omit.** Many crews either use semicolons consistently or follow a style guide that avoids ASI traps.",
                "annotations": []
            },
            "finish_reason": "stop",
            "native_finish_reason": "stop"
        }
    ],
    "created": 1777529855,
    "model": "MaaS_GP_5.5_20260424",
    "object": "chat.completion",
    "service_tier": "default",
    "usage": {
        "prompt_tokens": 24,
        "completion_tokens": 375,
        "total_tokens": 399,
        "completion_tokens_details": {
            "accepted_prediction_tokens": 0,
            "audio_tokens": 0,
            "image_tokens": 0,
            "reasoning_tokens": 25,
            "rejected_prediction_tokens": 0
        },
        "prompt_tokens_details": {
            "audio_tokens": 0,
            "cached_tokens": 0
        }
    }
}

/chat/completions 流式请求

curl "https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/chat/completions" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer {YOUR_API_KEY}" \
    -d '{
        "messages": [
            {
                "role": "developer",
                "content": "Talk like a pirate."
            },
            {
                "role": "user",
                "content": "Are semicolons optional in JavaScript?"
            }
        ],
        "stream": true
    }'

推理模型

官方网址:https://developers.openai.com/api/docs/guides/reasoning?lang=curl

Effort 最适合……
none 对于延迟敏感型任务,如果无法从任何推理或多链工具调用中获益,gpt-5.5则建议先尝试使用,如果需要low再切换到。常见的应用场景包括语音、快速信息检索和分类。none
low 高效推理,延迟略有增加。非常适合需要使用工具、进行规划、搜索或多步骤决策的应用场景,同时兼顾速度和成本。 常见应用场景包括数据分析、草拟、面向执行的编码以及客户支持/聊天助手工作流程。
medium 当质量和可靠性至关重要,且任务涉及规划、复杂推理和判断时,此方案是理想之选。它是大多数工作负载的默认配置,也是延迟、性能和成本帕累托曲线上的一个平衡点。(默认的推理effort 程度是medium) 常见用例包括智能编码、研究、处理电子表格和幻灯片以及委派长期工作。
high 适用于需要进行复杂推理、复杂调试、深度规划以及高价值任务的情况,在这些任务中,质量和智能比延迟更为重要。推荐用于复杂的工作流程和智能体任务。 常见用例包括智能体编码、长期研究和知识工作。根据任务的复杂性,评估medium两者high。
xhigh 深度研究、异步工作流程和需要长时间部署的代理任务。仅当评估结果显示其优势明显,足以抵消额外的延迟和成本时才使用。 常见用例包括安全和代码审查、企业生产力、深度研究任务以及复杂的编码工作流程。
curl https://genaiapi.cloudsway.net/v1/ai/{endpointPath}/responses
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-5.5",
    "reasoning": {"effort": "medium"},
    "input": "What is the weather like today?"
  }'

返回结果:

{
    "id": "resp_0e2f0fc8cbccc4a70069f2f35639088196b86db02840f771a6",
    "metadata": {},
    "model": "MaaS_GP_5.5_20260424",
    "output": [
        {
            "id": "rs_0e2f0fc8cbccc4a70069f2f356cb2881968a474232d814fc31",
            "type": "reasoning",
            "summary": []
        },
        {
            "id": "msg_0e2f0fc8cbccc4a70069f2f357ced081969f556a82d5e254d2",
            "type": "message",
            "status": "completed",
            "content": [
                {
                    "type": "output_text",
                    "annotations": [],
                    "logprobs": [],
                    "text": "I can help—what city or location would you like the weather for?"
                }
            ],
            "phase": "final_answer",
            "role": "assistant"
        }
    ],
    "temperature": 1.0,
    "tools": [],
    "background": false,
    "reasoning": {
        "effort": "medium"
    },
    "status": "completed",
    "text": {
        "format": {
            "type": "text"
        },
        "verbosity": "medium"
    },
    "truncation": "disabled",
    "usage": {
        "input_tokens": 13,
        "input_tokens_details": {
            "cached_tokens": 0
        },
        "output_tokens": 39,
        "output_tokens_details": {
            "reasoning_tokens": 18
        },
        "total_tokens": 52
    },
    "store": true,
    "created_at": 1777529686,
    "object": "response",
    "parallel_tool_calls": true,
    "tool_choice": "auto",
    "top_p": 0.98,
    "completed_at": 1777529688,
    "prompt_cache_retention": "in_memory",
    "service_tier": "default",
    "top_logprobs": 0,
    "presence_penalty": 0.0,
    "frequency_penalty": 0.0
}