图像编辑
Overview
- Method:
POST
- Method:
- Path:
/v1/images/edits
- Path:
- Content-Type:
multipart/form-data
- Content-Type:
Authentication
Authorization: Bearer sk-xxx(required)
Request Example
Header
| Header | Example | Required |
|---|---|---|
| Content-Type | multipart/form-data | Yes |
| Authorization | Bearer sk-xxxx | Yes |
Form Fields
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| model | string | Yes | qwen-image-edit | Model name, recommended qwen-image-edit |
| image | file | Yes | @otter.png | Source image, max 1; JPG/JPEG/PNG/BMP/TIFF/WEBP, <10MB |
| prompt | string | Yes | A cute baby otter wearing a beret. | Description text, max 800 chars |
| negative_prompt | string | No | low resolution, errors, etc. | Content to avoid |
| n | integer | No | 1 | Number of outputs, qwen-image-edit supports 1 only |
| response_format | string | No | url | Return format, url or b64_json |
| seed | integer | No | 0 | Random seed, range [0,2147483647] |
curl Example
bash
curl -X POST "https://api.gpt.ge/v1/images/edits" \
-H "Authorization: Bearer sk-xxxx" \
-F "model=qwen-image-edit" \
-F "image=@otter.png" \
-F "prompt=A cute baby otter wearing a beret."Response Example (200)
json
{
"created": 1757255628,
"data": [
{
"url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/7d/ef/20250907/0eea5e95/36e551bc-216a-4e88-bfa6-72dc738722a6-1.png?Expires=1757861427&OSSAccessKeyId=LTAI5tKPD3TMqf2Lna1fASuh&Signature=mCw%2FUlMTfV1xXrloIg63uXO4Q70%3D"
}
]
}