VidGuy Docs
Build videos faster with VidGuy
Guides and best practices for turning prompts into platform-ready videos.
Polling
Snack generation is asynchronous. POST /api/v1/snacks returns
immediately with a jobId; you poll GET /api/v1/jobs/{id} until the
job reaches a terminal state.
Recommended flow
POST /api/v1/snackswith abrandId(and optionallyrender: true).- Save the returned
jobIdandpollUrl. - Poll
GET /api/v1/jobs/{id}untilstatusiscompletedorfailed. - On
completed, read the manifest (andresult.renderedAssets[]if you setrender: true).
Recommended interval
- Start at 3-5 seconds. The poll endpoint is cheap and not rate-limited.
- A typical snack job completes in 60-90 seconds (manifest only) or 90-150 seconds with
render: true. - If you don't see a terminal state after 15 minutes, our auto-fail sweeper marks the job
failedand refunds credits — no action needed on your side.
Job states
| State | Meaning |
|---|---|
queued | Accepted; waiting for the Modal worker to pick it up |
processing | Actively running (LLM copy plan + asset matching + optional render) |
completed | Manifest (and rendered assets if requested) ready in result |
failed | Job failed; credits refunded if appropriate. See error |
Polling reference (Node.js)
async function generateSnack(apiKey, brandId, render = false) {
const start = await fetch("https://vidguy.ai/api/v1/snacks", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ brandId, render }),
}).then((r) => r.json());
if (!start.jobId) throw new Error(JSON.stringify(start));
while (true) {
const job = await fetch(`https://vidguy.ai${start.pollUrl}`, {
headers: { Authorization: `Bearer ${apiKey}` },
}).then((r) => r.json());
if (job.status === "completed") return job.result;
if (job.status === "failed") {
throw new Error(`Snack generation failed: ${job.error}`);
}
await new Promise((r) => setTimeout(r, 4000));
}
}
Settlement timing
On the first poll after a job reaches completed, you may briefly
see creditsFinal: null even though status: "completed". The next
poll will show the settled value. This is expected and matches the
behavior of every async offering — there's no double-charge risk.