Skip to main content
This page is the shortest path from “I have an sk- key” to “I have a file with the workflow output on disk”. Three calls:
  1. POST /r/workflows/slug/{slug}/run — submit the task. Returns 202 Accepted with the task_id; the task runs asynchronously, so don’t assert on a 200 status.
  2. GET /r/tasks/{taskId}/events (SSE) or GET /r/tasks/{taskId} (polling) — wait for it to finish.
  3. GET /r/tasks/{taskId}/result — get a download URL.
If you don’t yet have an sk- key, see Generate an API key.

Discover a workflow

The workflow’s parameters array tells you which keys to send in the run request.
Use slug@version (e.g. text-to-image@2) to pin to a specific workflow snapshot.

End-to-end: SSE

The recommended path. The stream closes on terminal state.

End-to-end: polling

Use this when SSE is impractical — restrictive networks, serverless functions with short timeouts, batch jobs that don’t need real-time progress.

Stream task events (SSE)

Full event-type reference and fallback strategy.

Upload input files

Workflows with file parameters take a file_key from the presign endpoint.

Call a container service

Reach long-running services hosted on your team’s agents.

Webhooks

Push delivery of terminal events instead of holding a stream or polling.