聊天(Chat)
OpenAI 对话格式(Chat Completions)
接入参考 · OpenAI 对话格式(Chat Completions)
调用前确认
选择与客户端一致的对话协议,不同协议的请求体和响应字段并不相同。先测试非流式文本响应,再启用流式或工具调用。
请求入口
POST /v1/chat/completions
相关协议与参数
具体模型、配额和兼容范围以本站实际启用的服务为准。
协议速查
以下为参考协议的技术字段;对接自有服务前,请核对实际开放的路径与参数。
路径:
/v1/chat/completions
示例中涉及的字段:model、messages、role、content、id、object、created、choices、index、message、refusal、annotations、logprobs、finish_reason。