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-pro",
"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-pro",
"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-pro',
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-pro',
'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-pro\",\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-pro\",\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-pro\",\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-seedream5pro",
"model": "doubao-seedream-5.0-pro",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image",
"usage": {
"billing_rule": "per_call",
"credits_reserved": 1.8,
"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-pro",
"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 Pro 画像生成
- Seedream 5.0 Pro(doubao-seedream-5.0-pro)モデルはテキストから画像、画像から画像、画像編集などの生成モードに対応
- 非同期処理モード、返却されたタスクIDで照会
- 生成された画像リンクは24時間有効です、お早めに保存してください
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-pro",
"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-pro",
"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-pro',
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-pro',
'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-pro\",\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-pro\",\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-pro\",\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-seedream5pro",
"model": "doubao-seedream-5.0-pro",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image",
"usage": {
"billing_rule": "per_call",
"credits_reserved": 1.8,
"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-pro",
"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"
}
}承認
##すべてのAPIにBearer Token認証が必要です##
APIキーの取得:
APIキー管理ページにアクセスしてAPIキーを取得してください
リクエストヘッダーに追加:
Authorization: Bearer YOUR_API_KEY
ボディ
画像生成モデル名
doubao-seedream-5.0-pro "doubao-seedream-5.0-pro"
生成したい画像を説明するプロンプト、または入力画像の編集方法を説明するプロンプト
対応言語: 中国語・英語のほか、Seedream 5.0 Pro はロシア語、アラビア語、フィリピン語、タイ語、トルコ語、韓国語、マレー語、スペイン語、ポルトガル語、インドネシア語、フランス語、ドイツ語、ベトナム語、日本語にも対応しています。
長さ制限: 最大 4000 トークン(中国語で約 2,600 字、英語で約 5,000 語)。超過した場合は 400 を返し、課金されません。
推奨: 中国語は 300 字、英語は 600 語以内を推奨します。制限内であっても長すぎると情報が分散し、モデルが細部を見落として画面の要素が欠けることがあります。
"A serene lake reflecting the beautiful sunset"
生成画像のサイズ。2つの形式をサポートします:
方法1 - 比率形式:
auto,1:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9,9:21qualityパラメータと組み合わせると、ピクセルを手動で指定せずに、対応する比率と解像度の画像が自動生成されます
方法2 - ピクセル形式:
- 幅x高さ、例:
1024x1024,2048x2048 - 総ピクセル範囲:
[921600, 4624220] - アスペクト比範囲:
[1/16, 16] - 幅と高さはいずれも
14pxより大きい必要があります
size を指定しない場合、デフォルトは auto です。auto は比率を指定しないという意味で、モデルがプロンプトに基づいて構図を判断し、出力解像度は quality で指定した段階に従います。
"16:9"
解像度レベル。size の比率形式と組み合わせて使用します。デフォルトは 1K です。
| 比率 | 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 |
課金について:
1Kと1.5Kは同一価格です。1.5Kの方が高画質のため、1.5Kの利用を推奨しますsizeにピクセル形式を使う場合は、実際の出力総ピクセル数で段階を判定します。2610000以下は低い方の価格、超える場合は高い方の価格になります
1K, 1.5K, 2K "2K"
プロンプト最適化のモードを設定するために使用されるプロンプト最適化戦略
オプション:
standard: 標準モード、より高品質な出力、処理時間が長いfast: 高速モード、処理時間が短く、品質は標準モードよりやや劣ります
standard, fast "standard"
画像から画像への変換および画像編集機能のための参照画像URLリスト
注意:
- 単一リクエストでサポートされる入力画像数:
10画像 - 画像サイズ:
30MB以下 - サポートされる画像形式:
.jpeg,.jpg,.png,.webp,.bmp,.tiff,.gif,.heic,.heif - アスペクト比(幅/高さ)範囲:
[1/16, 16] - 幅と高さ(px)> 14
- 総ピクセル数:
[196, 6000×6000] - 画像URLはサーバーから直接表示可能であるか、アクセス時に直接ダウンロードをトリガーする必要があります(通常、これらのURLは
.png、.jpgなどの画像ファイル拡張子で終わります)
10[
"https://example.com/image1.png",
"https://example.com/image2.png"
]
出力画像フォーマット
オプション:
png: PNG フォーマットjpeg: JPEG フォーマット
注意: background=transparent を指定した場合、出力は常に png になります。同時に output_format=jpeg を指定すると拒否されます。
png, jpeg "jpeg"
生成画像にウォーターマークを追加するかどうか
false
透過チャンネルの切り替え
オプション:
opaque: 通常の不透明な背景(デフォルト)transparent: 入力画像が持つ透過チャンネルを保持します
transparentは入力画像に元からある透過背景を保持するもので、被写体の切り抜きや背景除去を行うものではありません。
制限(transparent のみ):
- 入力画像はちょうど 1 枚必要で、その画像自体が透過チャンネルを持っている必要があります
- 出力は常に png です。同時に
output_format=jpegを指定すると拒否されます - 透過チャンネルに対応しない形式(jpeg など)の入力画像はモデルに拒否されます
opaque, transparent "opaque"
タスク完了後の HTTPS コールバックアドレス
コールバックタイミング:
- タスクが完了、失敗、またはキャンセルされた時にトリガーされます
- 課金確認完了後に送信されます
セキュリティ制限:
- HTTPS プロトコルのみサポート
- 内部 IP アドレスへのコールバックは禁止(127.0.0.1、10.x.x.x、172.16-31.x.x、192.168.x.x など)
- URL の長さは
2048文字以内
コールバックメカニズム:
- タイムアウト:
10秒 - 失敗時最大
3回リトライ(1秒/2秒/4秒後にリトライ) - コールバックレスポンスボディの形式はタスククエリ API のレスポンス形式と一致
- コールバックアドレスが 2xx ステータスコードを返した場合は成功とみなされ、その他のステータスコードはリトライをトリガーします
"https://your-domain.com/webhooks/image-task-completed"
レスポンス
画像生成タスクが正常に作成されました
タスク作成タイムスタンプ
1757165031
タスク ID
"task-unified-1757165031-seedream5pro"
使用された実際のモデル名
"doubao-seedream-5.0-pro"
具体的なタスクタイプ
image.generation.task タスク進捗率(0-100)
0 <= x <= 1000
タスクステータス
pending, processing, completed, failed "pending"
非同期タスク情報
Show child attributes
Show child attributes
タスク出力タイプ
text, image, audio, video "image"
使用量と課金情報
Show child attributes
Show child attributes