Skip to main content

How do I get the result of an API request?

The Run call returns a task ID right away, and you get the result with Task/Detail, a WebSocket, a callback URL or /sync.

Check the task your Run request created; the Run call itself doesn't wait, and returns a taskid and socketaccesstoken.

  1. Poll POST https://api.wiro.ai/v1/Task/Detail with tasktoken (the socketaccesstoken) or taskid: every 3 seconds at first, less often for long tasks.

  2. Stop when tasklist[0].status is task_postprocess_end or task_cancel, not at task_end, which comes before the file upload. task_error isn't final, so keep waiting (if it never changes, use Task/Kill).

  3. At task_postprocess_end, pexit "0" means success; any other value means it failed. Results are in outputs (text models also in debugoutput); totalcost is the cost.

Or follow the task over a WebSocket, or set a callbackUrl so Wiro POSTs the result when it completes. /sync on the Run URL waits up to 40 minutes; after an HTTP 504 the task keeps running and is billed as usual, so don't run it again.

Did this answer your question?