Fotor OpenAPI
  1. Reference
Fotor OpenAPI
  • Getting Started
    • Introduction
    • Access and Authentication
    • For Serverless Clients
    • Token Consumption
  • Reference
    • AI Upscaler
      POST
    • AI Skin Retouch
      POST
    • Text to Image
      POST
    • Image to Image (AI Art Effects)
      POST
    • Background Remover
      POST
    • AI Headshot
      POST
    • Photo Colorize
      POST
    • Photo Restoration
      POST
    • Face Swap
      POST
    • AI Replace
      POST
    • Query Task Details
      GET
  • Webhook
    • Webhook
  • AI Editor SDK
    • Getting Started
    • Get Sdk Temporary Token
      GET
  1. Reference

AI Replace

POST
/v1/aiart/replacer

🖼️ Example#

Original ImageMask ImagePromptResult
OriginalMask"Butterfly"Result

Request

Header Params
Authorization
string 
required
Example:
Bearer <your api key>
Body Params application/json
imageUrl
string 
required
The URL or BASE64 encoded image of the initial image provided by the user.
content
string 
required
Describe what you want to appear in the masked area — this prompt tells the model how to modify just that part of the image.
maskImageUrl
string 
required
Specifies a mask image used to define the regions for partial replacement in the source image. Accepts either a base64-encoded image string or a publicly accessible image URL.
Example
{
    "imageUrl": "https://u-static.fotor.com/uid_0f5eccd484e6403084043fd20e320027/image_to_image/app-fotor-web/e09b6003-020f-444c-9472-884e56ea50e9.jpeg",
    "content": "Butterfly",
    "maskImageUrl": "https://u-static.fotor.com/uid_0f5eccd484e6403084043fd20e320027/image_to_image/app-fotor-web/0dc32dbd-8ee9-4216-b9dc-71cd48e4acf0.jpeg"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api-b.fotor.com/v1/aiart/replacer' \
--header 'Authorization: Bearer <your api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "imageUrl": "https://u-static.fotor.com/uid_0f5eccd484e6403084043fd20e320027/image_to_image/app-fotor-web/e09b6003-020f-444c-9472-884e56ea50e9.jpeg",
    "content": "Butterfly",
    "maskImageUrl": "https://u-static.fotor.com/uid_0f5eccd484e6403084043fd20e320027/image_to_image/app-fotor-web/0dc32dbd-8ee9-4216-b9dc-71cd48e4acf0.jpeg"
}'

Responses

🟢200success
application/json
Body
code
string 
required
000: Success,999: Unknown error
Example:
000
msg
string 
required
Example:
success
data
object 
required
taskId
string 
required
Task ID, used to query task information.
Example:
e0dc194703174b6eafeacb4ee8e02850
Example
{
    "code": "000",
    "msg": "success",
    "data": {
        "taskId": "e0dc194703174b6eafeacb4ee8e02850"
    }
}
Modified at 2025-04-08 10:15:02
Previous
Face Swap
Next
Query Task Details
Built with