Skip to main content
POST
/
v1
/
chat
/
completions
对话补全
curl --request POST \
  --url https://api.qhaigc.net/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "messages": [
    {
      "role": "<string>",
      "content": "<string>"
    }
  ],
  "style": "openai",
  "stream": true
}
'

接口描述

该接口用于创建聊天补全任务,支持文本和图片输入(多模态)。

鉴权

需要使用 API Key 进行鉴权。在 Header 中添加 Authorization: Bearer <your-api-key>

请求参数

参数名类型必填描述
modelstring模型名称,例如 gpt-5-mini
messagesarray聊天上下文信息
stylestring接口风格,支持 openai(默认)、claudegemini
streamboolean是否开启流式输出,默认为 false
stream_optionsobject流式输出选项

Messages 参数说明

messages 数组中的每个元素包含:
参数名类型描述
rolestring角色,可以是 user, assistant, system
contentstring/array内容。如果是多模态输入,可以使用数组格式。

Style 参数说明

  • openai:返回 OpenAI Chat Completions 风格结果(默认)
  • claude:返回 Claude Messages 风格结果
  • gemini:返回 Gemini 风格结果

子页面导航

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
required

模型名称

messages
object[]
required
style
enum<string>
default:openai

接口风格,支持 OpenAI、Claude、Gemini

Available options:
openai,
claude,
gemini
stream
boolean

是否流式

Response

200

成功响应 (流式)