图片编辑和以图生图类似,你可以通过传入图片+文本提示对指定图片进行编辑,目前仅 GPT Image 1 模型支持图片编辑,示例代码如下:

curl --location --request POST 'https://geekai.dev/api/v1/images/edits' \
--header 'Content-Type: application/json' \
--header 'Authorization: $GEEKAI_API_KEY' \
--data '{
    "model": "gpt-image-1",
    "prompt": "修复这张破损的照片",
    "image": "https://static.geekai.co/storage/2025/04/02/broken-picture.jpg"
}'

多张图片可以通过字符串数组传递:

curl --location --request POST 'https://geekai.dev/api/v1/images/edits' \
--header 'Content-Type: application/json' \
--header 'Authorization: $GEEKAI_API_KEY' \
--data '{
    "model": "gpt-image-1",
    "prompt": "修复这张破损的照片",
    "image": ["https://static.geekai.co/storage/2025/04/02/broken-picture.jpg"]
}'

更多图片编辑 API 参数细节,请参考画图 API 手册