> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gengen.farm/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate images with FLUX 3

> Generate or edit one image with FLUX 3 Image. Choose a resolution tier, set an exact size, or match a reference image.

Send a prompt to `POST /api/gengen/v1/images/generations` with model `flux-3-image`. The request waits for one image. Download it promptly from `outputs.images[0]`. This is the original signed BFL URL, and BFL controls when it expires.

```bash theme={"dark"}
curl https://gengen.farm/api/gengen/v1/images/generations \
  -H "Authorization: Bearer $GENGEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "flux-3-image",
    "prompt": "A woodcut illustration of a heron by a lake at dusk",
    "controls": {"size": "1k", "aspectRatio": "3:2"}
  }'
```

## Edit with reference images

Pass up to ten publicly accessible HTTP(S) image URLs in `assets.referenceImages`. Signed URLs work while valid. Refer to images by position in the prompt. The following request keeps the first image's framing and disables search grounding.

```json theme={"dark"}
{
  "model": "flux-3-image",
  "prompt": "Keep the ceramic bowl in image 1 and apply the glaze pattern from image 2.",
  "assets": {"referenceImages": ["https://example.com/bowl.png", "https://example.com/glaze.jpg"]},
  "controls": {"size": "match_input"},
  "providerOptions": {"bfl": {"grounding": false}}
}
```

## Size and billing

`controls.size` defaults to `1k`. The five price tiers are `768sq`, `1k`, `1.5k`, `2k`, and `4k`. Reference images are included in the per-image rate. See [pricing](https://docs.gengen.farm/pricing.md) for customer rates.

Use `match_input` with a reference to match its size up to 4 megapixels. For exact dimensions, supply both `controls.width` and `controls.height`, each from 256 to 6256 pixels. Their product must be at most 16,822,272 pixels for text-to-image or 4,194,304 for edits. Exact dimensions take precedence over size and aspect ratio. For custom sizes and `match_input`, the wallet reserves up to the highest applicable tier price and settles the billed tier.

The model supports search grounding by default. Set `providerOptions.bfl.grounding` to `false` to disable it. The accepted range for `safetyTolerance` is 0–7, subject to the account's permitted levels.


## OpenAPI

````yaml openapi/bfl.yaml POST /images/generations
openapi: 3.1.0
info:
  title: FLUX 3 Image API
  version: 1.0.0
servers:
  - url: https://gengen.farm/api/gengen/v1
security:
  - bearerAuth: []
paths:
  /images/generations:
    post:
      summary: Generate or edit one image
      operationId: generateFlux3Image
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - model
                - prompt
              properties:
                model:
                  type: string
                  const: flux-3-image
                prompt:
                  type: string
                  minLength: 1
                assets:
                  type: object
                  additionalProperties: false
                  properties:
                    referenceImages:
                      type: array
                      maxItems: 10
                      description: >-
                        Publicly accessible HTTP or HTTPS image URLs in
                        reference order.
                      items:
                        type: string
                        format: uri
                        pattern: ^[Hh][Tt][Tt][Pp][Ss]?://
                controls:
                  type: object
                  additionalProperties: false
                  dependentRequired:
                    width:
                      - height
                    height:
                      - width
                  properties:
                    size:
                      type: string
                      enum:
                        - 768sq
                        - 1k
                        - 1.5k
                        - 2k
                        - 4k
                        - match_input
                      default: 1k
                    aspectRatio:
                      type: string
                      default: auto
                      enum:
                        - auto
                        - '21:9'
                        - '2:1'
                        - '16:9'
                        - '3:2'
                        - '7:5'
                        - '4:3'
                        - '5:4'
                        - '1:1'
                        - '4:5'
                        - '3:4'
                        - '5:7'
                        - '2:3'
                        - '9:16'
                        - '1:2'
                        - '9:21'
                    width:
                      type: integer
                      minimum: 256
                      maximum: 6256
                    height:
                      type: integer
                      minimum: 256
                      maximum: 6256
                providerOptions:
                  type: object
                  additionalProperties: false
                  properties:
                    bfl:
                      type: object
                      additionalProperties: false
                      properties:
                        grounding:
                          type: boolean
                          default: true
                        safetyTolerance:
                          type: integer
                          minimum: 0
                          maximum: 7
                          default: 2
                        version:
                          type: string
                          const: latest
                        user:
                          type: string
                          minLength: 1
                          maxLength: 256
                          description: Opaque end-user identifier.
      responses:
        '200':
          description: >-
            One generated image at its original signed BFL delivery URL.
            Download promptly before the link expires.
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - model
                  - status
                  - outputs
                properties:
                  id:
                    type: string
                  model:
                    type: string
                    const: flux-3-image
                  status:
                    type: string
                    const: succeeded
                  outputs:
                    type: object
                    required:
                      - images
                    properties:
                      images:
                        type: array
                        minItems: 1
                        maxItems: 1
                        items:
                          type: string
                          format: uri
        default:
          description: Request, generation, or billing error.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.