OptiWaves

Chat Completions API

参考 POST /v1/chat/completions 的消息、流输出、工具和兼容限制。

POST /v1/chat/completions 面向只支持 OpenAI Chat Completions 的客户端。新应用优先使用 Responses API。

最小请求

{
  "model": "auto",
  "messages": [
    { "role": "user", "content": "你好" }
  ]
}

已支持的字段

可使用 model、messages、stream、max_completion_tokens、max_tokens、reasoning_effort、tools、tool_choice、stop、temperature、top_p 和 stream_options.include_usage。

旧版 functions 和 function_call 也会解析,但新接入应当使用 tools 和 tool_choice。

流式输出

当 stream 为 true 时,响应以 chat.completion.chunk 分段返回。文本位于 choices[0].delta.content,思考内容位于 choices[0].delta.reasoning_content,工具调用位于 choices[0].delta.tool_calls。流以 data: [DONE] 结束。

当前限制

  • n 只能为 1
  • response_format.type 为 json_schema 时不支持
  • 使用 json_object 后,仍需在应用中校验返回的 JSON
  • 图片请使用 data URL 格式

下一步

售后群 1055897442

本页