Skip to content

Start a generation

POST
/generate
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const generation = await client.generations.create({
type: 'image',
prompt: 'A cinematic product photo of a ceramic mug on a sunlit table',
workspace_id: 'ws_abc123',
project_id: 'prj_abc123',
});
console.log(generation);

With quote=true, returns an estimate for the prepared request without reserving credits, creating a node, or starting a generation. Quotes expire after five minutes and do not lock pricing or guarantee admission. Otherwise starts a model generation using type, prompt, workspace_id, project_id, optional model endpoint ID, optional model parameters, and optional reference_node_ids (canvas node UUIDs used as image or model3d inputs; the new node is wired to them with edges). Use type=image|video|audio|text|model3d and model IDs returned by GET /models or list_models. The response includes node_id for the created canvas node. Poll the returned run_id via GET /runs/{runId} for progress and outputs. Mutating public API requests support an optional Idempotency-Key header for client retries; duplicate keys within two hours return idempotency_duplicate.

Error responses use the standard error body.

Media type application/json
object
quote

Return a quote without starting a generation or reserving credits. Requires the generation_quote API capability.

boolean
type
required

Generation type. Use “image”, “video”, “audio”, “text”, or “model3d”; do not pass model families such as “t2i” or “i2v”.

string
Allowed values: image video audio text model3d
prompt
required

Generation prompt

string
>= 1 characters
model

Model endpoint ID, not a display name. Use list_models (or GET /models) to find accessible endpoint IDs for the requested type.

string
workspace_id
required

Workspace identifier. Use the public API ID returned by list workspaces; it must start with ws_.

string
project_id
required

Project identifier. Use the public API ID returned by list projects; it must start with prj_.

string
params

Model parameters

object
key
additional properties
any
reference_node_ids

Canvas node UUIDs or short ids (n7, as returned by flora_get_canvas) whose outputs feed this generation as media inputs. For type=image this is image-to-image chaining (completed image outputs). For type=model3d this accepts image or model3d sources. Each node must be in project_id; use the node_id values from GET /projects/{projectId}/nodes (flora_list_canvas_nodes) or a previous generation’s node_id. The server resolves their URLs, attaches them as the model’s declared media inputs (image_url, image_urls, or model_url — see GET /models), and draws an edge from each source node to the new node. Video and audio sources are rejected with invalid_parameters. A text-to-image model id with references routes to the same model’s image-input sibling when exactly one exists; absent or ambiguous siblings keep the normal invalid_parameters rejection. The response reports the model actually used. @[nodeId] markers in prompt are unioned into this list automatically.

Array<string>
<= 20 items
brand_context

Pinned brand context from GET /brands/{brandId}/context; the server reloads the profile’s rules at that release, appends them to the prompt and attaches the profile’s image assets plus any imagery bank images named in asset_keys as style references. Supported for image generation only.

object
brand_id
required

Brand identifier returned by list brands

string
/^brand_[a-z0-9]+$/
release

Release the rules were read from, such as v3 or brel_abc123; omitted means live

string
/^(v[1-9][0-9]*|brel_[a-z0-9]+)$/
snapshot_id

Older pin from a brand snapshot; a release id is honored, anything else reads live

string
task
required

Task profile key, such as image.generate

string
>= 1 characters <= 64 characters
channel

Optional channel filter

string
>= 1 characters <= 64 characters
modules

Explicit subset of the task profile’s modules. Whole rules are preserved; required dependency modules must also be selected. Omit for the complete profile.

Array<string>
>= 1 items <= 100 items
asset_keys

Image assets to attach: masters the profile includes, and up to three asset_keys from imagery.bank as style references. Omit for every master image the profile includes; bank images never attach unless named. A list replaces that default, so name any masters you still want; an empty array attaches none. Bank images are refused under the bank-only imagery policy

Array<string>
<= 100 items
callback_url

HTTPS URL that receives a signed POST webhook when the run reaches a terminal state (events run.completed / run.failed). The JSON body is HMAC-SHA256 signed via the Flora-Signature header and delivery is retried up to 3 times with exponential backoff. Must be HTTPS and must not resolve to a private/internal host. See docs/system-overviews/webhooks.md for the payload schema and verification example.

string format: uri

Generation started, or a read-only quote returned.

Media type application/json
Any of:
object
run_id
required

Run identifier

string
/^run_\S+$/
type
required

Run type

string
Allowed values: generation technique action
model
Any of:
object
model_id
required

Model identifier

string
>= 1 characters
technique
Any of:
object
technique_id
required

Technique identifier

string
/^tech_\S+$/
name
required

Technique name

string
action
Any of:
object
action_id
required

Action identifier

string
Allowed values: color-grade-image-browser overlay-image-browser draw-image-browser pixel-remover-image-browser magic-eraser-image-browser crop-image-browser scene-3d-image-browser blur-image-browser change-image-ar-browser rotate-image-browser color-filter-image-browser color-tint-image-browser filter-color-image-browser duplicate-image-browser side-by-side-composite-browser add-shape-to-image-browser add-text-to-image-browser qr-code-generator-browser resize-image-browser shader-effect-browser split-text-browser find-and-replace-text-browser concat-text-browser ken-burns-video stitch-videos split-video extract-video-frames color-grade-video video-to-frame-grid boomerang-video reverse-video video-to-long-exposure video-effect color-filter-video speed-up-video slow-down-video duplicate-video greenscreen-video resize-video change-video-ar split-audio-from-video merge-audio-into-video
estimated_seconds
required
Any of:
integer
charged_cost
required

