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
}
'

接口说明

该页面演示如何使用 OpenAI 风格调用聊天接口。
  • style 固定为 openai
  • 适合使用 OpenAI SDK 或兼容 OpenAI 返回结构的应用

请求示例

curl --location --request POST 'https://api.qhaigc.net/v1/chat/completions' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-5-mini",
    "style": "openai",
    "messages": [
        {
            "role": "user",
            "content": "请用三句话介绍 RAG"
        }
    ],
    "stream": false
}'

相关页面

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

成功响应 (流式)