---
title: Generations | FLORA API
description: 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](/guides/techniques/index.md) instead.

## Start a generation

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"
}
```

## 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](/platform/idempotency/index.md).

## Poll for the result

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"
```

## 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

- `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.

## Notes

- 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](/guides/techniques/index.md).
