> ## 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.

# Flux.2[klein] 9B API Documentation

> Integrate the Flux.2[klein] 9B API for high-quality AI image generation with balanced speed, flexibility, and prompt responsiveness.



## OpenAPI

````yaml openapi/en/flux.json POST /bfl/v1/flux-2-klein-9b
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-2-klein-9b:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Pro2Request'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    Pro2Request:
      type: object
      properties:
        prompt:
          type: string
          description: >-
            Image description. Note: Flux supports multilingual understanding,
            but English performs best in testing.
        input_image:
          type: string
          description: Reference image 1, URL or base64
        input_image_2:
          type: string
          description: Reference image 2, URL or base64
        input_image_3:
          type: string
          description: Reference image 3, URL or base64
        input_image_4:
          type: string
          description: Reference image 4, URL or base64
        image_prompt:
          type: string
          description: Reference image, base64 encoded
        width:
          type: string
          description: >-
            Width of generated image. Range: 256-1440, must be a multiple of 32.
            Default: 1024
        height:
          type: string
          description: >-
            Height of generated image. Range: 256-1440, must be a multiple of
            32. Default: 768
        seed:
          type: string
          description: Random seed
        output_format:
          type: string
          description: Output format
          example: jpeg
          enum:
            - jpeg
            - png
        safety_tolerance:
          type: integer
          description: >-
            Safety tolerance level for input and output adjustment. Range: 0-6,
            where 0 is strictest and 6 is most permissive. Default: 2
          example: '2'
        webhook_url:
          type: string
          description: Asynchronous callback URL
      required:
        - prompt
  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>.

````