接口文档 功能介绍 适用星辰MaaS模型服务平台API通用服务,给用户提供文本生成、文本理解、逻辑推理、数学计算等全场景通用的问答大模型服务能力。其具备文本理解、文本创作生成、逻辑推理、语言翻译、数学计算等多种场景的问答能力。 服务鉴权 服务接口调用时需要严格遵循服务鉴权规则,服务调用鉴权规则请参见:开发指南 签名认证方式。 状态码说明 通用状态码请参考【状态码】中的【网关认证】 字段 类型 说明 code string 状态响应码。 01110001: 请求体参数不符合类型; 01110002: 请求参数不符合规则; 01110003: 模型连接错误; 01110004: 内部错误 message string 错误消息提示 请求参数示例 请求示例 流式请求示例 plaintext { "model": "Chat", "messages": [{ "role": "user", "content": "你是什么模型,能处理什么问题" }], "maxcompletiontokens": 150, "stream": true } 流式响应示例 plaintext data: { "id": "277fd1f21c9e4b15bbbc6f28b0fc62ab", "choices": [{ "finishreason": null, "index": 0, "delta": { "content": "", "role": "assistant", "refusal": null }, "logprobs": null }], "created": 1729666765, "systemfingerprint": null, "model": "aichat", "object": "chat.completion.chunk" } data: { "id": "277fd1f21c9e4b15bbbc6f28b0fc62ab", "choices": [{ "finishreason": null, "index": 0, "delta": { "content": "u4f60u597d" }, "logprobs": null }], "created": 1729666765, "model": "aichat", "systemfingerprint": null, "object": "chat.completion.chunk" } ........中间省略消息块 data: { "id": "277fd1f21c9e4b15bbbc6f28b0fc62ab", "choices": [{ "finishreason": null, "index": 0, "delta": { "content": "uff1f" }, "logprobs": null }], "created": 1729666765, "model": "aichat", "systemfingerprint": null, "object": "chat.completion.chunk" } data: { "id": "277fd1f21c9e4b15bbbc6f28b0fc62ab", "choices": [{ "finishreason": "stop", "index": 0, "delta": {}, "logprobs": null }], "created": 1729666765, "model": "aichat", "systemfingerprint": null, "object": "chat.completion.chunk" } data: { "id": "c86aff51e90442ed8c7e1ab5296189a8", "choices": [], "created": 1729666822, "model": "aichat", "systemfingerprint": null, "object": "chat.completion.chunk", "usage": { "completiontokens": 40, "prompttokens": 23, "totaltokens": 63, "completiontokensdetails": { "reasoningtokens": 0 } } } 此消息块在 streamoption 生效时产生data: [DONE] 非流式请求示例 plaintext { "model": "Chat", "messages": [{ "role": "user", "content": "你是什么模型,能处理什么问题" }], "maxcompletiontokens": 150, "stream": false } 非流式响应示例 plaintext { "id": "aacd0a837f244378812fa898d5094fe2", "choices": [{ "finishreason": "stop", "index": 0, "message": { "refusal": null, "role": "assistant", "content": " 你好,我很乐意为你解答问题。请问有什么我可以帮助你的吗?" }, "logprobs": null }], "created": 1729666692, "model": "aichat", "systemfingerprint": null, "object": "chat.completion", "usage": { "completiontokens": 41, "prompttokens": 23, "totaltokens": 64, "completiontokensdetails": { "reasoningtokens": 0 } } }