v1 preview
API REFERENCE/Create a task
API PREVIEWv1

Create a task

Submit asynchronous image, video, or music work.

Platform preview. Real model providers are not connected yet. Requests and prices below describe the intended contract; examples are not live generation results.

POST/v1/tasks

Request body

ParameterTypeBehavior
modelstring · requiredExact model and operation ID.
inputobject · requiredValidated against that model’s schema.
output_countinteger · default 1Images/videos only; 1–4 target items.
fallbackboolean · default falseAuthorizes eligible official fallback.
max_creditsnon-negative integer · optionalMaximum total reservation you accept.

Planned live acceptance

When live execution is enabled, successful acceptance atomically records the operation, result items, credit reservation, and durable scheduling record. HTTP 202 means work is accepted, not that a model has finished.

With output_count=4, you receive one task ID containing four stable items. The worker schedules each item within account and provider limits. There is no guarantee that all four start simultaneously.

During this build, real provider execution is not connected. A request must not manufacture a successful model output or a completed paid generation.

Planned idempotent acceptance

Once live task acceptance is enabled, send Idempotency-Key and retain it with the input. In this build, POST /v1/tasks rejects live execution before creating an operation, so the header does not yet produce a stored operation. Reusing it with the same input refers to the original operation; changing quantity, fallback, or the credit cap should return a conflict. Deliberately generating again requires a new key and a new paid operation.

Was this page useful?Something unclear?