FastAPI
  1. 聊天(Chat)
FastAPI
  • 指南
  • 获取 Base URL 和 API Key
  • 通过 AI 快速生成调用代码
  • 列出模型
    • Models(列出模型)
      GET
  • 聊天(Chat)
    • 所有对话模型均兼容 OpenAI 格式
    • 聊天完成对象
    • 聊天完成块对象
    • Chat(聊天)
      POST
    • Chat(流式返回)
      POST
    • Chat(分析图片)
      POST
    • Chat(分析视频)
      POST
    • Chat(结构化输出)
      POST
    • Chat(兼容Recraftv3)
      POST
    • Chat(指定GPTs)
      POST
    • Chat(生成图片)
      POST
    • Chat(修改图片)
      POST
    • Chat(工具tools调用)
      POST
    • Chat(Claude Thinking)
      POST
    • gpt-3.5-turbo-instruct
      POST
  • 聊天(Responses)
    • Responses API与Chat API对比
    • 创建模型响应
      POST
    • 创建模型响应(流式返回)
      POST
    • 创建模型响应(调用联网
      POST
  • 视频模型
    • 视频生成模型简介
    • Sora2官方格式
      • 创建视频
      • 查询视频进度
  • 绘图模型
    • 生图模型简介
    • OpenAI 聊天格式
      • Chat(生成图片)
      • Chat(修改图片)
    • Nano-banana 官方格式
  1. 聊天(Chat)

聊天完成块对象

参数类型描述
idstring聊天完成的唯一标识符。每个块具有相同的ID
choicesarray聊天完成选项列表。如果n大于1,可以有多个选项
createdinteger创建聊天完成的Unix时间戳(秒)。每个块具有相同的时间戳
modelstring生成完成的模型
system_fingerprintstring该指纹表示模型运行的后端配置
objectstring对象类型,总是 chat.completion.chunk
{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}]}

....

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":" today"},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"?"},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
修改于 2026-01-09 08:51:02
上一页
聊天完成对象
下一页
Chat(聊天)
Built with