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

> ## Agent Instructions
> Send API requests to https://api.ttapi.io with the TT-API-KEY header. Midjourney account hosting uses https://hold.ttapi.io. Claude Code uses https://cc.ttapi.io.
> Most generation endpoints are asynchronous. The submit response returns a job id. Poll that product's fetch endpoint, or pass a webhook on the submit request. A fetch call does not start a new generation.
> 1 USD = 100 quota. Check the pricing page for that product before estimating cost.
> This file lists the English docs. Follow every /_llms/ link recursively for the API reference, Chinese, and Russian. Open a page's .md URL for the endpoint schema.

# Generate an image with FLUX 3

> Use the FLUX 3 Image API to generate an image from text, or edit, restyle, and combine up to 10 reference images.



## OpenAPI

````yaml openapi/en/flux.json POST /bfl/v1/flux-3-image
openapi: 3.1.0
info:
  title: Flux API DOCS
  version: 1.0.0
  description: >-
    TTAPI Flux API service, currently integrating the most advanced video large
    model Sora2.
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /bfl/v1/flux-3-image:
    post:
      description: >-
        Generate or edit images with FLUX 3 in the BFL official format. Send
        only `prompt` for text-to-image. Pass `images` (1 to 10) to edit a
        detail, change the style, or combine references. Bounding boxes can be
        appended to the prompt to place elements. This endpoint rejects fields
        from other models such as `seed`, `width`, `height`, and `input_image`.
        Unknown fields return 422. <a
        href='https://docs.bfl.ai/api-reference/utility/generate-an-image-with-flux-3'
        target='_blank'>Official docs</a>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: >-
                    Free-form prompt describing the image. Without `images`, it
                    generates a new image from the prompt. With reference
                    images, state what to change and refer to them in order as
                    image 1 and image 2. Bounding boxes can be appended to the
                    prompt, using a 0 to 1000 grid as `[top, left, bottom,
                    right]`.
                images:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                      minItems: 1
                      maxItems: 10
                  description: >-
                    Optional reference images. Omit them for text-to-image. When
                    present, the prompt edits a detail, changes the style, or
                    combines the references. Each item is an http(s) URL or
                    base64, 1 to 10 total. Each image must be at least 256×256.
                aspect_ratio:
                  type: string
                  description: >-
                    Output aspect ratio. With `auto`, a ratio named in the
                    prompt wins; otherwise the output keeps the first reference
                    image's framing. Without references, the prompt decides,
                    otherwise `1:1`. Set the ratio explicitly for text-to-image.
                  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'
                resolution:
                  type: string
                  description: >-
                    Image resolution tier by similar pixel area. Exact width and
                    height vary with the aspect ratio.
                  default: 1k
                  enum:
                    - 768sq
                    - 1k
                    - 1.5k
                    - 2k
                    - 4k
                safety_tolerance:
                  type: integer
                  description: >-
                    Harm moderation tolerance from 0 to 7, with 0 the strictest.
                    Default is 2. The route and organization determine the
                    approved maximum and the ceiling for each category.
                  minimum: 0
                  maximum: 7
                  default: 2
                grounding:
                  type: boolean
                  description: >-
                    When `true` (default), the prompt may be grounded with web
                    search and image search. When `false`, both are off,
                    generation is faster, and the model uses only the prompt.
                  default: true
                webhook_url:
                  type: string
                  description: >-
                    Async callback URL. The initial response returns `jobId`.
                    Use this callback or the [Flux fetch
                    API](/api/en/flux/fetch) to get the final image.
              required:
                - prompt
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  responses:
    SuccessResponse:
      description: Request successful
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: jobId
            required:
              - status
              - message
              - data
    400Response:
      description: Parameter error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: Authorization failed
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        You can obtain your API key from the <a
        href='https://dashboard.ttapi.io' target='_blank'>TTAPI Dashboard</a>.

````

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