curl --request POST \
--url https://xcompute.us/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.6-sol",
"messages": [
{
"role": "user",
"content": "你好,请介绍一下你自己"
}
]
}'
{
"id": "chatcmpl_xxx",
"object": "chat.completion"
}
文本生成
通用对话接口
使用 OpenAI Chat Completions 兼容格式调用文本生成模型。
POST
https://xcompute.us
/
v1
/
chat
/
completions
curl --request POST \
--url https://xcompute.us/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.6-sol",
"messages": [
{
"role": "user",
"content": "你好,请介绍一下你自己"
}
]
}'
{
"id": "chatcmpl_xxx",
"object": "chat.completion"
}
- 统一的对话 API 接口,支持所有文本生成模型
- 通过
model参数选择不同的 AI 模型 - 兼容 OpenAI Chat Completions API 格式
支持模型
| 系列 | 支持的模型 ID |
|---|---|
| 文本模型 | 以 模型广场 当前展示的文本模型 ID 为准 |
模型可用性可能随渠道调整,请以 模型广场 中显示的模型 ID 为准。
curl --request POST \
--url https://xcompute.us/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-5.6-sol",
"messages": [
{
"role": "user",
"content": "你好,请介绍一下你自己"
}
]
}'
string
required
模型 ID,例如
gpt-5.6-sol。array
required
对话消息数组。
{
"id": "chatcmpl_xxx",
"object": "chat.completion"
}