Runs
Start generation and technique runs, then poll for status and outputs.
Runs are asynchronous workflow executions. Create a run, keep the returned run ID or poll URL, then poll until the run reaches completed or failed.
Create a technique run
Section titled “Create a technique run”The slug-based technique run endpoint is the most common path:
curl -X POST https://app.flora.ai/api/v1/techniques/cctv-cam/runs \ -H "Authorization: Bearer sk_live_XXXX" \ -H "Content-Type: application/json" \ -d '{ "inputs": [ { "id": "input_image", "type": "imageUrl", "value": "https://example.com/photo.png" } ], "mode": "async", "idempotency_key": "request-123" }'Response:
{ "runId": "run_...", "status": "pending", "progress": 0, "pollUrl": "https://app.flora.ai/api/v1/techniques/cctv-cam/runs/run_..."}Poll a technique run
Section titled “Poll a technique run”curl https://app.flora.ai/api/v1/techniques/cctv-cam/runs/run_XXXX \ -H "Authorization: Bearer sk_live_XXXX"Poll every 2–5 seconds. Stop when status is completed or failed.
Start a general generation run
Section titled “Start a general generation run”Some workflows use the top-level generation endpoint:
curl -X POST https://app.flora.ai/api/v1/runs/generation \ -H "Authorization: Bearer sk_live_XXXX" \ -H "Content-Type: application/json" \ -d '{ "type": "image", "prompt": "A small blue flower on a white background", "workspace_id": "ws_XXXX", "project_id": "proj_XXXX" }'The response includes a run identifier such as run_id, runId, or id, and may include a workflow_run_id.
Start a top-level technique run
Section titled “Start a top-level technique run”If you already have a technique ID from GET /api/v1/techniques/{slug}, you can also start a run through the top-level technique endpoint:
curl -X POST https://app.flora.ai/api/v1/runs/technique \ -H "Authorization: Bearer sk_live_XXXX" \ -H "Content-Type: application/json" \ -d '{ "technique_id": "tech_XXXX", "workspace_id": "ws_XXXX", "inputs": { "input_image": "https://example.com/photo.png" } }'Run statuses
Section titled “Run statuses”| Status | Meaning |
|---|---|
pending | The run is queued |
running | Work is in progress; check progress |
completed | Outputs are ready |
failed | Check errorCode and errorMessage |
Common endpoints
Section titled “Common endpoints”| Method | Path | Description |
|---|---|---|
| POST | /api/v1/techniques/{slug}/runs | Create a slug-based technique run |
| GET | /api/v1/techniques/{slug}/runs/{runId} | Poll a slug-based technique run |
| POST | /api/v1/runs/generation | Start a general generation run |
| POST | /api/v1/runs/technique | Start a technique run by technique ID |
- Runs are asynchronous. Do not expect final outputs from the create response.
- Use
idempotency_keyfor slug-based technique runs when retrying after network errors. - Permission or credit constraints may return
403 forbiddenor402 insufficient_credits. - Output URLs are long-lived but not permanent. Download anything you need to keep.