接口参考 / 响应对象

聊天完成对象

参数类型描述
---
idstring聊天完成的唯一标识符
choicesarray聊天完成选项列表。如果n大于1,可以有多个选项
createdinteger创建聊天完成的Unix时间戳(秒)
modelstring用于聊天完成的模型
system_fingerprintstring该指纹表示模型运行的后端配置
objectstring对象类型,总是 chat.completion
usageobject完成请求的使用统计信息
completion_tokensinteger生成的完成中的标记数
prompt_tokensinteger提示中的标记数
total_tokensinteger请求中使用的标记总数(提示 + 完成)

{

  "id": "chatcmpl-123",

  "object": "chat.completion",

  "created": 1677652288,

  "model": "gpt-3.5-turbo-0613",

  "system_fingerprint": "fp_44709d6fcb",

  "choices": [{

    "index": 0,

    "message": {

      "role": "assistant",

      "content": "\n\nHello there, how may I assist you today?",

    },

    "finish_reason": "stop"

  }],

  "usage": {

    "prompt_tokens": 9,

    "completion_tokens": 12,

    "total_tokens": 21

  }

}