Omni API
Omni API Docs

Tasks

Task lifecycle, queue position, cancellation, and compensation.

Tasks

Tasks are the common unit for image, video, and future model groups.

Lifecycle

Status Meaning
pending The task was accepted and is waiting for a worker.
running A worker has started processing the task.
completed Outputs are ready.
failed The task failed. User-facing pages hide detailed internal errors.
canceled The task was canceled and eligible credits can be returned automatically.

Queue position

Low-priority tasks can wait behind higher-priority work. GET /api/omni/tasks/{portal_task_id} returns a queue object only while the task is still waiting for a worker. Running tasks and terminal tasks omit it.

The queue position is scoped to the same model group, task kind, and duration class. Higher-priority tasks are counted ahead of lower-priority tasks, and same-priority tasks are ordered by queue-ready time.

Example pending-task detail shape:

{
  "data": {
    "task": {
      "portal_task_id": "portal_task_...",
      "status": "pending",
      "queue": {
        "position": 8,
        "ahead_count": 7,
        "higher_priority_ahead": 2,
        "same_priority_ahead": 5,
        "estimated_wait_seconds": 96
      }
    },
    "queue": {
      "position": 8,
      "ahead_count": 7,
      "higher_priority_ahead": 2,
      "same_priority_ahead": 5,
      "estimated_wait_seconds": 96
    }
  }
}

Use the single-task detail endpoint when you need queue position. The batch status endpoint is optimized for lightweight polling and does not guarantee queue ranking.

Priority

Tasks use three priority ranks:

  • 0: Eco image tasks.
  • 1: normal fast-credit tasks.
  • 2: boosted tasks after the extra boost charge is charged.

Omni Video AIO and Omni Multi AIO always submit fast-credit tasks. Omni Image AIO can submit fast or Eco tasks. Workers sample priority buckets instead of always draining the highest bucket, so low-priority work is slower but should not starve.

Cancellation and compensation

Pending tasks can be canceled before a worker claims them; cancellation and the full eligible credit compensation commit together. Users cannot cancel running tasks. Failed tasks and runtime deadline failures automatically compensate eligible charged credits exactly once. There is no queue timeout and no manual compensation action.