Generations
Start a one-off model generation without a saved technique.
Use generations when you want to run a single model directly — no slug, no saved technique. Pass type, prompt, workspace_id, project_id, and (optionally) a model endpoint ID plus per-model parameters; FLORA queues the run and returns a poll_url.
For repeated workflows with locked-in inputs and post-processing, build a technique instead.
Start a generation
Section titled “Start a generation”curl -X POST https://app.flora.ai/api/v1/generate \ -H "Authorization: Bearer sk_live_XXXX" \ -H "Content-Type: application/json" \ -d '{ "type": "image", "prompt": "A cinematic product photo of a ceramic mug on a sunlit table", "workspace_id": "ws_abc123", "project_id": "prj_abc123", "model": "t2i-flux-2-pro" }'Response (201 Created):
{ "run_id": "run_abc123", "type": "generation", "estimated_seconds": 12, "charged_cost": 0.04, "poll_url": "https://app.flora.ai/api/v1/runs/run_abc123", "model": { "model_id": "t2i-flux-2-pro" }, "project_id": "prj_abc123"}Request fields
Section titled “Request fields”| Field | Required | Notes |
|---|---|---|
type | Yes | One of image, video, audio, text. Do not pass model families like t2i, i2v, or text-to-image here |
prompt | Yes | Plain-text description of what to generate |
workspace_id | Yes | Workspace that will be billed. Use the public ID returned by GET /workspaces; it starts with ws_ |
project_id | Yes | Project the generation attaches to in the canvas. Use the public ID returned by GET /projects; it starts with prj_ |
model | No | Model endpoint ID from GET /models or MCP list_models, for example t2i-flux-2-pro. Do not pass display names or provider model objects. If omitted, the workspace default is used |
params | No | Model-specific parameters (aspect ratio, seed, etc.) — see the model’s reference for accepted keys |
Add an Idempotency-Key header when retrying after a network error; duplicate keys within two hours return idempotency_duplicate. See Idempotency.
Poll for the result
Section titled “Poll for the result”Follow the poll_url returned in the response. Poll every 2–5 seconds until status is completed or failed.
curl https://app.flora.ai/api/v1/runs/run_abc123 \ -H "Authorization: Bearer sk_live_XXXX"Common endpoints
Section titled “Common endpoints”| Method | Path | Description |
|---|---|---|
| GET | /api/v1/models?type=image | Discover model IDs to pass as model |
| POST | /api/v1/generate | Start a generation |
Common validation issues
Section titled “Common validation issues”typemust be exactlyimage,video,audio, ortext.modelmust be a string endpoint ID fromGET /models; if you seeModel "..." is not available, list models for the sametypeand retry with one of the returned IDs.workspace_idandproject_idare required for generation requests and must usews_/prj_public API IDs.
- Generations are async and polling-only — streaming and webhooks aren’t available yet.
- Output URLs are long-lived but not permanent. Download anything you need to keep.
- For a saved workflow with fixed inputs, see Techniques.