> ## 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.1[pro] API 文档

> 接入 Flux.1[pro] API 实现专业级文本生成图片能力，适用于产品视觉、营销素材和创意设计等场景。



## OpenAPI

````yaml openapi/cn/flux.json POST /bfl/v1/flux-pro
openapi: 3.1.0
info:
  title: Flux API DOCS
  version: 1.0.0
  description: TTAPI Flux API 接口服务，目前集成了市场上最为领先的视频大模型sora2。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /bfl/v1/flux-pro:
    post:
      description: >-
        根据文本提示使用 Flux Pro 模型生成 或者编辑图像。<a
        href='https://docs.bfl.ai/api/tasks/generate-an-image-with-flux1-[pro]'
        target='_blank'>官方文档地址</a>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    ProRequest:
      type: object
      properties:
        prompt:
          type: string
          description: 生成图像描述词。注意：Flux支持多语言理解能力，但实测英文最佳。
        image_prompt:
          type: string
          description: 参考图像，base64值
        width:
          type: string
          description: 生成图像的宽度 范围256-1440，必须是32的倍数 默认：1024
        height:
          type: string
          description: 生成图像的高度 范围256-1440，必须是32的倍数 默认：768
        seed:
          type: string
          description: 随机种子
        output_format:
          type: string
          description: 输出格式
          example: jpeg
          enum:
            - jpeg
            - png
        prompt_upsampling:
          type: boolean
          description: 是否对提示采样true - 是   false - 否
          example: 'false'
          enum:
            - 'false'
            - 'true'
        safety_tolerance:
          type: integer
          description: 输入和输出调节的容差水平。在0到6之间，0表示最严格，6表示最宽松 默认：2
          example: '2'
        steps:
          type: integer
          description: 图像生成过程中的步骤数量 可选范围1-50 默认：40
          example: '40'
        guidance:
          type: number
          description: 图像生成的指导尺度。高指导尺度在牺牲现实感的情况下提高了提示遵循度 可选范围1.5-5 默认：2.5
          example: '2.5'
        interval:
          type: number
          description: 用于引导控制的区间参数 可选范围：1-4 默认：2
          example: '2'
        webhook_url:
          type: string
          description: 异步回调地址
      required:
        - prompt
  responses:
    SuccessResponse:
      description: 请求成功
      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: 参数错误
      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: 授权失败
      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: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````