Aibubu
Visit Aibubu ↗
Generation and models

Create Task

Submit a unified image or video generation task; the server infers the task family from model and returns a task ID.

POST/v1/generations

This is the main public async media task creation endpoint.

Created tasks, charges, and generated assets belong to the API key's workspace and cannot be reassigned with request headers.

You do not need separate image and video create APIs. Call:

POST /v1/generations

The server decides whether the task is image or video based on model.

Overview

ItemDescription
RoutePOST /v1/generations
AuthAuthorization: Bearer sk_aibubu_xxx
IdempotencyStrongly recommended via Idempotency-Key
Request bodyapplication/json
Response201 Created + task object
Result retrievalPoll GET /v1/tasks/{task_id} or wait for webhook

Integration Note

Do not treat this as a synchronous result endpoint. A successful create response usually means the task was accepted, not completed.

Authorizations

Authorization: Bearer sk_aibubu_your_api_key
Content-Type: application/json
Idempotency-Key: gen-demo-001

Header notes

HeaderRequiredDescription
AuthorizationYesBearer sk_aibubu_xxx
Content-TypeYesMust be application/json
Idempotency-KeyStrongly recommendedPrevents duplicate task creation during retries

Body

Required fields

FieldTypeRequiredExampleDescription
modelstringYesgpt-image-2Target model. The server maps it to image or video automatically
promptstringYesA cinematic fashion poster...Generation instruction

Common optional fields

Supported by POST /v1/images/generations, POST /v1/videos/generations, and POST /v1/generations.

FieldTypeRequiredDefaultExampleDescription
callback_urlstringNo-https://example.com/aibubu/callbackPer-task callback URL; must be a public https URL, at most 2048 characters. When the task succeeds, fails, or is canceled, the terminal event is signed with the workspace callback_url signing secret and sent here. Returns callback_secret_required if the workspace has no such secret, or invalid_callback_url if the URL is invalid. See Webhooks

Common image fields

Applies to current public image models. Use schema.fields from GET /v1/models as the source of supported fields and enums.

FieldTypeRequiredDefaultExampleDescription
reference_imagesstring[]No-["https://.../ref1.png"]Reference image URLs. Call Upload Reference Image to get a hosted URL.
aspect_ratiostringNoauto1:1Output aspect ratio; 2.5 variants use this field, while 2.6 Official uses size
resolutionstringNoModel-specific1KOutput resolution
nintegerNo12Number of images requested; ordinary variants are fixed at 1, while 2.6 Official supports 1–4
qualitystringNoModel-specificlowSend only when declared by the model schema; Official variants support auto, low, medium, high, xhigh, and max, while ordinary variants force high
sizestringNo1:11:1Canvas field for 2.6 Official; do not mix it with aspect_ratio
input_modestringNotext_to_imagetext_to_imagetext_to_image or image_edit; editing requires reference_images

GPT Image 2.5/2.6 models

Ordinary Flare/Sunburst variants force high quality and n=1, billed per successful image. Official variants settle five actual token dimensions; 2.5 Official uses aspect_ratio, while 2.6 Official uses size and supports n=1–4.

{
  "model": "gpt-image-2.6-sunburst-official",
  "prompt": "A ceramic coffee cup on a white background",
  "input_mode": "text_to_image",
  "size": "1:1",
  "resolution": "1K",
  "quality": "low",
  "n": 1
}

Flare, Sunburst, and Official variants use distinct model IDs. Read schema.fields from GET /v1/models before sending a request; do not copy fields between models.

Common video fields

Applies to current public video models. Supported fields must come from the selected model's schema in GET /v1/models.

FieldTypeRequiredDefaultExampleDescription
reference_imagesstring[]No-["https://.../ref.png"]Reference image URLs, up to 9 for Seedance 2 models
reference_videosstring[]No-["https://.../ref.mp4"]Reference video URLs, up to 3; may enable input-video billing
input_video_durationnumberNoOutput duration8Actual processed input-video seconds
reference_audiosstring[]No-["https://.../ref.mp3"]Reference audio URLs, up to 3
generate_audiobooleanNotruetrueWhether to generate audio
audiobooleanNofalsefalseKling generated-audio switch; send only when declared by the schema
modestringNoModel-specificproKling quality tier, commonly std, pro, or 4k
first_frame_image_urlstringNo-https://.../first.pngFirst-frame image URL; send only when declared by the schema
last_frame_image_urlstringNo-https://.../last.pngLast-frame image URL; send only when declared by the schema
aspect_ratiostringNoModel-specific16:9Video aspect ratio
resolutionstringNoModel-specific720pVideo resolution
durationintegerNoModel-specific5Duration in seconds

Parameters are model-schema driven. Each model returned by GET /v1/models includes schema.fields with types, required/default values, enum options, and some limits. Do not copy fields between models.

Seedance 2/2.5, Kling 3, and Gemini Omni do not share an identical video contract. Seedance commonly uses duration, resolution, aspect_ratio, and reference media; Kling may additionally declare mode, audio, or sound; Gemini Omni may declare generate_audio. Send these fields only when they appear in the target model's schema.fields.

Seedance review flow

Reference images, videos, and audio for Seedance 2, 2 Fast, 2 Mini, and 2.5 pass through the seedance-private-v1 review policy:

  • Up to 12 reference assets are accepted in total, limited to image and video media types; each field still follows the per-model schema.fields limit.
  • Upload assets first and submit their returned URLs. Do not send local paths or browser-only temporary URLs.
  • If review rejects the request, the task does not reach the upstream provider. Fix the assets and submit a new compliant request instead of retrying the same rejected payload.

This flow applies only to Seedance models that declare reference_review; use the task response for the final review status and error code.

Kling V3 Omni and Kling Video O1 use reference_videos with input_video_duration. With reference videos, Kling V3 Omni requires audio=false; Kling Video O1 has no audio field. Gemini Omni Flash currently exposes only duration=10.

Virtual avatars

seedance-2, seedance-2-fast, and seedance-2-mini support virtual-avatar mode. Upload the source assets first, then submit their returned asset_id values:

{
  "model": "seedance-2",
  "prompt": "A product video with the selected virtual character",
  "avatar_mode": "virtual",
  "avatar_asset_ids": ["asset_01jxyz..."]
}

Up to 5 avatar assets may be submitted. Avatar assets differ from ordinary reference_images: they enter the provider review flow before generation continues. Pending review returns avatar_review_pending; unavailable assets return avatar_reference_invalid; provider setup failures return avatar_provider_unavailable.

External reference video and audio URLs

Upload Reference Image (POST /v1/uploads/images) accepts images only; Upload Reference Media (POST /v1/uploads/files) accepts image, video, and audio files up to 64 MB, and its returned url can be used in the corresponding reference-media fields. You can also host reference_videos and reference_audios on HTTPS URLs that Aibubu can download without cookies or custom headers, remain valid until the task completes, and return the correct Content-Type. Prefer signed URLs valid for several hours. Do not send local paths, blob: URLs, or browser-session-only resources. Limits follow the selected model's schema.fields and upstream validation.

Response

A successful create call returns a submission receipt, not the full task object. Fetch GET /v1/tasks/{task_id} for status, model, result, and error fields.

{
  "created": 1784779200,
  "task_id": "task_01jxyz...",
  "object": "generation.task",
  "progress": 0,
  "billing_transaction_id": "bt_01jxyz..."
}

Response fields

FieldTypeDescription
task_idstringTask ID used for polling and webhook reconciliation
createdintegerUnix creation timestamp
objectstringAlways generation.task
progressintegerProgress at submission response time
billing_transaction_idstringBilling transaction ID for reconciliation; use task_id for task lookup
dataarrayMay appear only if work has already completed; normally absent for async tasks

What to do next

  1. Store task_id
  2. Poll GET /v1/tasks/{task_id}
  3. Or configure workspace webhooks on /console/webhooks (or pass callback_url) and wait for task.succeeded, task.failed, or task.canceled

Verified video duration limits

  • seedance-2, seedance-2-fast, and seedance-2-mini: 4–15 seconds; Mini defaults to 4 seconds, Fast and standard default to 5.
  • seedance-2.5: 4–30 seconds, default 5; supports text, image, first/last-frame, reference-video, video-edit, and audio input modes.
  • grok-video-1.5: 1–6 seconds, default 6; supports first-frame and reference-image modes at 480p/720p.
  • kling-v2.6 and kling-video-o1: 5 or 10 seconds; the kling-v3 family supports 4–15 seconds.
  • gemini-omni-flash and omni-1.1: currently expose 10 seconds only.
  • wan3.0-video and wan3.0-video-prime: 2–30 seconds, default 5; generate_audio currently accepts only "false".

These limits come from the live schemas in both regions; still use GET /v1/models as the source of truth.