> ## 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 查询 API 文档

> 通过 Flux 结果查询 API 获取图像生成任务状态、结果地址和返回数据，方便对接异步图像生成流程。



## OpenAPI

````yaml openapi/cn/flux.json GET /flux/fetch
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:
  /flux/fetch:
    get:
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FetchRequest'
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - 'PENDING_QUEUE '
                      - ON_QUEUE
                      - SUCCESS
                      - FAILED
                  message:
                    type: string
                    description: 响应信息
                  jobId:
                    type: string
                    description: 任务id
                  data:
                    type: object
                    description: 任务结果
                    properties:
                      jobId:
                        type: string
                        description: 任务id
                      mode:
                        type: string
                        description: 模型版本
                      prompt:
                        type: string
                        description: 提示词
                      quota:
                        type: string
                        description: 消耗配额
                      size:
                        type: string
                        description: 图像尺寸
                      imageUrl:
                        type: string
                        description: 生成图像地址。有效期详见[存储与持久化](/grids/cn/faq/storage)
                      hookUrl:
                        type: string
                        description: 回调地址
                example:
                  status: SUCCESS
                  message: ''
                  jobId: c679a92e-dae0-462d-b70f-dcfeaf2189fa
                  data:
                    mode: flux-dev
                    jobId: bf165abb-a7fa-4c77-a2e4-138baac1130d
                    prompt: 漂亮的亚洲女孩和一只猫的合影
                    quota: '1'
                    size: 1024x1024
                    imageUrl: >-
                      https://cdnb.ttapi.io/2024-09-10/9rk3gmw3m6sxm4r75my02r48jizyli1l.webp
                    hookUrl: https://webhook-test.com/d47a918bcf231bfd4dcd1f63c2cb4c80
                required:
                  - status
                  - message
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    FetchRequest:
      type: object
      properties:
        jobId:
          type: string
          description: 生成图像接口同步返回的jobId
      required:
        - jobId
  responses:
    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 密钥。

````