/excel/generate, /word/generate,
/slides/generate, /slides/outline, and the /text/* endpoints) can
execute in two modes.
Sync (default)
The HTTP call blocks until the document is ready, up to a 300-second (5 min) wall-clock ceiling. If the agent is still running at 300s, the request is automatically promoted to async and returns202 with a task_id.
- You’re prototyping and don’t want to build polling yet.
- The prompt is simple enough that you’re confident it’ll land under 300s (single sheet, short memo, small deck).
- Your caller (browser, Zapier, etc.) can hold the connection open.
- The job runs past 300s — common for complex multi-sheet models (5-25 min), long decks, long-form reports, or multi-turn refinement workflows.
- Our server signals an intermediate delay (e.g. pool saturation during peak load).
/tasks/{task_id} exactly as you would for an explicit async
call.
Async
Setasync: true in the request body. Returns immediately with task_id:
- You know the job will be large (full decks, multi-sheet financial models).
- Your caller is a background job worker.
- You want a webhook callback instead of polling.
Task states
| Status | Terminal | Meaning |
|---|---|---|
queued | no | Accepted, waiting for a worker |
running | no | Executing (see phase for sub-state) |
completed | yes | Success; result populated |
failed | yes | Unrecoverable error; error populated |
cancelled | yes | Client cancelled or server shutdown mid-run |
expired | yes | Queued >24h without pickup |
running, the phase field describes sub-steps:
progress (integer 0-100) approximates overall completion. Use it for
progress bars; don’t parse logic off it.
Polling
Polling strategy
- Initial wait: 2–5 seconds. Most tasks transition from
queuedtorunningwithin a second, but the actual work is the long part. - Backoff: linear or exponential, cap at 10s between polls. Polling more aggressively than that doesn’t make the agent finish faster and burns your rate-limit budget.
- Overall timeout: plan for up to 30 minutes for heavy jobs. Financial models, long-form reports with deep research, and decks with many generated charts regularly run 10–25 minutes end-to-end. A task that’s still non-terminal at 30 minutes is worth a support ticket; before that, it’s almost certainly just legitimate work.
Webhooks
Polling is fine for small integrations, but for production workloads use webhooks and let us push the result to you:Which should I use?
End-user triggers a generation from a button click
End-user triggers a generation from a button click
Batch job generates 500 reports overnight
Batch job generates 500 reports overnight
Async + webhooks. Your cron submits 500 async jobs; our webhook
pings your queue when each finishes. Your worker downloads and files
them. Doesn’t hold HTTP connections open.
Your support team issues quick drafts on demand
Your support team issues quick drafts on demand
Sync. A short memo or 1-sheet summary typically lands in
90s-3min — fast enough for a human to wait with a spinner.
Multi-step agent-driven workflow (e.g. draft → review → revise)
Multi-step agent-driven workflow (e.g. draft → review → revise)
Sync each step and reuse
run_id. Subsequent calls are cheaper
because the agent resumes from state — but each step is still a
real agent run (often 60s+), so don’t expect “instant” turns.Full financial model or 20+ slide investor deck
Full financial model or 20+ slide investor deck
Async + webhooks. These jobs commonly take 10–25 minutes.
Blocking on them from a browser doesn’t work; polling for 20+
minutes from a client is wasteful. Submit with
async: true +
webhook_url, then do whatever else you want until we call you.