cURL
curl --request POST \
--url https://api.ttapi.io/sd/api/v3/images/generations \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"model": "doubao-seedream-5-0-pro-260628",
"prompt": "Vibrant close-up portrait, rich colors",
"size": "2K",
"watermark": false
}
'import requests
url = "https://api.ttapi.io/sd/api/v3/images/generations"
payload = {
"model": "doubao-seedream-5-0-pro-260628",
"prompt": "Vibrant close-up portrait, rich colors",
"size": "2K",
"watermark": False
}
headers = {
"TT-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'TT-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doubao-seedream-5-0-pro-260628',
prompt: 'Vibrant close-up portrait, rich colors',
size: '2K',
watermark: false
})
};
fetch('https://api.ttapi.io/sd/api/v3/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.ttapi.io/sd/api/v3/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-pro-260628',
'prompt' => 'Vibrant close-up portrait, rich colors',
'size' => '2K',
'watermark' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"TT-API-KEY: <api-key>"
],
]);
$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.ttapi.io/sd/api/v3/images/generations"
payload := strings.NewReader("{\n \"model\": \"doubao-seedream-5-0-pro-260628\",\n \"prompt\": \"Vibrant close-up portrait, rich colors\",\n \"size\": \"2K\",\n \"watermark\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TT-API-KEY", "<api-key>")
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.ttapi.io/sd/api/v3/images/generations")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seedream-5-0-pro-260628\",\n \"prompt\": \"Vibrant close-up portrait, rich colors\",\n \"size\": \"2K\",\n \"watermark\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/sd/api/v3/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TT-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doubao-seedream-5-0-pro-260628\",\n \"prompt\": \"Vibrant close-up portrait, rich colors\",\n \"size\": \"2K\",\n \"watermark\": false\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"created": 123,
"data": [
{
"url": "<string>",
"size": "<string>"
}
],
"usage": {
"generated_images": 123,
"total_tokens": 123
}
}Seedream
Text-to-Image (Sync)
Text-to-Image (Sync) - Return generation results directly
POST
/
sd
/
api
/
v3
/
images
/
generations
cURL
curl --request POST \
--url https://api.ttapi.io/sd/api/v3/images/generations \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"model": "doubao-seedream-5-0-pro-260628",
"prompt": "Vibrant close-up portrait, rich colors",
"size": "2K",
"watermark": false
}
'import requests
url = "https://api.ttapi.io/sd/api/v3/images/generations"
payload = {
"model": "doubao-seedream-5-0-pro-260628",
"prompt": "Vibrant close-up portrait, rich colors",
"size": "2K",
"watermark": False
}
headers = {
"TT-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'TT-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'doubao-seedream-5-0-pro-260628',
prompt: 'Vibrant close-up portrait, rich colors',
size: '2K',
watermark: false
})
};
fetch('https://api.ttapi.io/sd/api/v3/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.ttapi.io/sd/api/v3/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-pro-260628',
'prompt' => 'Vibrant close-up portrait, rich colors',
'size' => '2K',
'watermark' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"TT-API-KEY: <api-key>"
],
]);
$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.ttapi.io/sd/api/v3/images/generations"
payload := strings.NewReader("{\n \"model\": \"doubao-seedream-5-0-pro-260628\",\n \"prompt\": \"Vibrant close-up portrait, rich colors\",\n \"size\": \"2K\",\n \"watermark\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TT-API-KEY", "<api-key>")
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.ttapi.io/sd/api/v3/images/generations")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seedream-5-0-pro-260628\",\n \"prompt\": \"Vibrant close-up portrait, rich colors\",\n \"size\": \"2K\",\n \"watermark\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/sd/api/v3/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TT-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"doubao-seedream-5-0-pro-260628\",\n \"prompt\": \"Vibrant close-up portrait, rich colors\",\n \"size\": \"2K\",\n \"watermark\": false\n}"
response = http.request(request)
puts response.read_body{
"model": "<string>",
"created": 123,
"data": [
{
"url": "<string>",
"size": "<string>"
}
],
"usage": {
"generated_images": 123,
"total_tokens": 123
}
}This is the Seedream Image Generation API text-to-image sync endpoint. Generate images only through
prompt without any media files. Returns generation results directly after request, no additional query needed.
Sync Endpoint Description
Sync endpoint returns results directly without polling. All following scenarios use the same endpointPOST /sd/api/v3/images/generations, only parameters differ:
| Scenario | Parameter Difference | Description |
|---|---|---|
| Text-to-Image | Only prompt required | Generate images only through text prompt |
| Image-to-Image | Prompt + image (single) required | Style transfer or content editing based on single reference image, supports transparent background |
| Multi-Image Fusion | Prompt + image (2-10 array) required | Fuse and generate new image based on multiple reference images |
| Layer Decomposition | Prompt + image + layer_decomposition: true required | Decompose image into base image and layers, only 5.0 pro / flash supported |
| Interactive Edit | Prompt + image required | Precisely edit image using coordinates and bounding boxes, only 5.0 pro / flash supported |
Recommended: Async endpoint: Recommended to use async endpoint in production (returns
id, use query endpoint to get results), supports webhook callback notifications, more suitable for large-scale generation scenarios.Authorizations
Get your API key from the TTAPI Dashboard.
Body
application/json
Model name.
Available options:
doubao-seedream-5-0-pro-260628, doubao-seedream-5-0-flash-260915 Text prompt.
Image size. 5.0 pro/flash options: 1K, 1.5K, 2K (default 2K), or specify pixel values.
Available options:
1K, 1.5K, 2K Output image format.
Available options:
png, jpeg Return format. url returns image download link (24h valid), b64_json returns Base64 encoded data.
Available options:
url, b64_json Image alpha channel setting. transparent=transparent background (image-to-image only), opaque=opaque background. Only 5.0 pro/flash supports.
Available options:
transparent, opaque Whether to add watermark. true=Display "AI Generated" in bottom-right, false=Do not add.
Available options:
true, false Example:
false
Prompt optimization config
Show child attributes
Show child attributes
Last modified on October 23, 2026