DreamImage 2.0

POSThttps://api.newportai.com/api/async/dreamimage_2.0

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.

  • Submit a POST request to the DreamImage 2.0 API to obtain a taskId.
  • Submit a POST request to the Polling API to retrieve the editing results.
  • Configure a Callback URL to receive results automatically on completion.

Request Headers

Content-Type string Required

Enum: application/json

Authorization string Required

Bearer authentication token. Example: Bearer {{APIKey}}.

Request Body

image string Required

The URL of the input image to be edited. It must be publicly accessible. Supported formats include JPG, JPEG, PNG, and WEBP.

prompt string Required

A natural language description of the desired edit. The model will modify the input image according to the prompt while preserving the original structure.

Response

code integer

Returns 0 for success, or a specific error code.

message string

Returns "success" or a descriptive error message.

data object
taskId string

The unique identifier for the task. Use this ID with the Polling API to retrieve the edited image.

Errors

10192parameter error; parameter validation failed

Polling

Use the Polling API to retrieve the processing results.

Callback

Alternatively, you can enable Callback to receive task results automatically upon completion.

0Task Completed
{
    "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
        }
    }
}
Request
cURL
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"
}'
0Successful
{
    "code": 0,
    "message": "success",
    "data": {
        "taskId": "e4a8b3c1d2f94a5e8b7c6d5e4f3a2b1c"
    }
}