# Novita AI Seedream 4.0 API | Generate image

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/api-reference/model-apis-seedream-4-0

# Seedream 4.0

POST

/

v3

/

seedream-4.0

Try it

Seedream 4.0

cURL

```
curl --request POST \
--url https://api.novita.ai/v3/seedream-4.0 \
--header 'Authorization: ' \
--header 'Content-Type: ' \
--data '
{
"prompt": "",
"images": [
""
],
"size": "",
"sequential_image_generation": "",
"max_images": 123,
"watermark": true
}
'
```

```
import requests

url = "https://api.novita.ai/v3/seedream-4.0"

payload = {
"prompt": "",
"images": [""],
"size": "",
"sequential_image_generation": "",
"max_images": 123,
"watermark": True
}
headers = {
"Content-Type": "",
"Authorization": ""
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

```
const options = {
method: 'POST',
headers: {'Content-Type': '', Authorization: ''},
body: JSON.stringify({
prompt: '',
images: [''],
size: '',
sequential_image_generation: '',
max_images: 123,
watermark: true
})
};

fetch('https://api.novita.ai/v3/seedream-4.0', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
```

```
"https://api.novita.ai/v3/seedream-4.0",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '',
'images' => [
''
],
'size' => '',
'sequential_image_generation' => '',
'max_images' => 123,
'watermark' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: ",
"Content-Type: "
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
```

```
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.novita.ai/v3/seedream-4.0"

payload := strings.NewReader("{\n \"prompt\": \"\",\n \"images\": [\n \"\"\n ],\n \"size\": \"\",\n \"sequential_image_generation\": \"\",\n \"max_images\": 123,\n \"watermark\": true\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "")
req.Header.Add("Authorization", "")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
```

```
HttpResponse response = Unirest.post("https://api.novita.ai/v3/seedream-4.0")
.header("Content-Type", "")
.header("Authorization", "")
.body("{\n \"prompt\": \"\",\n \"images\": [\n \"\"\n ],\n \"size\": \"\",\n \"sequential_image_generation\": \"\",\n \"max_images\": 123,\n \"watermark\": true\n}")
.asString();
```

```
require 'uri'
require 'net/http'

url = URI("https://api.novita.ai/v3/seedream-4.0")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = ''
request["Authorization"] = ''
request.body = "{\n \"prompt\": \"\",\n \"images\": [\n \"\"\n ],\n \"size\": \"\",\n \"sequential_image_generation\": \"\",\n \"max_images\": 123,\n \"watermark\": true\n}"

response = http.request(request)
puts response.read_body
```

200

```
{
"images": [
""
]
}
```

Seedream 4.0 is a cutting-edge image generation model that provides flexible image creation features, including 4K resolution support. The Seedream 4.0 API enables image generation from both text and other images.

##

[​](#request-headers)

Request Headers

[​](#param-content-type)

Content-Type

string

required

Supports: `application/json`

[​](#param-authorization)

Authorization

string

required

Bearer authentication format, for example: Bearer {{API Key}}.

##

[​](#request-body)

Request Body

[​](#param-prompt)

prompt

string

required

The prompt for image generation.The recommended length is no more than 600 English words. If the prompt is too long, the information may become scattered. The model might ignore details and only concentrate on the main points, resulting in a image with missing elements.

[​](#param-images)

images

string[]

Enter the Base64 encoding or an accessible URL of the image to edit. Supports inputting a single image or multiple images.

-
Image URL: Make sure that the image URL is accessible.

-
Base64 encoding: The format must be `data:image/<image format>;base64,<Base64 encoding>`.

An input image must meet the following requirements:

Image format: jpeg, png

- Aspect ratio (width/height): In the range [1/3, 3]

- Width and height (px): > 14

- Size: No more than 10 MB

- The value of total pixels: No more than 6000×6000

- supports uploading a maximum of 10 reference images.

[​](#param-size)

size

string

Set the specification for the generated image. Two methods are available but cannot be used together.

- Method 1, specify the resolution.

Optional values: `1K`, `2K`, `4K`

- Method 2, specify the width and height of the generated image in pixels.

Default: `2048x2048`

- The value range of total pixels: `[1024x1024, 4096x4096]`

- The aspect ratio value range: `[1/16, 16]`

Recommended width and height:

Aspect ratioWidth and Height Pixel Values1:12048x20484:32304x17283:41728x230416:92560x14409:161440x25603:22496x16642:31664x249621:93024x1296

[​](#param-sequential-image-generation)

sequential_image_generation

string

default:"disabled"

Controls whether to disable the batch generation feature.

- `auto`: In automatic mode, the model automatically determines whether to return multiple images and how many images it will contain based on the user’s prompt.

- `disabled`: Disables batch generation feature. The model will only generate one image.

[​](#param-max-images)

max_images

integer

default:15

Specifies the maximum number of images to generate in this request. This parameter is only effective when `sequential_image_generation` is set to `auto`.Value range: `[1, 15]`

DescriptionThe actual number of generated images is affected by `max_images` and the number of input reference images. Number of input reference images + Number of generated images ≤ 15.

[​](#param-watermark)

watermark

boolean

default:true

Adds a watermark to the generated image.

- `false`: Does not add a watermark.

- `true`: Adds a watermark with the text “AI generated” in the bottom-right corner of the image.

##

[​](#response)

Response

[​](#param-images-1)

images

string[]

An array containing links to download the generated images.

Last modified on September 18, 2025
