Skip to content
EN

即梦4 Chat

方法: POST路径: /v1/chat/completions

请求参数

Header 参数

text
Content-Type
string
必需
示例:
application/json
Authorization
string
可选
默认值:
Bearer {{YOUR_API_KEY}}

Body 参数 application/json

text
model
string
必需
messages
array
[object]
必需
role
string
可选
content
array
[object]
可选
示例
{
"model"
:
"doubao-seedream-4-0-250828"
,
"messages"
:
[
{
"role"
:
"user"
,
"content"
:
[
{
"type"
:
"text"
,
"text"
:
"带个墨镜"
}
,
{
"type"
:
"image_url"
,
"image_url"
:
{
"url"
:
"https://v3.fal.media/files/penguin/XoW0qavfF-ahg-jX4BMyL_image.webp"
}
}
]
,
}
]
}

请求示例代码

Shell

bash
curl --location --request POST '/v1/chat/completions' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "doubao-seedream-4-0-250828",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "带个墨镜"
                },
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://v3.fal.media/files/penguin/XoW0qavfF-ahg-jX4BMyL_image.webp"
                    }
                }
            ],
        }
    ]
}'

返回响应

🟢 200 成功

内容类型: application/json

响应结构

text
object

示例

json
{}