Image Editing nano-banana
Overview
- Method:
POST - Path:
/v1/images/edits
Authentication
- Use HTTP Bearer Token, e.g.:
Authorization: Bearer sk-xxxxx
Request Parameters (multipart/form-data)
| Parameter | Type | Required | Description |
|---|---|---|---|
| image | file | Yes | 1-6 images, PNG/JPG/WebP |
| prompt | string | Yes | Text description, max 32768 tokens |
| model | string | Yes | nano-banana / gemini-3-pro-image-preview etc. |
| response_format | string | No | b64_json/url |
| size | string | No | 1:1/2:3/3:2/3:4/4:3/4:5/5:4/9:16/16:9/21:9/1k/2k/4k |
| aspect_ratio | string | No | 2:3 etc. (pro series only) |
| n | number | No | 1-10 |
Request Example
bash
curl -X POST "https://api.gpt.ge/v1/images/edits" \
-H "Authorization: Bearer sk-xxxx" \
-F "image=@otter.png" \
-F "mask=@mask.png" \
-F "prompt=A cute otter baby wearing a beret." \
-F "model=nano-banana" \
-F "n=2" \
-F "size=1024x1024"Response Example (200)
json
{
"created": 1725007743,
"data": [{"url": "https://oaidalleapiprod..."}]
}