Skip to main content

Endpoints

MethodEndpointDescription
POST/api/v1/generateTask/seedream-5-0Create generation task
GET/api/v1/statusTask/seedream-5-0Query task status

Authentication

All requests require an API Key in the header:
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
default:"async"
async (polling) or callback (webhook)
callback_url
string
Callback URL, required when request_type=callback (conditional)
provider
string
default:"auto"
Routing strategy: auto, value, or official
input
object
required
Model input parameters
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

Returns taskId on success for subsequent status queries. Success:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Error:
{
  "code": 400,
  "message": "Insufficient credits",
  "data": null
}

GET /api/v1/statusTask/seedream-5-0

Query task execution status and results via 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
Unique task identifier.
state
string
Current task state: pending, processing, success, or failed.
resultJson
string
JSON string containing resultUrls array. Only present on success. Parse with JSON.parse().
failCode
string
Error code. Only present when state is failed. See Error Codes.
failMsg
string
Human-readable error message. Only present when state is failed.
createTime
integer
Task creation timestamp (Unix milliseconds).
completeTime
integer
Task completion timestamp (Unix milliseconds).
costTime
integer
Processing duration in milliseconds.

Error Codes

CodeDescription
400Invalid parameters or request error
401Invalid or missing API Key
429Rate limit exceeded
Fail CodeDescription
CONTENT_VIOLATIONContent violates safety guidelines
INVALID_IMAGE_URLCannot access provided image URL

Rate Limits

LimitValue
Requests60 / minute
Concurrent tasks10
Exceeding limits returns 429 error. Wait and retry.

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 expire after 15 days. Download and store important outputs promptly. For high-concurrency scenarios, use callback mode to avoid frequent polling.