/images/generations and /messages block until the
model returns; tasks endpoints don’t — submit accepts your
request, returns a task_id in milliseconds, and the actual
generation runs server-side. Poll /tasks/query or stream
state changes over SSE on /tasks/stream/{task_id}.
When to use
- Video generation — every video model is long-running (10–60s+), tasks/submit is the only sane shape
- Batched image generation — fire-and-forget; reconcile results minutes later
- High-concurrency producers — keep your worker pool free from HTTP keep-alives
callback_urlintegrations — register a webhook and skip polling entirely
/messages, /chat/completions, /responses),
use the synchronous endpoints. Tasks are only for the multimodal long-tail.
Request
Headers
Body
Body size cap
/v1/tasks/* bodies are capped at 1 MiB. Generous for any
reasonable params shape including small data:image/...;base64,...
inline images. Bigger inputs should upload to a URL first and pass the
URL in params.
Response
Response fields
Task lifecycle
pending— dispatcher accepted the request, generation hasn’t started yetrunning— the model is generatingcompleted—outputis populated, billing is finalfailed—error_code+error_messageare populated, no billingcancelled— user called/tasks/cancelbefore terminal state
Errors
All errors use the OpenAI envelope shape (even when called withx-api-key).
Idempotency
out_task_id is your idempotency key. The dispatcher de-duplicates by
the tuple (api_key_id, out_task_id). Re-submitting the same combo
with identical params returns the original task_id and current
status — useful for retry-safe client code where a network blip would
otherwise create a duplicate render.
Pricing
Per-second (video) / per-call (image). The full live rate card is at bytespike.ai/pricing — billing only happens oncompleted; failed and cancelled tasks are free.
Next
POST /tasks/query— read a task’s current statePOST /tasks/cancel— abort a non-terminal task