Seedream 4 [Direct API]
API для генерации картинок Seedream 4
Запрос
POST https://gptunnel.ru/v1/media/generate
Синхронный запрос вернёт результат сразу от модели.
Пример запроса
import axios from 'axios'
const request = axios({
method: 'POST',
url: 'https://gptunnel.ru/v1/media/generate',
headers: {
// use your API key here
Authorization: 'YOUR_API_KEY',
},
data: {
"model":"seedream-4",
"response_format":"url",
"prompt": "Fine art fashion photography. Full-hight vertical portrait, gorgeous lithe supermodel, intricate orange and white face paint and a matching hood and translucent shawl. Her light skin and bold blue eyeshadow, orange lipstick accentuating features. Soft dreamy atmosphere, thick foggy, muted grey background with swirling mist, bright vibrant colours, futuristic avant-garde style, soft light, soft contrast, soft saturation",
"size": "4K",
"aspect_ratio": "21:9"
},
})
request.then((result) => {
console.log(result)
}).catch((error) => {
console.error(error)
})curl --request POST \
--url https://gptunnel.ru/v1/media/generate \
--header 'Authorization: YOUR_API_KEY' \
--header '{
"model":"seedream-4",
"response_format":"url",
"prompt": "Fine art fashion photography. Full-hight vertical portrait, gorgeous lithe supermodel, intricate orange and white face paint and a matching hood and translucent shawl. Her light skin and bold blue eyeshadow, orange lipstick accentuating features. Soft dreamy atmosphere, thick foggy, muted grey background with swirling mist, bright vibrant colours, futuristic avant-garde style, soft light, soft contrast, soft saturation",
"size": "4K",
"aspect_ratio": "21:9"
}'Параметры запроса
Name
Type
Description
model*
string
Уникальный ID модели
prompt*
string
Промпт запроса
images
Array<string>
Массив ссылок / base64_url изображении для референса
aspect_ratio
string
Соотношение сторон, допустимые значения '1:1', '16:9', '9:16', '4:3', '3:4', '21:9', '9:21'
response_format
string
Формат ответ, допустимые значения 'base64, 'url'
size
string
Размер изображения, допустимые значения '1K', '2K', '3K', '4K'
Заголовки
Name
Type
Description
Authorization*
string
API ключ
Пример успешного ответа
{
"code": 0,
"id": "6901d3a98e0aa613c523cb9d",
"created_at": 1761727401,
"status": "done",
"result": "https://ark-content-generation-v2-ap-southeast-1.tos-ap-southeast-1.volces.com/seedream-4-0/021761727389240f77831a0a17adee8e985c3ef7c2c9d7cc87e8d_0.jpeg?X-Tos-Algorithm=TOS4-HMAC-SHA256&X-Tos-Credential=AKLTYWJkZTExNjA1ZDUyNDc3YzhjNTM5OGIyNjBhNDcyOTQ%2F20251029%2Fap-southeast-1%2Ftos%2Frequest&X-Tos-Date=20251029T084321Z&X-Tos-Expires=86400&X-Tos-Signature=4081af37d922af1c9bc63c928462a5b1f65fb0f8324ddfbd119fc7eb8a3dacba&X-Tos-SignedHeaders=host",
"cost": "8"
}
Ссылка на файл доступна в течение 24 часов. Если вы планируете получить доступ к сгенерированному файлу позже, рекомендуется сохранить его на вашем ресурсе.
Last updated