> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Face swap based on the provided image.



## OpenAPI

````yaml /openapi/face-change.json post /face/swap
openapi: 3.0.0
info:
  title: Face Transformation
  version: 1.0.0
  description: API reference for Face Transformation on Ace Data Cloud.
servers:
  - url: https://api.acedata.cloud
    description: Ace Data Cloud API
security:
  - bearerAuth: []
paths:
  /face/swap:
    post:
      summary: Face swap based on the provided image.
      parameters:
        - in: header
          name: accept
          schema:
            enum:
              - application/json
              - application/x-ndjson
            type: string
          required: false
          description: Face Swap Param Accept
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                timeout:
                  type: number
                  description: Face Swap Timeout
                callback_url:
                  type: string
                  description: Face Swap Callback Url
                async:
                  type: boolean
                  description: Face Swap Async
                source_image_url:
                  type: string
                  example: >-
                    https://i.ibb.co/m9BFL9J/ad61a39afd9079e57a5908c0bd9dd995.jpg
                  description: Face Swap Source Image Url
                target_image_url:
                  type: string
                  example: https://i.ibb.co/LnLYwhR/66f41e64b1922.jpg
                  description: Face Swap Target Image Url
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Face Swap Response 200 Success
                  task_id:
                    type: string
                    description: Face Swap Response 200 Task Id
                  image_url:
                    type: string
                    description: Face Swap Response 200 Image Url
                  image_width:
                    type: string
                    description: Face Swap Response 200 Image Width
                  image_height:
                    type: string
                    description: Face Swap Response 200 Image Height
          description: Face Swap Response 200
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    example:
                      error:
                        code: token_mismatched
                        message: The specified token is not matched with API.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: token_mismatched
                            description: Face Swap Response 400 Error Code
                          message:
                            type: string
                            example: The specified token is not matched with API.
                            description: Face Swap Response 400 Error Message
                      trace_id:
                        type: string
                        description: Face Swap Response 400 Trace Id
                  - type: object
                    example:
                      error:
                        code: api_not_implemented
                        message: The API is not implemented.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: api_not_implemented
                            description: Face Swap Response 400 Error Code 2
                          message:
                            type: string
                            example: The API is not implemented.
                            description: Face Swap Response 400 Error Message 2
                      trace_id:
                        type: string
                        description: Face Swap Response 400 Trace Id 2
          description: Face Swap Response 400
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    example:
                      error:
                        code: invalid_token
                        message: The specified token is invalid or wrong.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: invalid_token
                            description: Face Swap Response 401 Error Code
                          message:
                            type: string
                            example: The specified token is invalid or wrong.
                            description: Face Swap Response 401 Error Message
                      trace_id:
                        type: string
                        description: Face Swap Response 401 Trace Id
          description: Face Swap Response 401
        '403':
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    example:
                      error:
                        code: forbidden
                        message: >-
                          Sorry! Our Al moderators feel your prompt might be
                          against our community standards.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: forbidden
                            description: Face Swap Response 403 Error Code
                          message:
                            type: string
                            example: >-
                              Sorry! Our Al moderators feel your prompt might be
                              against our community standards.
                            description: Face Swap Response 403 Error Message
                      trace_id:
                        type: string
                        description: Face Swap Response 403 Trace Id
          description: Face Swap Response 403
        '429':
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    example:
                      error:
                        code: too_many_requests
                        message: You have exceeded the rate limit.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: too_many_requests
                            description: Face Swap Response 429 Error Code
                          message:
                            type: string
                            example: You have exceeded the rate limit.
                            description: Face Swap Response 429 Error Message
                      trace_id:
                        type: string
                        description: Face Swap Response 429 Trace Id
          description: Face Swap Response 429
        '500':
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    example:
                      error:
                        code: api_error
                        message: Internal server error.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: api_error
                            description: Face Swap Response 500 Error Code
                          message:
                            type: string
                            example: Internal server error.
                            description: Face Swap Response 500 Error Message
                      trace_id:
                        type: string
                        description: Face Swap Response 500 Trace Id
          description: Face Swap Response 500
        '504':
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    example:
                      error:
                        code: timeout
                        message: Timeout to generate the image.
                      trace_id: 2efa9340-b21b-4e26-9e14-4aac95f343ab
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            example: timeout
                            description: Face Swap Response 504 Error Code
                          message:
                            type: string
                            example: Timeout to generate the image.
                            description: Face Swap Response 504 Error Message
                      trace_id:
                        type: string
                        description: Face Swap Response 504 Trace Id
          description: Face Swap Response 504
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token from https://platform.acedata.cloud

````