curl --request POST \
--url https://api.tikway.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "volcengine/doubao-seedream-4.5",
"prompt": "日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。",
"size": "1024x1024"
}
'import requests
url = "https://api.tikway.ai/v1/images/generations"
payload = {
"model": "volcengine/doubao-seedream-4.5",
"prompt": "日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。",
"size": "1024x1024"
}
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: 'volcengine/doubao-seedream-4.5',
prompt: '日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。',
size: '1024x1024'
})
};
fetch('https://api.tikway.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.tikway.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' => 'volcengine/doubao-seedream-4.5',
'prompt' => '日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。',
'size' => '1024x1024'
]),
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.tikway.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"volcengine/doubao-seedream-4.5\",\n \"prompt\": \"日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。\",\n \"size\": \"1024x1024\"\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.tikway.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"volcengine/doubao-seedream-4.5\",\n \"prompt\": \"日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。\",\n \"size\": \"1024x1024\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tikway.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\": \"volcengine/doubao-seedream-4.5\",\n \"prompt\": \"日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。\",\n \"size\": \"1024x1024\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1788920400,
"data": [
{
"index": 0,
"b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
}
],
"model": "volcengine/doubao-seedream-5.0-pro",
"size": "2048x2048"
}图片生成
Seedream 使用 /v1/images/generations。model 和 prompt 必填,response_format 可选。
| 模型 | 尺寸 | 其他参数 |
|---|---|---|
volcengine/doubao-seedream-5.0-pro | 2K、3K 或合规 WIDTHxHEIGHT | output_format、background、response_format、watermark、optimize_prompt_options |
volcengine/doubao-seedream-4.5 | 2K、4K 或合规 WIDTHxHEIGHT | response_format、watermark、optimize_prompt_options;透明背景能力以账户上游为准 |
透明背景必须同时使用 output_format=png。当前规范没有暴露组图控制和参考图字段。
curl --request POST \
--url https://api.tikway.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "volcengine/doubao-seedream-4.5",
"prompt": "日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。",
"size": "1024x1024"
}
'import requests
url = "https://api.tikway.ai/v1/images/generations"
payload = {
"model": "volcengine/doubao-seedream-4.5",
"prompt": "日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。",
"size": "1024x1024"
}
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: 'volcengine/doubao-seedream-4.5',
prompt: '日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。',
size: '1024x1024'
})
};
fetch('https://api.tikway.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.tikway.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' => 'volcengine/doubao-seedream-4.5',
'prompt' => '日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。',
'size' => '1024x1024'
]),
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.tikway.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"volcengine/doubao-seedream-4.5\",\n \"prompt\": \"日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。\",\n \"size\": \"1024x1024\"\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.tikway.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"volcengine/doubao-seedream-4.5\",\n \"prompt\": \"日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。\",\n \"size\": \"1024x1024\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tikway.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\": \"volcengine/doubao-seedream-4.5\",\n \"prompt\": \"日落时分的群山景色,夕阳映照山峦与天空,光影柔和,画面自然细腻,具有电影感。\",\n \"size\": \"1024x1024\"\n}"
response = http.request(request)
puts response.read_body{
"created": 1788920400,
"data": [
{
"index": 0,
"b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
}
],
"model": "volcengine/doubao-seedream-5.0-pro",
"size": "2048x2048"
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
使用 Doubao Seedream 5.0 Pro 根据文字生成图片。
必填。Forward 公开模型 ID。网关按 doubao/seedream 模型族转发到 OFOX OpenAI Images 兼容接口。
volcengine/doubao-seedream-5.0-pro, volcengine/doubao-seedream-4.5 图片生成提示词。官方建议不超过约 300 个中文字符或 600 个英文单词。
1"一座漂浮在云海上的未来城市,日出时分,电影级光影,建筑细节丰富"
doubao-seedream-5.0:支持 2K 、 3K 或指定宽高像素值;默认 2048x2048 ;总像素范围 [2560x1440, 3072x3072x1.1025] ;宽高比范围 [1/16, 16] 。 doubao-seedream-4.5:支持 2K、4K 或指定宽高像素值;默认 2048x2048;总像素范围 [2560x1440, 4096x4096];宽高比范围 [1/16, 16]。 doubao-seedream-4.0:支持 1K、2K、4K 或指定宽高像素值;默认 2048x2048;总像素范围 [1280x720, 4096x4096];宽高比范围 [1/16, 16]。
auto, 1K, 1.5K, 2K 输出图片格式。透明背景必须使用 png。
png, jpeg 输出背景。transparent 仅可与 output_format=png 一起使用。
opaque, transparent 响应格式。b64_json 返回 Base64;url 返回临时图片链接;默认 b64_json。
b64_json, url 是否在生成图片中添加水印。
响应
Doubao Seedream 5.0 Pro 图片生成成功响应。
图片创建时间,Unix 时间戳,单位为秒。
x >= 0实际执行请求的模型标识。
实际生成尺寸。
^[1-9][0-9]*x[1-9][0-9]*$实际输出格式。
png, jpeg 实际使用的背景类型。
opaque, transparent 本次生成的用量信息。
Hide child attributes
Hide child attributes
输入 token 数。
x >= 0输出 token 数。
x >= 0总 token 数。
x >= 0生成图片数量。
x >= 0