Cost charged in USD

number
poll_url
Any of:
string format: uri
project_id
Any of:

Project identifier

string
/^prj_\S+$/
canvas_url
Any of:
string format: uri
warnings

Warnings for accepted input (unknown parameters and applied preprocessing changes)

Array<object>
object
code
required

Stable warning code

string
message
required

Human-readable warning message

string
field

Feature or parameter the warning relates to

string
node_id
required

Canvas node UUID the generation was seeded on. Pass it as reference_node_ids on a follow-up generation to chain.

string
>= 1 characters
brand

Brand OS brand, release, rules and images this generation runs with

object
brand_id
required

Brand identifier

string
/^brand_\S+$/
version
required

Release version the run read, such as “v3”

string
task
required

Task profile key the run used, such as image.generate

string
surface
required

Where the brand applied: an API or agent generation, a canvas project’s brand step, or render_text

string
Allowed values: api canvas render_text
rules
required

Rules that shaped the run, as ruleKey@vN

Array<string>
attached_asset_keys
required

Brand masters attached as inputs: images, logos and fonts

Array<string>
bank_asset_keys
required

Imagery bank photos used, as style references or painted as they are

Array<string>
imagery

Where the imagery came from: the bank, a model, or both. Absent when the output carries no photo or generated image

string
Allowed values: bank generated mixed
layout

Layout path the output filled

string
prompt_rewritten

Canvas: whether the brand step rewrote the prompt

boolean
Example
{
"run_id": "run_abc123",
"type": "generation",
"model": {
"model_id": "t2i-flux-2-pro"
},
"technique": {
"technique_id": "tech_abcd1234"
},
"action": {
"action_id": "color-grade-image-browser"
},
"project_id": "prj_abc123",
"node_id": "7f6ae6da-4a0e-4a2f-9c6a-2c1c6b8d1f21",
"brand": {
"brand_id": "brand_abc123",
"surface": "api",
"imagery": "bank"
}
}

Generation started, or a read-only quote returned.

Media type application/json
Any of:
object
run_id
required

Run identifier

string
/^run_\S+$/
type
required

Run type

string
Allowed values: generation technique action
model
Any of:
object
model_id
required

Model identifier

string
>= 1 characters
technique
Any of:
object
technique_id
required

Technique identifier

string
/^tech_\S+$/
name
required

Technique name

string
action
Any of:
object
action_id
required

Action identifier

string
Allowed values: color-grade-image-browser overlay-image-browser draw-image-browser pixel-remover-image-browser magic-eraser-image-browser crop-image-browser scene-3d-image-browser blur-image-browser change-image-ar-browser rotate-image-browser color-filter-image-browser color-tint-image-browser filter-color-image-browser duplicate-image-browser side-by-side-composite-browser add-shape-to-image-browser add-text-to-image-browser qr-code-generator-browser resize-image-browser shader-effect-browser split-text-browser find-and-replace-text-browser concat-text-browser ken-burns-video stitch-videos split-video extract-video-frames color-grade-video video-to-frame-grid boomerang-video reverse-video video-to-long-exposure video-effect color-filter-video speed-up-video slow-down-video duplicate-video greenscreen-video resize-video change-video-ar split-audio-from-video merge-audio-into-video
estimated_seconds
required
Any of:
integer
charged_cost
required

Cost charged in USD

number
poll_url
Any of:
string format: uri
project_id
Any of:

Project identifier

string
/^prj_\S+$/
canvas_url
Any of:
string format: uri
warnings

Warnings for accepted input (unknown parameters and applied preprocessing changes)

Array<object>
object
code
required

Stable warning code

string
message
required

Human-readable warning message

string
field

Feature or parameter the warning relates to

string
node_id
required

Canvas node UUID the generation was seeded on. Pass it as reference_node_ids on a follow-up generation to chain.

string
>= 1 characters
brand

Brand OS brand, release, rules and images this generation runs with

object
brand_id
required

Brand identifier

string
/^brand_\S+$/
version
required

Release version the run read, such as “v3”

string
task
required

Task profile key the run used, such as image.generate

string
surface
required

Where the brand applied: an API or agent generation, a canvas project’s brand step, or render_text

string
Allowed values: api canvas render_text
rules
required

Rules that shaped the run, as ruleKey@vN

Array<string>
attached_asset_keys
required

Brand masters attached as inputs: images, logos and fonts

Array<string>
bank_asset_keys
required

Imagery bank photos used, as style references or painted as they are

Array<string>
imagery

Where the imagery came from: the bank, a model, or both. Absent when the output carries no photo or generated image

string
Allowed values: bank generated mixed
layout

Layout path the output filled

string
prompt_rewritten

Canvas: whether the brand step rewrote the prompt

boolean
Example
{
"run_id": "run_abc123",
"type": "generation",
"model": {
"model_id": "t2i-flux-2-pro"
},
"technique": {
"technique_id": "tech_abcd1234"
},
"action": {
"action_id": "color-grade-image-browser"
},
"project_id": "prj_abc123",
"node_id": "7f6ae6da-4a0e-4a2f-9c6a-2c1c6b8d1f21",
"brand": {
"brand_id": "brand_abc123",
"surface": "api",
"imagery": "bank"
}
}