curl --request POST \
--url https://api.evolink.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seedream-5.0-flash",
"prompt": "A serene lake reflecting the beautiful sunset",
"size": "16:9",
"quality": "2K"
}
'import requests
url = "https://api.evolink.ai/v1/images/generations"
payload = {
"model": "doubao-seedream-5.0-flash",
"prompt": "A serene lake reflecting the beautiful sunset",
"size": "16:9",
"quality": "2K"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doubao-seedream-5.0-flash',
prompt: 'A serene lake reflecting the beautiful sunset',
size: '16:9',
quality: '2K'
})
};
fetch('https://api.evolink.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.evolink.ai/v1/images/generations",
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([
'model' => 'doubao-seedream-5.0-flash',
'prompt' => 'A serene lake reflecting the beautiful sunset',
'size' => '16:9',
'quality' => '2K'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.evolink.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"doubao-seedream-5.0-flash\",\n \"prompt\": \"A serene lake reflecting the beautiful sunset\",\n \"size\": \"16:9\",\n \"quality\": \"2K\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.evolink.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seedream-5.0-flash\",\n \"prompt\": \"A serene lake reflecting the beautiful sunset\",\n \"size\": \"16:9\",\n \"quality\": \"2K\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evolink.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doubao-seedream-5.0-flash\",\n \"prompt\": \"A serene lake reflecting the beautiful sunset\",\n \"size\": \"16:9\",\n \"quality\": \"2K\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-seedream5flash",
"model": "doubao-seedream-5.0-flash",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 20
},
"type": "image",
"usage": {
"billing_rule": "per_image",
"credits_reserved": 1.1016,
"user_group": "default"
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: doubao-seedream-5.0-flash",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}Seedream 5.0 Flash Image Generation
- Seedream 5.0 Flash (doubao-seedream-5.0-flash) supports text-to-image, image-to-image, image editing, and other generation modes. Its main parameters match Seedream 5.0 Pro, with faster generation and a lower price
- Billed per image:
1K,1.5K, and2Kcost the same; reference images are free - Asynchronous processing mode, use the returned task ID to query
- Generated image links are valid for 24 hours, please save them promptly
curl --request POST \
--url https://api.evolink.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seedream-5.0-flash",
"prompt": "A serene lake reflecting the beautiful sunset",
"size": "16:9",
"quality": "2K"
}
'import requests
url = "https://api.evolink.ai/v1/images/generations"
payload = {
"model": "doubao-seedream-5.0-flash",
"prompt": "A serene lake reflecting the beautiful sunset",
"size": "16:9",
"quality": "2K"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doubao-seedream-5.0-flash',
prompt: 'A serene lake reflecting the beautiful sunset',
size: '16:9',
quality: '2K'
})
};
fetch('https://api.evolink.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.evolink.ai/v1/images/generations",
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([
'model' => 'doubao-seedream-5.0-flash',
'prompt' => 'A serene lake reflecting the beautiful sunset',
'size' => '16:9',
'quality' => '2K'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.evolink.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"doubao-seedream-5.0-flash\",\n \"prompt\": \"A serene lake reflecting the beautiful sunset\",\n \"size\": \"16:9\",\n \"quality\": \"2K\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.evolink.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seedream-5.0-flash\",\n \"prompt\": \"A serene lake reflecting the beautiful sunset\",\n \"size\": \"16:9\",\n \"quality\": \"2K\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evolink.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doubao-seedream-5.0-flash\",\n \"prompt\": \"A serene lake reflecting the beautiful sunset\",\n \"size\": \"16:9\",\n \"quality\": \"2K\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-seedream5flash",
"model": "doubao-seedream-5.0-flash",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 20
},
"type": "image",
"usage": {
"billing_rule": "per_image",
"credits_reserved": 1.1016,
"user_group": "default"
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: doubao-seedream-5.0-flash",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}Authorizations
##All APIs require Bearer Token authentication##
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header:
Authorization: Bearer YOUR_API_KEY
Body
Image generation model name
doubao-seedream-5.0-flash "doubao-seedream-5.0-flash"
Prompt describing the image you want to generate, or describing how to edit the input image
Language support: In addition to Chinese and English, Seedream 5.0 Flash also supports Russian, Arabic, Filipino, Thai, Turkish, Korean, Malay, Spanish, Portuguese, Indonesian, French, German, Vietnamese and Japanese.
Length limit: Up to 4000 tokens (about 2,600 Chinese characters or 5,000 English words); exceeding it returns 400 and is not billed.
Recommendation: Keep prompts under 300 Chinese characters or 600 English words. A longer prompt still fits the limit but dilutes the information, and the model may miss details, leaving elements out of the image.
"A serene lake reflecting the beautiful sunset"
Size of generated image, supports two formats:
Method 1 - Ratio format:
auto,1:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9,9:21- Works with the
qualityparameter to automatically generate an image at the corresponding aspect ratio and resolution, without manually specifying pixels
Method 2 - Pixel format:
- Width x height, e.g.:
1024x1024,2048x2048 - Total pixel range:
[921600, 4624220] - Aspect ratio range:
[1/16, 16] - Both width and height must be greater than
14px
Defaults to auto when size is omitted. auto means no explicit ratio: the model decides the composition from the prompt, and the output resolution follows the tier set by quality.
"16:9"
Resolution tier, used with the ratio format of size, defaults to 1K.
| Aspect ratio | 1K | 1.5K | 2K |
|---|---|---|---|
1:1 | 1024×1024 | 1536×1536 | 2048×2048 |
2:3 | 832×1248 | 1248×1872 | 1664×2496 |
3:2 | 1248×832 | 1872×1248 | 2496×1664 |
3:4 | 864×1152 | 1344×1792 | 1776×2368 |
4:3 | 1152×864 | 1792×1344 | 2368×1776 |
4:5 | 896×1120 | 1344×1680 | 1792×2240 |
5:4 | 1120×896 | 1680×1344 | 2240×1792 |
9:16 | 800×1424 | 1152×2048 | 1584×2816 |
16:9 | 1424×800 | 2048×1152 | 2816×1584 |
21:9 | 1568×672 | 2352×1008 | 3136×1344 |
9:21 | 672×1568 | 1008×2352 | 1344×3136 |
Billing:
- Billed per image, with the same price for
1K,1.5K, and2K;1.5Kand2Koffer better image quality at no extra charge - Pixel-format
sizeis also billed per image, without pixel-based pricing tiers
1K, 1.5K, 2K "2K"
Prompt optimization strategy, used to set the prompt optimization mode
Options:
standard: Standard mode
Note: Seedream 5.0 Flash only supports standard; passing fast returns 400. Flash already provides faster generation and does not offer a separate fast mode.
standard "standard"
List of reference image URLs for image-to-image generation and image editing
Notes:
- Reference images are free
- Up to
10input images per request - Image size: no more than
30MB - Supported formats:
.jpeg,.jpg,.png,.webp,.bmp,.tiff,.gif,.heic,.heif - Aspect ratio (width/height):
[1/16, 16] - Both width and height must be greater than
14px - Total pixels:
[196, 6000×6000] - Image URLs must be directly accessible to the server or trigger a direct download when accessed (such URLs typically end in an image extension such as
.pngor.jpg)
10[ "https://example.com/image1.png", "https://example.com/image2.png" ]
Output image format
Options:
png: PNG formatjpeg: JPEG format
Note: With background=transparent, output is always png: omitting output_format automatically selects png, while specifying jpeg is rejected.
png, jpeg "jpeg"
Whether to add a watermark to the generated image
false
Transparency channel setting
Options:
opaque: Standard opaque background (default)transparent: Preserve the existing alpha channel of the input image
transparentpreserves the input image’s existing transparent background; it does not remove the background.
Restrictions (only for transparent):
- Exactly 1 input image is required
- The input must be a PNG with at least one transparent pixel; webp, jpeg, other formats, or PNG files without transparent pixels are rejected by the model (failed tasks are fully refunded)
- Output is always png: omitting
output_formatautomatically selects png, while specifyingoutput_format=jpegis rejected
opaque, transparent "opaque"
HTTPS callback address after task completion
Callback Timing:
- Triggered when task is completed, failed, or cancelled
- Sent after billing confirmation is completed
Security Restrictions:
- Only HTTPS protocol is supported
- Callback to internal IP addresses is prohibited (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.)
- URL length must not exceed
2048characters
Callback Mechanism:
- Timeout:
10seconds - Maximum
3retries on failure (retries after1second/2seconds/4seconds) - Callback response body format is consistent with the task query API response format
- Callback address returning 2xx status code is considered successful, other status codes will trigger retry
"https://your-domain.com/webhooks/image-task-completed"
Response
Image generation task created successfully
Task creation timestamp
1757165031
Task ID
"task-unified-1757165031-seedream5flash"
Actual model name used
"doubao-seedream-5.0-flash"
Specific task type
image.generation.task Task progress percentage (0-100)
0 <= x <= 1000
Task status
pending, processing, completed, failed "pending"
Async task information
Show child attributes
Show child attributes
Task output type
text, image, audio, video "image"
Usage and billing information
Show child attributes
Show child attributes