星海智算开发文档

生成对话回复

接口参考来自当前平台公开协议。具体模型的模式和规格请在模型详情中确认。

POST/v1/chat/completions

身份认证

bearerAuth
认证方式Bearer <token>

传入位置: header

请求头参数

X-Client-Request-Id?string

可选客户端关联值,只能包含可见 ASCII,最多 512 字节;不能替代服务端 requestId。

长度length <= 512

请求正文

application/json

响应正文

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

{  "choices": [    {      "finish_reason": "string",      "index": 0,      "message": {        "content": "string",        "reasoning_content": "string",        "role": "string",        "tool_calls": [          {            "function": {              "arguments": "string",              "name": "string"            },            "id": "string",            "type": "string"          }        ]      }    }  ],  "created": 0,  "id": "string",  "model": "string",  "object": "string",  "usage": {    "completion_tokens": 0,    "prompt_tokens": 0,    "total_tokens": 0  }}