Skip to content
FLORA DocsGo to app
Resources

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.

Terminal window
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"
}
FieldRequiredNotes
typeYesOne of image, video, audio, text. Do not pass model families like t2i, i2v, or text-to-image here
promptYesPlain-text description of what to generate
workspace_idYesWorkspace that will be billed. Use the public ID returned by GET /workspaces; it starts with ws_
project_idYesProject the generation attaches to in the canvas. Use the public ID returned by GET /projects; it starts with prj_
modelNoModel 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
paramsNoModel-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.

Follow the poll_url returned in the response. Poll every 2–5 seconds until status is completed or failed.

Terminal window
curl https://app.flora.ai/api/v1/runs/run_abc123 \
-H "Authorization: Bearer sk_live_XXXX"
MethodPathDescription
GET/api/v1/models?type=imageDiscover model IDs to pass as model
POST/api/v1/generateStart a generation
  • type must be exactly image, video, audio, or text.
  • model must be a string endpoint ID from GET /models; if you see Model "..." is not available, list models for the same type and retry with one of the returned IDs.
  • workspace_id and project_id are required for generation requests and must use ws_ / 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.