Skip to main content
The resources (image, video) generated by our API are valid for 7 days. Please save the relevant resources as soon as possible to prevent expiration.

Endpoint

POST https://openapi.akool.com/api/open/v4/characterSwap/create

Request Headers

ParameterValueDescription
x-api-keyAPI KeyYour API Key used for request authorization. If both Authorization and x-api-key have values, Authorization will be used first and x-api-key will be discarded.
AuthorizationBearer {token}Your API Key used for request authorization.Get Token

Body Attributes

ParameterTypeRequiredDescription
imageStringtrueCharacter image URL (PNG or JPEG) to be animated
videoStringtrueSource video URL (MP4) with motion to apply
durationNumberfalseVideo duration in seconds (1-120). If not provided, will be automatically detected from the video
resolutionStringfalseOutput resolution: 480p, 720p, 1080p (default: 720p)
modeStringfalseAnimation mode: “animate” (character animation) or “replace” (face replacement) (default: “animate”)
promptStringfalseOptional prompt text for generation guidance (max 500 characters)
webhookurlStringfalseCallback URL for POST requests

Response Attributes

ParameterTypeDescription
codeIntegerInterface returns business status code (1000:success)
msgStringInterface returns status information
dataObjectResponse data object
- _idStringDocument ID
- create_timeLongCreation timestamp
- uidIntegerUser ID
- team_idStringTeam ID
- statusIntegerTask status: 1=queueing, 2=processing, 3=completed, 4=failed
- video_durationNumberVideo duration in seconds
- deduction_creditIntegerCredits deducted
- resolutionStringVideo resolution
- file_nameStringOutput file name
- image_urlStringInput image URL
- video_urlStringInput video URL
- promptStringAnimation prompt
- modeStringAnimation mode
- model_nameStringModel name used
- webhookUrlStringCallback URL

Example

Request Body

{
  "image": "https://drz0f01yeq1cx.cloudfront.net/character-image.png",
  "video": "https://drz0f01yeq1cx.cloudfront.net/source-video.mp4",
  "duration": 10,
  "resolution": "720p",
  "mode": "animate",
  "prompt": "Smooth character animation with natural movement",
  "webhookurl": "https://your-callback-url.com/webhook"
}

Request

curl --location 'https://openapi.akool.com/api/open/v4/characterSwap/create' \
--header 'x-api-key: {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
  "image": "https://drz0f01yeq1cx.cloudfront.net/character-image.png",
  "video": "https://drz0f01yeq1cx.cloudfront.net/source-video.mp4",
  "duration": 10,
  "resolution": "720p",
  "mode": "animate",
  "prompt": "Smooth character animation with natural movement",
  "webhookurl": "https://your-callback-url.com/webhook"
}'

Response

{
  "code": 1000,
  "msg": "OK",
  "data": {
    "_id": "689174694b4dbdd4ab3d28c9",
    "create_time": 1754362985482,
    "uid": 101400,
    "team_id": "6805fb69e92d9edc7ca0b409",
    "status": 1,
    "video_duration": 10,
    "deduction_credit": 20,
    "resolution": "720p",
    "file_name": "CharacterSwap_1754362985482.mp4",
    "image_url": "https://drz0f01yeq1cx.cloudfront.net/character-image.png",
    "video_url": "https://drz0f01yeq1cx.cloudfront.net/source-video.mp4",
    "prompt": "Smooth character animation with natural movement",
    "mode": "animate",
    "model_name": "wavespeed-ai/wan-2.2/animate",
    "webhookUrl": "https://your-callback-url.com/webhook"
  }
}

Important Notes

  • Image Quality: Use high-resolution images with clearly visible faces for better results
  • Video Format: MP4 format is required for source videos
  • Duration: If not specified, duration will be automatically detected from the source video. Maximum is 120 seconds
  • Mode Options:
    • animate: Applies character animation to the image using the video’s motion
    • replace: Replaces faces in the video with the character from the image
  • Prompt: Use the prompt parameter for enhanced control over the animation (max 500 characters)
  • Resolution: Choose between 480p or 720p or 1080p based on your needs - higher resolution may take longer to process
  • Resource Expiration: Generated videos are valid for 7 days, save them promptly
  • Webhook: Use webhookUrl to receive notifications when video generation is complete
  • Save the _id from the response to check video status using the Get Video Info Result API