Skip to main content
The async dispatcher for ByteSpike’s multimodal catalog (Veo 3.1, Nano Banana, GPT Image, …). Synchronous endpoints like /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_url integrations — register a webhook and skip polling entirely
For real-time chat (/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 yet
  • running — the model is generating
  • completedoutput is populated, billing is final
  • failederror_code + error_message are populated, no billing
  • cancelled — user called /tasks/cancel before terminal state

Errors

All errors use the OpenAI envelope shape (even when called with x-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 on completed; failed and cancelled tasks are free.

Next