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 Headshot

POST
/v1/aiart/avatar
Using advanced artificial intelligence technology, our AI Headshot Generator transforms your photo into a high-quality, personalized headshot. The AI intelligently recognizes your facial features and generates headshots in various styles based on your selection, including business, fashion, cartoon, and more. Whether you need a social media profile picture, resume photo, or any other personal image, our AI Headshot can meet your needs.

AI Headshot Styles#

AI Headshot Styles

Request

Header Params
Authorization
string 
required
Example:
Bearer <your api key>
Body Params application/json
userImageUrl
string 
required
The user's image URL or BASE64 encoded image, used to generate an avatar based on the user's image.
avatarTemplateParams
array [object {2}] 
required
An array containing avatar template information, defining the templates used for generating avatars and their quantity.
templateId
string 
optional
Headshot template ID: Specifies the specific style template used for generating the headsg. Refer to the template table for available options.
num
integer 
optional
The number of headshots to generate.
Example
{
  "userImageUrl": "https://pub-static.fotor.com/assets/goart-effects/examples/mini-figure-after.jpg",
  "avatarTemplateParams": [
    {
      "templateId": "ca39d44f-e8c8-4a3e-9d09-c3f96cb2fe60",
      "num": 1
    }
  ]
}

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/avatar' \
--header 'Authorization: Bearer <your api key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "userImageUrl": "https://pub-static.fotor.com/assets/goart-effects/examples/mini-figure-after.jpg",
    "avatarTemplateParams": [
        {
            "templateId": "ca39d44f-e8c8-4a3e-9d09-c3f96cb2fe60",
            "num": 1
        }
    ]
}'

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"
  }
}
Previous
Background Remover
Next
Photo Colorize
Built with