> For the complete documentation index, see [llms.txt](https://docs.flora.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flora.ai/api/guides/techniques.md).

# Techniques

Find a FLORA Technique, read its inputs and price per run, start runs with the API, and poll or list them.

Techniques are reusable FLORA workflows. Each one defines the inputs it accepts, the outputs it returns, and its cost per run in US dollars, so your code can run the same workflow your team built on the canvas. Most are built in the [Technique Builder](https://docs.flora.ai/nodes/technique-builder.md); see [Techniques](https://docs.flora.ai/nodes/techniques.md) for how they work in the app.

## List Techniques

```bash
curl "https://app.flora.ai/api/v1/techniques?limit=5" \
  -H "Authorization: Bearer $FLORA_API_KEY"
```

Response:

```json
{
  "techniques": [
    {
      "technique_id": "tech_abc123",
      "name": "CCTV Cam",
      "description": "...",
      "run_cost": 0.05,
      "inputs": [{ "id": "input_image", "name": "Input Image", "type": "imageUrl" }],
      "outputs": [{ "id": "output_image", "name": "Output Image", "type": "imageUrl" }]
    }
  ],
  "meta": { "next_cursor": null }
}
```

Filter with `workspace_id` or `query`, and page with `cursor`. Without `workspace_id`, the list uses your key's default workspace.

## Retrieve a Technique

Anywhere the API takes a Technique, you can pass its slug (the last part of its URL in FLORA, `https://app.flora.ai/techniques/{slug}`) or its `tech_` ID:

```bash
curl https://app.flora.ai/api/v1/techniques/cctv-cam \
  -H "Authorization: Bearer $FLORA_API_KEY"
```

```json
{
  "technique_id": "tech_abc123",
  "name": "CCTV Cam",
  "run_cost": 0.05,
  "inputs": [{ "id": "input_image", "name": "Input Image", "type": "imageUrl" }],
  "outputs": [{ "id": "output_image", "name": "Output Image", "type": "imageUrl" }]
}
```

`run_cost` is the price of one run in US dollars. Each input has an `id`, a `type`, and may be marked `optional` or `allow_multiple`.

## Start a run

Send one entry per input, matching each `id` and `type` exactly:

```bash
curl -X POST https://app.flora.ai/api/v1/techniques/cctv-cam/runs \
  -H "Authorization: Bearer $FLORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": [
      { "id": "input_image", "type": "imageUrl", "value": "https://example.com/photo.png" }
    ],
    "mode": "async",
    "idempotency_key": "cctv-photo-001"
  }'
```

The response includes a `run_id`, its `status` and a `poll_url`. Optional fields:

| Field             | Notes                                                                                                                                        |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `idempotency_key` | Reusing the key in the same workspace returns the run it first created. See [Idempotency](https://docs.flora.ai/api/platform/idempotency.md) |
| `callback_url`    | An HTTPS URL that gets a signed callback when the run finishes. See [Webhooks](https://docs.flora.ai/api/platform/webhooks.md)               |

If the workspace can't cover `run_cost`, the API returns `402 insufficient_credits` and starts nothing.

## Poll for the result

Read the run at its `poll_url` (`GET /techniques/{slug}/runs/{runId}`) until `status` is `completed` or `failed`. Each poll counts against your workspace's rate limit, so wait about 15 seconds between polls. Or skip polling with a [webhook](https://docs.flora.ai/api/platform/webhooks.md).

```bash
curl https://app.flora.ai/api/v1/techniques/cctv-cam/runs/run_abc123 \
  -H "Authorization: Bearer $FLORA_API_KEY"
```

A completed run has `outputs[]` with a `url` each and its `charged_cost` in US dollars. A failed run has `error_code` and `error_message`. `GET /technique-runs` lists recent runs, newest first, filtered by `workspace_id`, `project_id`, `technique_id` or `status`. Filters apply before paging, so every page is full until the last. A `cursor` only works with the filters it was issued for: change the filters and you get `400 invalid_pagination_cursor`, so start again from the first page.

## Input types

| Type         | Value                            |
| ------------ | -------------------------------- |
| `text`       | Plain text                       |
| `imageUrl`   | A public `https://` image URL    |
| `videoUrl`   | A public `https://` video URL    |
| `model3dUrl` | A public `https://` 3D model URL |

Media URLs are passed to model providers to download, so they must be public HTTPS URLs; `http://`, `localhost` and private addresses are rejected. The most reliable choice is a FLORA asset URL: see [Upload an asset](https://docs.flora.ai/api/recipes/upload-an-asset.md).

## Common endpoints

| Method | Path                              | Description                                                                                                    |
| ------ | --------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| GET    | `/techniques`                     | [List Techniques](https://docs.flora.ai/api/reference/techniques/listtechniques.md)                            |
| GET    | `/techniques/{slug}`              | [Read a Technique's inputs, outputs and price](https://docs.flora.ai/api/reference/techniques/gettechnique.md) |
| POST   | `/techniques/{slug}/runs`         | [Start a run](https://docs.flora.ai/api/reference/technique-runs/starttechniquerun.md)                         |
| GET    | `/techniques/{slug}/runs/{runId}` | [Poll a run](https://docs.flora.ai/api/reference/technique-runs/gettechniquerun.md)                            |
| GET    | `/technique-runs`                 | [List recent Technique runs](https://docs.flora.ai/api/reference/technique-runs/listtechniqueruns.md)          |

## Common validation issues

* Put the slug or `tech_` ID in the path and match the retrieved `inputs` exactly. Every required input must be present, and input IDs the Technique doesn't have are rejected.
* Each input's `type` must match the Technique's: `text`, `imageUrl`, `videoUrl` or `model3dUrl`.
* Media inputs must be public `https://` URLs.

## Notes

* Inputs vary by Technique. Always read the Technique before you build a run payload.
* Running Techniques from an AI client? See [Run your team's Technique](https://docs.flora.ai/mcp/recipes/run-a-technique.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flora.ai/api/guides/techniques.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
