> ## Documentation Index
> Fetch the complete documentation index at: https://docs.geekai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Editing

### Image editing

As with image-to-image generation, supply an image and a text prompt describing the edit:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/edits' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "gpt-image-2",
    "prompt": "Restore this damaged photo",
    "image": "https://static.geekai.co/storage/2025/04/02/broken-picture.jpg"
}'
```

To pass multiple images, use an array of strings:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/edits' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "gpt-image-2",
    "prompt": "Restore this damaged photo",
    "images": ["https://static.geekai.co/storage/2025/04/02/broken-picture.jpg"]
}'
```

### Form uploads

To edit a local image, upload it as `multipart/form-data` form data:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/edits' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--form 'model="gpt-image-2"' \
--form 'prompt="Restore this damaged photo"' \
--form 'image=@/path/to/your/local/image.jpg'
```

To upload multiple images in a form:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/edits' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--form 'model="gpt-image-2"' \
--form 'prompt="Apply the fabric from the first image to the clothing in the second. Use the aspect ratio of the second image."' \
--form 'images[]=@/path/to/your/local/image1.jpg' \
--form 'images[]=@/path/to/your/local/image2.jpg'
```

For image editing parameters, see the [image editing API reference](https://docs.geekai.co/en/api/image/edit.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.