Image to Image
API Overview
To simplify the integration of different image generation models、image editing models, OneRouter provides a unified image API.
API Specification
image editing models
curl https://image.onerouter.pro/v1/images/edits \
-H "Content-Type: application/json" \
-H "Authorization: <API_KEY>" \
--data-raw '{
"model": "dreamomni2-image-to-image",
"prompt": "Replace the first image have the same image style as the second image.",
"image_urls": [
"https://resource.trustai.sg/image/generated%2Fonerouter_a146ee8a-1fe2-43ce-803a-fb1e7f3f6949.png",
"https://resource.onerouter.pro/image/generated%2Fonerouter_fe4771ae-d67c-41bb-a366-b07f1411ae06.png"
],
"n": 1,
"output_format": "url"
}'https://image.onerouter.pro/v1/images/editsis the base URL<API_KEY>is your API Key generated in API page.modelis the model name, such asdreamomni2-image-to-image, available model list can be access in Model page.promptis the prompt.image_urlsis the list of URLs of input images for editing.nis the number of images to generate, default value is1.output_formatindicate the output format, default value isurl.b64_jsonurl
Example response
{
"data": [
{
"url": "https://resource.trustai.sg/image/generated%2Fonerouter_a146ee8a-1fe2-43ce-803a-fb1e7f3f6949.png",
"b64_json": "",
"revised_prompt": ""
}
],
"created": 1760177063
}{
"error": {
"message": "error msg.",
"type": "error type (such as content_policy_violation)",
"param": "",
"code": 422
}
}Last updated