Skip to main content
POST
https://api.naga.ac
/
v1
/
images
/
edits
Image Edits
curl --request POST \
  --url https://api.naga.ac/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "images[]": [
    null
  ],
  "background": "<string>",
  "n": 123,
  "quality": "<string>",
  "response_format": "<string>",
  "size": "<string>"
}
'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ]
}

Request Parameters

model
string
required
Image editing model.
prompt
string
required
Instructions for the edit.
image
file
Base image file (single).
images[]
file[]
Multiple base images.
mask
file
PNG mask where transparent areas will be replaced.
background
string
Background control (provider-specific).
n
integer
Number of images to generate.
quality
string
Provider-specific quality preset.
response_format
string
default:"url"
Output format (url or b64_json).
size
string
Resolution like 1024x1024.
Note: Provide either image or images[].

Example Request

from openai import OpenAI

client = OpenAI(base_url="https://api.naga.ac/v1", api_key="YOUR_API_KEY")

with open("image.png", "rb") as img:  # Optional: open a mask file  # with open("mask.png", "rb") as m:
    resp = client.images.edit(
        model="gpt-image-1",
        image=img,
        prompt="Make the sky more dramatic and add light rays",
        size="1024x1024",
        n=1,
        response_format="url",  # or "b64_json"  # mask=m,
    )
print(resp.data)

Response

Returns a JSON object with a data array of edited images. Each item contains either:
  • url when response_format = "url", or
  • b64_json when response_format = "b64_json".

Response Fields

created
integer
Unix timestamp of request creation
data
array
Array of edited image objects