使用 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 | 是 | 对话消息数组 |
stream | 否 | true 时使用 SSE 流式返回 |
temperature | 否 | 采样参数,是否支持取决于模型 |
max_tokens | 否 | 最大输出 Token 数 |
非流式回复正文通常位于 choices[0].message.content。