Image-to-Image API
Create an asynchronous image editing task from a prompt and one or more reference images. This same endpoint supports nano, nano2, and nano2pro through the model field.
Authentication
Send your API key as a Bearer token. All image URLs must be publicly accessible.
Authorization: Bearer YOUR_API_KEYModel Selection
Use this same /api/edit endpoint for every image editing model. model is optional only for backward compatibility; new integrations should set it explicitly.
nanoOriginal Nano AI Fast edit backend. Default when model is omitted.
nano2Nano AI 2 image editing through the unified generate worker.
nano2proNano AI 2 Pro editing and multi-image workflows.
Endpoint
The endpoint returns a task_id immediately. Poll /api/status to retrieve the edited image URLs.
Editing instruction for the input image or images.
Publicly accessible image URLs. For nano2pro, up to 14 images are supported.
Supported values: nano, nano2, nano2pro. Defaults to nano.
Output aspect ratio for Nano AI 2 models. Defaults to 1:1.
Resolution. Supported values: 1K, 2K, 4K.
Output image format. Defaults to png.
Example request
{
"prompt": "Place the wristwatch on a marble counter with soft studio lighting",
"images": [
"https://example.com/input-watch.jpg"
],
"model": "nano2pro",
"aspect_ratio": "1:1",
"resolution": "1k",
"output_format": "png"
}Example response
{
"code": 200,
"message": "success",
"task_id": "n82b71e549f645122eb8db5f75af2c11nb2",
"model": "nano2pro",
"data": {
"task_id": "n82b71e549f645122eb8db5f75af2c11nb2",
"type": "edit",
"status": "IN_PROGRESS"
}
}Image Input Notes
nano2proaccepts up to 14 reference image URLs.nano2uses the same unified endpoint and receives image URLs throughimages.- For legacy
nano, the request body is preserved as closely as possible for backward compatibility.
Next Step
Save the returned task_id and poll the status endpoint until the task reaches a final state.
Common Errors
{
"code": 400,
"message": "Bad Request: 'prompt' and 'images' are required.",
"data": null
}