> ## 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 Image Edits API Documentation

> Use the Flux image edits API to modify existing images with prompt-based changes, partial redraws, and visual refinements for production workflows.



## OpenAPI

````yaml openapi/en/flux.json POST /flux/edits
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:
  /flux/edits:
    post:
      description: Generate new images based on text prompts and uploaded reference images
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/EditsRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    EditsRequest:
      type: object
      properties:
        image:
          type: file
          description: Reference images, supports multiple
        prompt:
          type: string
          description: >-
            Image description. Note: Flux supports multilingual understanding,
            but English performs best in testing.
        mode:
          type: string
          example: flux1-dev
          description: Model version
          enum:
            - flux1-dev
            - flux1-schnell
            - flux1-pro
            - flux-kontext-pro
            - flux-kontext-max
            - flux-2-pro
            - flux-2-flex
            - flux-2-max
            - flux-2-klein-4b
            - flux-2-klein-9b
        aspect_ratio:
          type: string
          example: '1:1'
          description: Aspect ratio
          enum:
            - '21:9'
            - '16:9'
            - '4:3'
            - '3:2'
            - '1:1'
            - '2:3'
            - '3:4'
            - '9:16'
            - '9:21'
        hookUrl:
          type: string
          description: Callback notification URL
      required:
        - image
        - mode
  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>.

````