The DreamImage 2.0 API enables AI-powered image editing using natural language prompts. Given an input image and a text description of the desired edit, the model generates a modified version of the image that reflects the requested changes while preserving the original structure and content.
taskId.Enum: application/json
Bearer authentication token. Example: Bearer {{APIKey}}.
The URL of the input image to be edited. It must be publicly accessible. Supported formats include JPG, JPEG, PNG, and WEBP.
A natural language description of the desired edit. The model will modify the input image according to the prompt while preserving the original structure.
Returns 0 for success, or a specific error code.
Returns "success" or a descriptive error message.
The unique identifier for the task. Use this ID with the Polling API to retrieve the edited image.
Use the Polling API to retrieve the processing results.
Alternatively, you can enable Callback to receive task results automatically upon completion.
{
"code": 0,
"message": "success",
"data": {
"images": [
{
"imageType": "png",
"imageUrl": "https://dreamapi-rs.newportai.com/dreamapi/o/2026-07-27/c7b80885a20f44b8a4266f2a1ab7594a.png"
}
],
"task": {
"taskId": "API-65db579fa8f146ff82c73d5075fa7fcc",
"status": 3,
"errorCode": 0,
"reason": "ok",
"taskType": "gemma4_image_edit",
"executionTime": 35054,
"expire": 1785140144982,
"creditsConsumed": 10
}
}
}curl -X POST 'https://api.newportai.com/api/async/dreamimage_2.0' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {{key}}' \
-d '{
"image": "https://d2t5pyzt5qvy2d.cloudfront.net/api/static_resource/prod/default/INj5UrnnrKIzCR1uYBWv0.png",
"prompt": "Replace the background with a beach sunset scene"
}'{
"code": 0,
"message": "success",
"data": {
"taskId": "e4a8b3c1d2f94a5e8b7c6d5e4f3a2b1c"
}
}