Chat对话API 请求参数示例 xml { "model": "1234567890", // 模型ID "messages": [ { "role": "user", "content": "Hello!" } ] } 请求返回 非流式返回 非流式正常返回 字段名称 二级字段 三级字段 字段类型 描述 id string 唯一标识符 choices string choices列表 index int choice索引 message object 模型生成的消息 role string 对话角色 content string 对话消息内容 finishreason string 模型停止生成标记的原因。 stop: 模型生成遇到自然停止点或提供的停止序列; length: 达到请求中指定的最大标记数; contentfilter:如果由于内容过滤器中的标志而省略了内容 toolcalls/functioncall: 模型调用了函数。 created int Unix时间戳(以秒为单位)。 model string 调用的模型名称。 object string 返回的对象类型。非流式返回始终为:chat.completion usage object 请求使用情况的统计信息。 completiontokens int 生成token数。 prompttokens int 输入token数。 totaltokens int 使用的token总数(prompt + completion)。