Skip to content

Flux Image Editing

Overview

  • Method: POST
  • Path: /v1/images/edits
  • Content-Type: multipart/form-data
  • Description: This endpoint uses FormData parameters, not JSON.

Supported sizes and ratios

SizeRatio
1024x10241:1
512x10241:2
1024x5122:1
768x5123:2
512x7682:3
960x12803:4
1280x9604:3
720x12809:16
1280x72016:9
576x13449:21
1344x57621:9

Authentication

  • Authorization: Bearer sk-xxx (required)

Request Example

HeaderExampleRequired
Content-Typemultipart/form-dataYes
AuthorizationBearer sk-xxxxYes

Form Fields

ParameterTypeRequiredExampleDescription
imagefile or arrayYes@otter.pngSource image; up to 4 images; png/jpeg; <5MB
promptstringYesChange his clothes to pinkPrompt text; max 1000 chars
modelstringNoflux-kontext-proModel name, supports flux-kontext-pro/flux-kontext-max
output_formatstringNopngOutput format, png/jpeg
sizestringNo9:16Target ratio, e.g., 1:1, 3:4
seedintegerNo12345Random seed
prompt_upsamplingbooleanNotrueWhether to optimize prompt
safety_toleranceintegerNo6Safety tolerance, 0-6

curl Example

bash
curl -X POST "https://api.gpt.ge/v1/images/edits" \
  -H "Authorization: Bearer sk-xxxx" \
  -F "image=@otter.png" \
  -F "prompt=A cute otter baby wearing a beret" \
  -F "model=flux-kontext-pro" \
  -F "size=1024x1024"

Response Example (200)

json
{
  "created": 1589478378,
  "data": [
    { "url": "https://..." },
    { "url": "https://..." }
  ]
}