For the complete documentation index, see llms.txt. This page is also available as Markdown.

Generations

Start a one-off image, video, audio, text or 3D generation with the FLORA API, price it first with a quote, and read the result.

A generation runs one model directly, with no saved Technique. Pass a type, a prompt, the workspace that pays and the project it lands in, plus an optional model ID and parameters; FLORA starts the run, puts it on the project's canvas as a node, and returns a run_id to poll.

For a repeatable workflow with fixed inputs and several steps, build a Technique instead. To train your own style, see Train and use LoRA Styles.

Price it first

Pass quote: true to get an estimate for the exact request without starting anything or reserving money:

curl -X POST https://app.flora.ai/api/v1/generate \
  -H "Authorization: Bearer $FLORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "quote": true,
    "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"
  }'

The response has estimated_cost in US dollars, the assumptions behind it, and an expires_at five minutes out. A quote is an estimate, not a price lock or a balance check. If the model would refuse the inputs (for example, a reference video that is too short), the quote fails with 400 input_validation_error and the reason.

Start a generation

Response (201 Created):

charged_cost is in US dollars: the list price of this exact request, before any plan discount, so treat it as an estimate. The settled cost is on the run once it finishes (Poll for the result). canvas_url opens the project with the new node; use it as returned rather than building project URLs yourself.

Request fields

Field
Required
Notes

type

Yes

image, video, audio, text or model3d. Model families like t2i, i2v or text-to-image aren't types

prompt

Yes

What to generate

workspace_id

Yes

The workspace that pays. A ws_ ID from GET /workspaces

project_id

Yes

The project whose canvas the result lands on. A prj_ ID from GET /projects

model

No

A model ID from GET /models, for example t2i-flux-2-pro. Not a display name. If omitted, FLORA picks the default for the type

params

No

Model parameters, such as aspect_ratio or seed. Each model's accepted names and values are in its params from GET /models

reference_node_ids

No

Canvas nodes in the same project whose outputs feed this generation as image (or 3D) inputs. Video and audio nodes are rejected

callback_url

No

An HTTPS URL that gets a signed callback when the run finishes. See Webhooks

quote

No

true returns an estimate and starts nothing

add_to_canvas

No

Defaults to true. Set false to keep the run off the canvas: node_id comes back null, so you can't pass the run in reference_node_ids. Read its outputs from GET /runs/{runId}

To retry safely after a network error, send an Idempotency-Key header. See Idempotency.

Use your own images

Image-to-image and image-to-video models take a picture as a parameter. Look up the parameter name in the model's params from GET /models (for example image_url or image_urls) and pass a public https:// URL there, ideally a FLORA asset URL. To build on something already on the canvas, pass its node in reference_node_ids instead.

Poll for the result

Read the run at its poll_url (GET /runs/{runId}) until status is completed or failed. Each poll counts against your workspace's rate limit, so wait about 15 seconds between polls; video usually takes several minutes. Or skip polling with a webhook.

A completed run has outputs[].url. A failed run has error_code and error_message; see Errors. GET /generations lists your recent generations, newest first, filtered by workspace_id, project_id or status.

Common endpoints

Method
Path
Description

Common validation issues

  • type must be exactly image, video, audio, text or model3d.

  • model must be an ID string from GET /models. If you see Model "..." is not available, list models for the same type and use one of the returned IDs.

  • workspace_id and project_id are required and must use the ws_ and prj_ prefixes.

Notes

  • Output URLs are long-lived but not permanent. Download anything you need to keep.

  • Generating from an AI client? FLORA MCP's flora_create_generations starts up to 20 at once; see Generate an image or video.

Last updated

Was this helpful?