文本转文本
POST /v1/chat/completions{
"error": {
"message": "Invalid signature",
"type": "401"
}
}| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
model | string | 是 | gpt-4.1 | 请求使用的模型 |
messages | array | 是 | - | 对话消息对象数组 |
stream | boolean | 否 | false | 是否流式返回响应 |
messages 数组中的每个消息对象应具有以下结构:| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
role | string | 是 | 消息角色。可以是:user、assistant 或 system |
content | array/string | 是 | 消息内容 |
| 字段 | 类型 | 必填 | 示例 | 描述 |
|---|---|---|---|---|
type | string | 是 | text | 内容类型 |
text | string | 是 | "The positive prompt for the generation." | 当 type 为 text 时的文本内容 |