Endpoints
Method Endpoint Description POST /api/v1/generateTask/seedream-5-0Создание задачи генерации GET /api/v1/statusTask/seedream-5-0Запрос статуса задачи
Authentication
Все запросы требуют API Key в заголовке:
Authorization: Bearer YOUR_API_KEY
Request Body
{
"request_type" : "async" ,
"callback_url" : "https://..." ,
"provider" : "auto" ,
"input" : {
"mode" : "text-to-image" ,
"prompt" : "..." ,
"max_images" : 4 ,
"resolution" : "2K" ,
"aspect_ratio" : "16:9" ,
"sequential_image_generation" : "disabled" ,
"web_search" : false ,
"output_format" : "jpeg" ,
"image_urls" : [ "..." ]
}
}
Parameters
request_type
string
по умолчанию: "async"
async (polling) или callback (webhook)
Callback URL, обязателен при request_type=callback (условно)
provider
string
по умолчанию: "auto"
Стратегия маршрутизации: auto, value или official
Параметры входа модели mode
string
по умолчанию: "text-to-image"
обязательно
text-to-image or image-to-image
Text description, 1-5000 characters
max_images
integer
по умолчанию: "1"
обязательно
Maximum number of images to generate per request, 1-10. Billed per image actually generated.
Reference image URLs, max 14 (required for image-to-image mode) (conditional)
Output resolution: 2K or 3K
1:1, 2:3, 3:2, 4:3, 3:4, 9:16, 16:9, or 21:9
sequential_image_generation
string
по умолчанию: "disabled"
Sequential mode: disabled or auto
web_search
boolean
по умолчанию: "false"
Enable real-time web search to reference up-to-date information during generation
output_format
string
по умолчанию: "jpeg"
Output image format: jpeg or png
Mode Options:
text-to-image — Generate from text description
image-to-image — Generate with reference images
Sequential Image Generation:
disabled — Generate independent images, no relation between them
auto — Intelligently generate sequential images based on max_images, with continuity and coherence
Example
Text-to-Image
curl -X POST "https://api.apixo.ai/api/v1/generateTask/seedream-5-0" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "async",
"provider": "value",
"input": {
"mode": "text-to-image",
"prompt": "a cozy cyberpunk cafe with neon lights, ultra detailed",
"max_images": 4,
"resolution": "2K",
"aspect_ratio": "16:9",
"sequential_image_generation": "disabled",
"output_format": "jpeg"
}
}'
Image-to-Image (Multiple References)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/seedream-5-0" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "async",
"provider": "official",
"input": {
"mode": "image-to-image",
"prompt": "make this scene look like sunrise with warm colors",
"max_images": 3,
"resolution": "3K",
"aspect_ratio": "3:4",
"sequential_image_generation": "auto",
"output_format": "png",
"image_urls": [
"https://example.com/ref1.jpg",
"https://example.com/ref2.jpg"
]
}
}'
Web Search Enabled
curl -X POST "https://api.apixo.ai/api/v1/generateTask/seedream-5-0" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "async",
"provider": "value",
"input": {
"mode": "text-to-image",
"prompt": "latest flagship smartphone design trends 2024",
"max_images": 1,
"resolution": "2K",
"web_search": true,
"output_format": "jpeg"
}
}'
Response
POST /api/v1/generateTask/seedream-5-0
При успехе возвращает taskId для последующих запросов статуса.
Success:
{
"code" : 200 ,
"message" : "success" ,
"data" : {
"taskId" : "task_12345678"
}
}
Error:
{
"code" : 400 ,
"message" : "Insufficient credits" ,
"data" : null
}
GET /api/v1/statusTask/seedream-5-0
Запрос статуса выполнения задачи и результатов по taskId.
curl -X GET "https://api.apixo.ai/api/v1/statusTask/seedream-5-0?taskId=task_12345678" \
-H "Authorization: Bearer YOUR_API_KEY"
Success:
{
"code" : 200 ,
"message" : "success" ,
"data" : {
"taskId" : "task_12345678" ,
"state" : "success" ,
"resultJson" : "{ \" resultUrls \" :[ \" https://r2.apixo.ai/img1.png \" , \" https://r2.apixo.ai/img2.png \" ]}" ,
"createTime" : 1767965610929 ,
"completeTime" : 1767965652317 ,
"costTime" : 41388
}
}
Failed:
{
"code" : 200 ,
"message" : "success" ,
"data" : {
"taskId" : "task_12345678" ,
"state" : "failed" ,
"failCode" : "CONTENT_VIOLATION" ,
"failMsg" : "Content does not meet safety guidelines" ,
"createTime" : 1767965610929 ,
"completeTime" : 1767965652317 ,
"costTime" : 41388
}
}
Status Response Fields
Уникальный идентификатор задачи.
Текущее состояние задачи: pending, processing, success или failed.
JSON-строка с массивом resultUrls. Присутствует только при success. Парсите через JSON.parse().
Код ошибки. Присутствует только при state=failed. См. Error Codes .
Читаемое сообщение об ошибке. Присутствует только при state=failed.
Timestamp создания задачи (Unix миллисекунды).
Timestamp завершения задачи (Unix миллисекунды).
Длительность обработки в миллисекундах.
Error Codes
Code Description 400 Неверные параметры или ошибка запроса 401 Недействительный или отсутствующий API Key 429 Превышен лимит запросов
Fail Code Description CONTENT_VIOLATIONКонтент нарушает правила безопасности INVALID_IMAGE_URLНе удаётся получить доступ к URL изображения
Rate Limits
Limit Value Requests 60 / minute Concurrent tasks 10
При превышении возвращается ошибка 429. Подождите и повторите.
Tips
Generation time :
2K resolution: ~25-35 seconds
3K resolution: ~35-50 seconds
Submit task, wait 20 seconds, then poll every 3 seconds
Callback mode : For high-concurrency or high-resolution generation, use callback mode.
Image expiration : Result URLs are valid for 15 days. Download and store important outputs promptly.
Content moderation : Prompts must comply with content safety guidelines. Violations return CONTENT_VIOLATION.
Resolution selection : Seedream 5.0 supports 2K and 3K. Balance speed and quality based on your needs.
Web search : Set web_search: true to enable real-time web search, ideal for prompts referencing trending topics, latest products, or current events.
Output format : output_format supports jpeg (default) and png. Choose based on downstream requirements.
Batch generation : max_images supports 1-10 images. Billed per image actually generated.
Sequential images :
disabled: Generate independent images, no relation
auto: Intelligently generate sequential images with continuity and coherence
Multiple reference fusion :
image-to-image mode supports up to 14 reference images
Model intelligently combines style, composition, and color
Aspect ratio suggestions :
16:9 / 21:9: Landscape, for banners and desktop wallpapers
9:16: Portrait, for mobile wallpapers and short video covers
1:1: Square, for social media
Image formats : image_urls supports JPG, PNG, WebP, and GIF, max 10MB per image.
Result URLs действительны 15 дней. Скачивайте и сохраняйте важные результаты вовремя. При высокой конкуренции используйте режим callback вместо частого polling.