> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-router-model-page-pilot.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Use FLUX 3 Video with Comfy Router

> Python, TypeScript and cURL snippets for generating video with synchronized audio from FLUX 3 over HTTP through Comfy Router, plus the request fields and the result shape

API Reference for FLUX 3 Video. FLUX 3 Video is Black Forest Labs' video generation model, turning a text prompt into a short clip with synchronized audio.

<Note>
  **Comfy Router is not generally available yet.** `POST /v2/models/{provider}/{model}` and its catalog and schema siblings are not serving requests yet: an authenticated call answers `404` today. The snippets on this page document the contract those routes will serve, published ahead of the rollout so your integration is ready to write against.
</Note>

## Quick start

Create a key at [platform.comfy.org/profile/api-keys](https://platform.comfy.org/profile/api-keys) and export it as `COMFY_API_KEY`. The Python and TypeScript snippets use the Comfy SDKs (`pip install comfy-sdk`, `npm install @comfyorg/sdk`); the cURL snippet is the same call over raw HTTP.

**Model ID:** `bfl/flux-3-video`

**Endpoint:** `POST https://api.comfy.org/v2/models/bfl/flux-3-video`

<CodeGroup>
  ```python Python theme={null}
  from comfy_sdk import Comfy

  # Reads COMFY_API_KEY from the environment. Each call sends a fresh
  # Idempotency-Key and waits up to 10 minutes for the finished result.
  with Comfy() as client:
      result = client.models.run(
          "bfl/flux-3-video",
          {
              "mode": "t2v",
              "prompt": "a single red maple leaf falling onto still water, slow motion",
              "duration": 5,
              "aspect_ratio": "16:9",
              "generate_audio": True,
          },
      )

  print("video:", result["result"]["sample"])
  ```

  ```typescript TypeScript theme={null}
  import { comfy } from "@comfyorg/sdk";

  // Reads COMFY_API_KEY from the environment. Each call sends a fresh
  // Idempotency-Key and waits up to 10 minutes for the finished result.
  type Result = { result: { sample: string } };
  const { data } = await comfy.models.run<Result>("bfl/flux-3-video", {
    mode: "t2v",
    prompt: "a single red maple leaf falling onto still water, slow motion",
    duration: 5,
    aspect_ratio: "16:9",
    generate_audio: true,
  });

  console.log("video:", data.result.sample);
  ```

  ```bash cURL theme={null}
  curl https://api.comfy.org/v2/models/bfl/flux-3-video \
    -H "X-API-Key: $COMFY_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d "{\"mode\": \"t2v\", \"prompt\": \"a single red maple leaf falling onto still water, slow motion\", \"duration\": 5, \"aspect_ratio\": \"16:9\", \"generate_audio\": true}"
  ```
</CodeGroup>

## Schema

### Input

*Fields follow Black Forest Labs' published API specification and are checked against it in CI. Router's own schema for this model is not published yet, so requests are forwarded to the provider unvalidated.*

<ParamField body="mode" type="string" required>
  Generation mode: `t2v` text-to-video, `i2v` continue from images in `keyframes`, `v2v` continue the video in `start_video`, `draft_enhance` full-quality render of a prior draft.

  Possible values: `t2v`, `i2v`, `v2v`, `draft_enhance`
</ParamField>

<ParamField body="prompt" type="string">
  Free-form description of the video. Required in every mode except `draft_enhance`.
</ParamField>

<ParamField body="keyframes" type="string[]">
  `i2v` only. One to ten images (HTTPS URLs or base64) that become frames: one starts the video, two start and end it, more are spread evenly.
</ParamField>

<ParamField body="start_video" type="string">
  `v2v` only. The video to continue, as an HTTPS URL or base64 MP4.
</ParamField>

<ParamField body="duration" type="integer | &#x22;auto&#x22;" default="&#x22;auto&#x22;">
  Video length in whole seconds, or `auto` to fit the content. `v2v` caps the range at 15 seconds; the other modes accept up to 20.

  Range: `5` to `20`
</ParamField>

<ParamField body="aspect_ratio" type="string" default="&#x22;auto&#x22;">
  Output aspect ratio. `auto` lets BFL choose from the inputs.

  Possible values: `auto`, `21:9`, `2:1`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`
</ParamField>

<ParamField body="resolution" type="string" default="&#x22;fhd&#x22;">
  `fhd` (default) is finished by the video upsampler; `hd` is faster.

  Possible values: `hd`, `fhd`
</ParamField>

<ParamField body="generate_audio" type="boolean" default="true">
  Generate synchronized audio alongside the video.
</ParamField>

<ParamField body="safety_tolerance" type="integer" default="2">
  Moderation tolerance for inputs and outputs. 0 is strictest.

  Range: `0` to `4`
</ParamField>

<ParamField body="draft" type="boolean" default="false">
  Generate a fast preview instead of the full render.
</ParamField>

<ParamField body="version" type="string" default="&#x22;latest&#x22;">
  Endpoint version. `latest` serves the current release.
</ParamField>

<ParamField body="draft_cache" type="string">
  `draft_enhance` only. The draft-cache bundle returned by a prior draft generation.
</ParamField>

### Output

Router returns Black Forest Labs' native response unchanged. The video is at `result.sample`.

<ResponseField name="id" type="string" required>
  BFL task id for this generation.
</ResponseField>

<ResponseField name="status" type="string" required>
  Terminal task status. Router only returns once this is `Ready`.

  Possible values: `Ready`
</ResponseField>

<ResponseField name="result" type="object" required />

<ResponseField name="result.sample" type="string (uri)" required>
  Signed URL of the generated MP4. Expires roughly two hours after the result is ready.

  Format: `uri`
</ResponseField>

## Examples

### Input

```json theme={null}
{
  "mode": "t2v",
  "prompt": "a single red maple leaf falling onto still water, slow motion",
  "duration": 5,
  "aspect_ratio": "16:9",
  "generate_audio": true
}
```

### Output

```json theme={null}
{
  "id": "0a1b2c3d-...",
  "status": "Ready",
  "result": {
    "sample": "https://.../out.mp4"
  }
}
```

`result.sample` is a signed URL that expires roughly two hours after the result is ready. Download the MP4 promptly.

## Before you ship

The snippets above are the shortest working call. Three things are the same for every model and are documented once on the [Comfy Router headers](/development/comfy-router/headers) page: send an `Idempotency-Key` on every paid call and reuse it when you retry, expect the connection to be held up to Router's 10 minute deadline, and keep `X-Comfy-Request-Id` from every response. The SDKs do all three for you; the cURL tab does none of them. On failure, `X-Comfy-Error-Type` names the bucket, and a `422` means the body failed the model's schema and was never billed.

<CardGroup cols={3}>
  <Card title="Headers" icon="list" href="/development/comfy-router/headers">
    Authentication, idempotency, request IDs, error buckets, retry pacing, spend limits.
  </Card>

  <Card title="Quickstart" icon="rocket" href="/development/comfy-router/quickstart">
    Typed error handling in Python and TypeScript, reading the 422, walking the catalog.
  </Card>

  <Card title="Limitations" icon="triangle-exclamation" href="/development/comfy-router/limitations">
    What Router does not do today, and what to use instead.
  </Card>
</CardGroup>
