Перейти к основному содержанию

Endpoints

MethodEndpointDescription
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
string
Callback URL, обязателен при request_type=callback (условно)
provider
string
по умолчанию:"auto"
Стратегия маршрутизации: auto, value или official
input
object
обязательно
Параметры входа модели
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

taskId
string
Уникальный идентификатор задачи.
state
string
Текущее состояние задачи: pending, processing, success или failed.
resultJson
string
JSON-строка с массивом resultUrls. Присутствует только при success. Парсите через JSON.parse().
failCode
string
Код ошибки. Присутствует только при state=failed. См. Error Codes.
failMsg
string
Читаемое сообщение об ошибке. Присутствует только при state=failed.
createTime
integer
Timestamp создания задачи (Unix миллисекунды).
completeTime
integer
Timestamp завершения задачи (Unix миллисекунды).
costTime
integer
Длительность обработки в миллисекундах.

Error Codes

CodeDescription
400Неверные параметры или ошибка запроса
401Недействительный или отсутствующий API Key
429Превышен лимит запросов
Fail CodeDescription
CONTENT_VIOLATIONКонтент нарушает правила безопасности
INVALID_IMAGE_URLНе удаётся получить доступ к URL изображения

Rate Limits

LimitValue
Requests60 / minute
Concurrent tasks10
При превышении возвращается ошибка 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.