使用 OpenAI Chat Completions 兼容格式创建模型回复。

请求

curl https://top.qingyuntop.ai/v1/chat/completions \
  -H "Authorization: Bearer $QINGYUN_TOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model-id",
    "messages": [{"role": "user", "content": "你好"}],
    "stream": false
  }'
字段必填说明
model/v1/models 返回的模型 ID
messages对话消息数组
streamtrue 时使用 SSE 流式返回
temperature采样参数,是否支持取决于模型
max_tokens最大输出 Token 数

非流式回复正文通常位于 choices[0].message.content