星海智算开发文档

Create a chat completion

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

POST/v1/chat/completions

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Header Parameters

X-Client-Request-Id?string

Optional visible ASCII client correlation value, at most 512 bytes. It never replaces the server requestId.

Lengthlength <= 512

Request Body

application/json

Response Body

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",        "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  }}