---
title: "Start a generation"
method: POST
path: "/generate"
tags: ["Generations"]
---

# Start a generation

`POST /generate`

Starts a model generation using a prompt, workspace, project, optional model, and optional model parameters. 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.

## Request body

- object
  - `type` 'image' | 'video' | 'audio' | 'text', required — Generation type
  - `prompt` string, required — Generation prompt
  - `model` string — Model endpoint ID
  - `workspace_id` string, required — Workspace identifier
  - `project_id` string, required — Project identifier
  - `params` object — Model parameters

## Response `201`

Generation started.

- object
  - `run_id` string, required — Run identifier
  - `type` 'generation' | 'technique' | 'action', required — Run type
  - `model` object, nullable
    - `model_id` string, required — Model identifier
  - `technique` object, nullable
    - `technique_id` string, required — Technique identifier
    - `name` string, required — Technique name
  - `action` object, nullable
    - `action_id` 'split-text' | 'find-and-replace-text' | 'concat-text' | 'ken-burns-video' | 'color-grade-image' | 'change-image-ar' | 'rotate-image' | 'flip-image' | 'color-filter-image' | 'color-tint-image' | 'filter-color-image' | 'blur-image' | 'duplicate-image' | 'side-by-side-composite' | 'add-shape-to-image' | 'generate-shape-image' | 'add-text-to-image' | 'generate-text-image' | 'qr-code-generator' | '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', required — Action identifier
  - `estimated_seconds` integer, nullable, required
  - `charged_cost` number, required — Cost charged in USD
  - `poll_url` string, uri, nullable
  - `project_id` string, nullable — Project identifier

## Other responses

- `400` — 400
- `401` — 401
- `402` — 402
- `403` — 403
- `404` — 404
- `409` — 409
- `429` — 429
- `500` — 500

---

[API](https://skmtc.net/florafauna-ai/apis/flora-ai-api.md) · [All operations](https://skmtc.net/florafauna-ai/apis/flora-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/florafauna-ai/flora-ai-api/versions/2f4a714f8ce9/schema)
