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.

API Endpoints

Character Swap Operations

Getting Started

Basic Workflow

  1. Create Character Swap Video:
    • Prepare your character image URL (PNG or JPEG)
    • Prepare your source video URL (MP4) with the motion to apply
    • Optionally provide duration, resolution, mode, and prompt
    • Call the Create Character Swap API with your resources
  2. Check Results:
    • Use the Get Video Info Result API to check the status of your video
    • Download the result URL when the status is “Success” (video_status = 3)

Response Code Description

Please note that if the value of the response code is not equal to 1000, the request has failed or encountered an error.

Pricing

Character Swap

Note: Credits are calculated based on video duration in 5-second increments. For example, a 12-second video at 720p resolution would cost 30 credits (12 seconds ÷ 5 seconds × 10 credits).

Video Status Codes

When checking results, the video_status field indicates the current state:

Best Practices

Image Requirements

  • Quality: Use high-resolution images for better results
  • Face Visibility: Ensure the character face is clearly visible and not obscured
  • Lighting: Well-lit images produce better character swap results
  • Angle: Frontal or slight angle faces work best

Video Requirements

  • Format: MP4 format is required
  • Quality: Use clear, high-quality source videos
  • Duration: Maximum video duration is 120 seconds
  • Motion: The source video should contain the motion you want to apply to the character

API Usage Tips

  • Webhook: Use the webhookUrl parameter to receive notifications when processing is complete
  • Prompt: Use the prompt parameter for generation guidance (max 500 characters)
  • Resolution: Choose appropriate resolution (480p or 720p) based on your needs - higher resolution may take longer to process
  • Mode: Choose between “animate” (character animation) or “replace” (face replacement) based on your use case
  • Result Cleanup: Save generated videos promptly as they expire after 7 days

Common Use Cases

Basic Character Animation

Create a character animation video by applying motion from a source video:

Character Animation with Prompt

Use the prompt parameter for enhanced control over the animation:

Face Replacement Mode

Replace faces in a video with a character face:

Notes

  • Pro Plan Required: Character Swap feature requires Pro plan or higher subscription
  • Video Duration: If not specified, the duration will be automatically detected from the source video. Maximum duration 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
  • Webhook Callbacks: If a webhook URL is provided, you will receive a POST request when the task status changes to completed (3) or failed (4)

Support

For additional help and examples, check out our: