YeeHooDevelopers
Developer Docs

Create Task

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

This is the main public async media task creation endpoint.

Created tasks, charges, and generated assets belong to the API key's team 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_yeehoo_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_yeehoo_your_api_key
Content-Type: application/json
Idempotency-Key: gen-demo-001

Header notes

HeaderRequiredDescription
AuthorizationYesBearer sk_yeehoo_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 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
resolutionstringNoModel-specific1KOutput resolution
nintegerNo12Number of images requested
qualitystringNoModel-specificlowSend only when declared by the model schema; regular gpt-image-2 does not support it

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.

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.

External reference video and audio URLs

The public upload endpoint currently accepts images only. Host reference_videos and reference_audios on HTTPS URLs that Yeehoo 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 webhook delivery and wait for task.succeeded, task.failed, or task.canceled