Image to Image (Edits)
SIRAYA Model Router provides a unified API for image editing and transformation. This interface allows you to modify existing images or combine multiple images using natural language prompts.
Parameters below are the ones shared across editing models. For the full, model-specific parameter set of the GPT Image family, see GPT Image (Edits).
Editing models on /v1/images/generations
Qwen Image Edit (qwen-image-edit-spicy) and
Face Swap & Head Swap (face-swap, head-swap) take their input images on
POST /v1/images/generations, not on this endpoint — see their pages.
https://llm.siraya.ai/v1/images/edits
Header
Bearer <API_KEY>).
Body
gpt-image-2, gpt-image-2.5-flare).
png or jpeg).
curl https://llm.siraya.ai/v1/images/edits \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
--data-raw '{
"model": "gpt-image-2",
"prompt": "Replace the first image with the same style as the second image.",
"image_urls": [
"https://example.com/your-image-1.png",
"https://example.com/your-image-2.png"
],
"n": 1
}'
import requests
url = "https://llm.siraya.ai/v1/images/edits"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <API_KEY>"
}
data = {
"model": "gpt-image-2",
"prompt": "Apply the style of the reference image.",
"image_urls": [
"https://example.com/your-image-1.png",
"https://example.com/your-image-2.png"
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Example Response
Image Inputs
The edits endpoint takes images as references, not file uploads — they travel in the application/json body, in image_urls (and mask_url for a mask). Every entry accepts either form:
| Form | Value | When to use |
|---|---|---|
| Public URL | https://example.com/photo.png |
The image is already hosted; the router fetches it. |
| Base64 data URL | data:image/png;base64,<BASE64> |
The image is a local file. |
A data URL is the MIME type plus the base64-encoded bytes — e.g. data:image/png;base64,iVBORw0KGgoAAAANSUhEU... or data:image/jpeg;base64,/9j/4AAQSkZJRg.... Raw base64 without the data: prefix is not accepted.
Sending a local file as base64
import base64
import requests
def to_data_url(path, mime="image/png"):
with open(path, "rb") as f:
return f"data:{mime};base64," + base64.b64encode(f.read()).decode()
response = requests.post(
"https://llm.siraya.ai/v1/images/edits",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer <API_KEY>"
},
json={
"model": "gpt-image-2",
"prompt": "Apply the style of the reference image.",
"image_urls": [to_data_url("base_image.png")]
},
)
print(response.json())
Base64 grows the payload by roughly a third, so prefer URLs for large images or when sending many inputs at once.
Visit the Models Directory to see all supported image-to-image models.