Handling async tasks
Tool requests return immediately. You choose how to get the result.
Media generation (images, video, audio) takes anywhere from a few seconds to a couple of minutes. Rather than holding a connection open for that entire time, the VideoGen API returns a response instantly with an execution id. You then choose how to receive the result: poll for it, or let us push it to you via a webhook.
How it works
Every POST /v1/tools/... endpoint returns 202 Accepted with a toolExecutionId. The execution progresses through these statuses:
succeeded, failed, and cancelled are terminal statuses. The execution won’t change after reaching one of these.
Getting the result
There are two ways to know when an execution finishes:
Cancellation
You can cancel an in-progress execution at any time:
If the execution hasn’t completed yet, its status will transition to cancelled.