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

# 获取换脸结果  Fetch SwapFace

> 获取换脸任务结果查询，返回数据结构与<a href="fetch" target="_self">hookUrl</a>返回一致。<br/>注：jobId 支持通过 URL 参数（Query）、请求体（Body）两种方式传递



## OpenAPI

````yaml openapi/cn/swapface.json get /insightFace/v1/fetch
openapi: 3.1.0
info:
  title: Swapface API DOCS
  version: 1.0.0
  description: TTAPI Swapface API 接口服务，目前集成了市场上最为领先的视频大模型sora2。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /insightFace/v1/fetch:
    get:
      description: >-
        获取换脸任务结果查询，返回数据结构与<a href="fetch"
        target="_self">hookUrl</a>返回一致。<br/>注：jobId 支持通过 URL
        参数（Query）、请求体（Body）两种方式传递
      parameters:
        - name: jobId
          in: query
          required: true
          schema:
            type: string
          description: 生成接口同步返回的jobId（支持URL参数/请求体传递）
          example: SWAP-FACE-171349414479347616
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - SUCCESS
                      - ON_QUEUE
                      - FAILED
                    description: 任务状态：ON_QUEUE-处理中，SUCCESS-成功，FAILED-失败
                    example: SUCCESS
                  message:
                    type: string
                    description: 响应信息：成功时为空字符串，失败时返回具体错误原因（如「额度不足」「提示词违规」）
                    example: ''
                  jobId:
                    type: string
                    description: 任务唯一标识ID，用于查询任务状态/接收回调通知
                    example: c679a92e-dae0-462d-b70f-dcfeaf2189fa
                  data:
                    oneOf:
                      - title: SUCCESS
                        type: object
                        description: 任务成功返回数据
                        properties:
                          targetImage:
                            type: string
                            description: 用户上传的模板图像地址。有效期详见[存储与持久化](/grids/cn/faq/storage)
                          swapImage:
                            type: string
                            description: 用户上传的人脸图像地址。有效期详见[存储与持久化](/grids/cn/faq/storage)
                          discordImage:
                            type: string
                            description: >-
                              任务成功返回结果的discord地址，国内不可直接访问。有效期详见[存储与持久化](/grids/cn/faq/storage)
                          cdnImage:
                            type: string
                            description: >-
                              任务成功返回结果的ttapi代理地址，国内可直接访问。有效期详见[存储与持久化](/grids/cn/faq/storage)
                          quota:
                            type: string
                            description: 消耗配额
                            example: '3'
                          hookUrl:
                            type: string
                            description: 回调地址
                            example: >-
                              https://webhook-test.com/bf74f63b0d51ba1b3090e295aae057fe
                          finishTime:
                            type: string
                            description: 完成时间
                            example: '2025-07-30T05:40:01Z'
                      - title: ON_QUEUE
                        type: object
                        description: 任务处理中返回数据
                      - title: FAILED
                        type: object
                        description: 任务失败返回数据
                required:
                  - status
                  - message
                  - jobId
                examples:
                  SUCCESS:
                    summary: 成功状态示例
                    value:
                      status: SUCCESS
                      message: ''
                      jobId: SWAP-FACE-171349414479347616
                      data:
                        jobId: SWAP-FACE-171349414479347616
                        targetImage: >-
                          https://pics1.baidu.com/feed/a5c27d1ed21b0ef42316cbd385d68fd780cb3e64.jpeg@f_auto?token=0d9295cb14265da251460e7e8918db0a
                        swapImage: >-
                          https://img2.baidu.com/it/u=2626318104,3413060045&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=625
                        discordImage: >-
                          https://cdn.discordapp.com/attachments/1225427359679909939/1230708397020811325/2aa3ab1495b844d084aa6eaaa4fb9bcf_ins.jpg?ex=66344d83&is=6621d883&hm=a0ac9fbb17cf52302662e2f50b40a9894977624d55bcc4f32d6ed09e7c56a415&
                        cdnImage: >-
                          https://mjcdn.ttapi.io/attachments/1225427359679909939/1230708397020811325/2aa3ab1495b844d084aa6eaaa4fb9bcf_ins.jpg?ex=66344d83&is=6621d883&hm=a0ac9fbb17cf52302662e2f50b40a9894977624d55bcc4f32d6ed09e7c56a415&
                        hookUrl: null
                        quota: '3'
                        finishTime: '2025-07-30T05:40:01Z'
                  ON_QUEUE:
                    summary: 处理中状态示例
                    value:
                      status: ON_QUEUE
                      message: ''
                      jobId: SWAP-FACE-171349414479347616
                      data: null
                  FAILED:
                    summary: 失败状态示例
                    value:
                      status: FAILED
                      message: 额度不足
                      jobId: SWAP-FACE-171349414479347616
                      data: null
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  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 密钥。

````