> ## 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 Image Klein

> Use the FLUX 3 Image Klein API to generate or edit images. It belongs to the same FLUX 3 image family, runs smaller and faster, and accepts exact size, seed, and sampling steps.



## OpenAPI

````yaml openapi/en/flux.json POST /bfl/v1/flux-3-image-klein
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-klein:
    post:
      description: >-
        Generate or edit images with FLUX 3 Image Klein. It is in the same FLUX
        3 image family and supports text-to-image, edits with up to 10 reference
        images, multi-image composition, and bounding boxes in the prompt. Klein
        also accepts exact width and height, a seed, an output format, and a
        step count. The endpoint expands the prompt before generation. Passing
        `width` and `height` together overrides `aspect_ratio` and `resolution`.
        <a
        href='https://docs.bfl.ai/api-reference/utility/generate-an-image-with-flux-3-klein'
        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, restyles, or combines them. Each
                    item is an http(s) URL or base64, 1 to 10 total. The first
                    image is the picture being edited and sets the default
                    output size.
                aspect_ratio:
                  type: string
                  description: >-
                    Output aspect ratio. With `auto`, a reference image uses the
                    first image's exact ratio; without references, a ratio is
                    chosen from the prompt, otherwise `16:9`. Ignored when
                    `width` and `height` are both set.
                  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: >-
                    Resolution tier: `768sq`, `1k`, `1.5k`, `2k`, or `4k`.
                    Omitted text-to-image requests use `1k`. With a reference
                    image and this field omitted, the first image's own size is
                    used, or the nearest tier when `aspect_ratio` is also set.
                    Ignored when `width` and `height` are both set.
                  enum:
                    - 768sq
                    - 1k
                    - 1.5k
                    - 2k
                    - 4k
                width:
                  type: integer
                  description: >-
                    Output width in pixels, from 64 to 6256. Must be sent
                    together with `height`, and overrides `aspect_ratio` and
                    `resolution`. Width times height must not exceed 16822272
                    pixels.
                  minimum: 64
                  maximum: 6256
                height:
                  type: integer
                  description: >-
                    Output height in pixels, from 64 to 6256. Must be sent
                    together with `width`. Width times height must not exceed
                    16822272 pixels.
                  minimum: 64
                  maximum: 6256
                seed:
                  type: integer
                  description: >-
                    Seed used to reproduce a result. Random when omitted. Range:
                    0 to 4294967295.
                  minimum: 0
                  maximum: 4294967295
                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
                output_format:
                  type: string
                  description: Output image format.
                  default: jpeg
                  enum:
                    - jpeg
                    - png
                steps:
                  type: integer
                  description: 'Denoising steps. Default is 16. Range: 1 to 16.'
                  minimum: 1
                  maximum: 16
                  default: 16
                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.