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

# 使用 FLUX 3 生成图像

> 使用 FLUX 3 Image API 根据文本生成图像，或结合最多 10 张参考图进行编辑、换风格与多图合成。



## OpenAPI

````yaml openapi/cn/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 接口服务，目前集成了市场上最为领先的视频大模型sora2。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /bfl/v1/flux-3-image:
    post:
      description: >-
        使用 BFL 官方格式通过 FLUX 3 生成或编辑图像。只传 `prompt` 即可文生图；传入 `images`（1 到 10
        张）可按提示词编辑细节、更换风格或合成参考图。提示词末尾可以附加边界框来指定元素位置。该接口不接受
        `seed`、`width`、`height`、`input_image` 等其他模型字段，未知字段会返回 422。<a
        href='https://docs.bfl.ai/api-reference/utility/generate-an-image-with-flux-3'
        target='_blank'>官方文档</a>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: >-
                    用于描述图像的自由格式提示词。不传 `images`
                    时按提示词生成新图像；传入参考图时，写明要修改的内容，并按顺序称为图 1、图 2。也可以在提示词末尾附加边界框，用 0
                    到 1000 的 `[top, left, bottom, right]` 指定元素位置。
                images:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                      minItems: 1
                      maxItems: 10
                  description: >-
                    可选参考图。不传时为文生图；传入后按提示词编辑细节、更换风格或合成参考图。每张为 http(s) URL 或
                    base64，共 1 到 10 张。单张参考图需不小于 256×256
                aspect_ratio:
                  type: string
                  description: >-
                    输出图像宽高比。`auto`
                    时，提示词中指定的比例优先；否则保持第一张参考图的画幅。没有参考图时由提示词决定，仍无法确定则为
                    `1:1`。文生图建议显式指定比例。
                  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: 图像分辨率档位，按相近像素面积划分。具体宽高会随宽高比变化。
                  default: 1k
                  enum:
                    - 768sq
                    - 1k
                    - 1.5k
                    - 2k
                    - 4k
                safety_tolerance:
                  type: integer
                  description: 内容安全审核容忍度，取值 0 到 7，0 最严格，默认 2。允许的最高等级以及各类内容上限由路由和组织决定。
                  minimum: 0
                  maximum: 7
                  default: 2
                grounding:
                  type: boolean
                  description: >-
                    为 `true`（默认）时，提示词可以通过网页搜索和图像搜索进行事实校准。为 `false`
                    时关闭检索，生成更快，且只依据提示词本身。
                  default: true
                webhook_url:
                  type: string
                  description: >-
                    异步回调地址。初始响应会返回 `jobId`；可以通过该回调地址或 [Flux
                    查询接口](/api/cn/flux/fetch) 获取最终图像结果。
              required:
                - prompt
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  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 密钥。

````

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