# Runs

## Start a generation run

**post** `/runs/generation`

Starts a model generation run in a project canvas using type, prompt, workspace_id, project_id, optional model endpoint ID, and optional model parameters. Use type=image|video|audio|text and model IDs returned by GET /models or list_models. Mutating public API requests support an optional Idempotency-Key header for client retries; duplicate keys within two hours return idempotency_duplicate.

### Body Parameters

- `project_id: string`

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

- `prompt: string`

  Generation prompt

- `type: "image" or "video" or "audio" or "text"`

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

  - `"image"`

  - `"video"`

  - `"audio"`

  - `"text"`

- `workspace_id: string`

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

- `model: optional string`

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

- `params: optional map[unknown]`

  Model parameters

### Returns

- `charged_cost: number`

  Cost charged in USD

- `estimated_seconds: number`

- `run_id: string`

  Run identifier

- `type: "generation" or "technique" or "action"`

  Run type

  - `"generation"`

  - `"technique"`

  - `"action"`

- `action: optional object { action_id }`

  - `action_id: "split-text" or "find-and-replace-text" or "concat-text" or 34 more`

    Action identifier

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

- `model: optional object { model_id }`

  - `model_id: string`

    Model identifier

- `poll_url: optional string`

  URL to poll pending/running runs or fetch completed/failed run details.

- `project_id: optional string`

  Project identifier

- `technique: optional object { name, technique_id }`

  - `name: string`

    Technique name

  - `technique_id: string`

    Technique identifier

### Example

```http
curl https://app.flora.ai/api/v1/runs/generation \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $FLORA_API_KEY" \
    -d '{
          "project_id": "prj_abc123",
          "prompt": "A cinematic product photo of a ceramic mug on a sunlit table",
          "type": "image",
          "workspace_id": "ws_abc123"
        }'
```

#### Response

```json
{
  "charged_cost": 0,
  "estimated_seconds": 0,
  "run_id": "run_abc123",
  "type": "generation",
  "action": {
    "action_id": "split-text"
  },
  "model": {
    "model_id": "t2i-flux-2-pro"
  },
  "poll_url": "https://example.com",
  "project_id": "prj_abc123",
  "technique": {
    "name": "name",
    "technique_id": "tech_abcd1234"
  }
}
```

## Start a top-level technique run

**post** `/runs/technique`

Starts a technique run through the normalized top-level run resource using technique_id, workspace_id, and inputs. technique_id must use the tech_ public API ID returned by list techniques. Mutating public API requests support an optional Idempotency-Key header for client retries; duplicate keys within two hours return idempotency_duplicate.

### Body Parameters

- `inputs: map[unknown]`

  Technique inputs

- `technique_id: string`

  Technique identifier. Use the public API ID returned by list techniques; it must start with tech_.

- `workspace_id: string`

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

### Returns

- `charged_cost: number`

  Cost charged in USD

- `estimated_seconds: number`

- `run_id: string`

  Run identifier

- `type: "generation" or "technique" or "action"`

  Run type

  - `"generation"`

  - `"technique"`

  - `"action"`

- `action: optional object { action_id }`

  - `action_id: "split-text" or "find-and-replace-text" or "concat-text" or 34 more`

    Action identifier

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

- `model: optional object { model_id }`

  - `model_id: string`

    Model identifier

- `poll_url: optional string`

  URL to poll pending/running runs or fetch completed/failed run details.

- `project_id: optional string`

  Project identifier

- `technique: optional object { name, technique_id }`

  - `name: string`

    Technique name

  - `technique_id: string`

    Technique identifier

### Example

```http
curl https://app.flora.ai/api/v1/runs/technique \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $FLORA_API_KEY" \
    -d '{
          "inputs": {
            "foo": "bar"
          },
          "technique_id": "tech_abcd1234",
          "workspace_id": "ws_abc123"
        }'
```

#### Response

```json
{
  "charged_cost": 0,
  "estimated_seconds": 0,
  "run_id": "run_abc123",
  "type": "generation",
  "action": {
    "action_id": "split-text"
  },
  "model": {
    "model_id": "t2i-flux-2-pro"
  },
  "poll_url": "https://example.com",
  "project_id": "prj_abc123",
  "technique": {
    "name": "name",
    "technique_id": "tech_abcd1234"
  }
}
```

## Domain Types

### Run Start Generation Response

- `RunStartGenerationResponse object { charged_cost, estimated_seconds, run_id, 6 more }`

  - `charged_cost: number`

    Cost charged in USD

  - `estimated_seconds: number`

  - `run_id: string`

    Run identifier

  - `type: "generation" or "technique" or "action"`

    Run type

    - `"generation"`

    - `"technique"`

    - `"action"`

  - `action: optional object { action_id }`

    - `action_id: "split-text" or "find-and-replace-text" or "concat-text" or 34 more`

      Action identifier

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

  - `model: optional object { model_id }`

    - `model_id: string`

      Model identifier

  - `poll_url: optional string`

    URL to poll pending/running runs or fetch completed/failed run details.

  - `project_id: optional string`

    Project identifier

  - `technique: optional object { name, technique_id }`

    - `name: string`

      Technique name

    - `technique_id: string`

      Technique identifier

### Run Start Technique Response

- `RunStartTechniqueResponse object { charged_cost, estimated_seconds, run_id, 6 more }`

  - `charged_cost: number`

    Cost charged in USD

  - `estimated_seconds: number`

  - `run_id: string`

    Run identifier

  - `type: "generation" or "technique" or "action"`

    Run type

    - `"generation"`

    - `"technique"`

    - `"action"`

  - `action: optional object { action_id }`

    - `action_id: "split-text" or "find-and-replace-text" or "concat-text" or 34 more`

      Action identifier

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

  - `model: optional object { model_id }`

    - `model_id: string`

      Model identifier

  - `poll_url: optional string`

    URL to poll pending/running runs or fetch completed/failed run details.

  - `project_id: optional string`

    Project identifier

  - `technique: optional object { name, technique_id }`

    - `name: string`

      Technique name

    - `technique_id: string`

      Technique identifier
