Docs · v1
Custom avatar
Create a custom avatar from a portrait and an optional voice sample. This route uses
multipart/form-data and costs 100 per avatar.
POST/custom-avatar/generate
Parameters
| Name | Required | Description |
|---|---|---|
image |
Yes | Image file (max 10MB) or public URL. Use a clear portrait. |
voice |
No | Voice audio file (max 10MB) or public URL. Omitted → random voice. |
curl -X POST "https://app.makeugc.ai/api/platform/custom-avatar/generate" \
-H "X-Api-Key: YOUR_API_KEY" \
-F "image=@portrait.jpg" \
-F "voice=@sample.mp3"
const form = new FormData();
form.append("image", imageFile);
form.append("voice", voiceFile);
const response = await fetch("https://app.makeugc.ai/api/platform/custom-avatar/generate", {
method: "POST",
headers: { "X-Api-Key": process.env.MAKEUGC_API_KEY },
body: form,
});
import os
import requests
with open("portrait.jpg", "rb") as image, open("sample.mp3", "rb") as voice:
response = requests.post(
"https://app.makeugc.ai/api/platform/custom-avatar/generate",
headers={"X-Api-Key": os.environ["MAKEUGC_API_KEY"]},
files={"image": image, "voice": voice},
)
200 response
{
"status": true,
"data": {
"status": true,
"message": "Custom avatar created",
"avatar_id": "avatar_456",
"thumbnail_url": "https://...",
"audio_url": "https://...",
"selected_voice_id": "voice_789"
}
}
Status codes
- 200 Success
- 400 Missing image, invalid file type, file too large, or insufficient credits
- 401 Not authenticated
- 404 Subscription not found
- 500 Server error
Questions
Can I pass image and voice as URLs instead of files?
Yes. Both image and voice accept a direct file upload or a publicly accessible URL string. Files are stored automatically. Maximum size is 10MB per file.
How do I generate a video with the new avatar?
Use the returned avatar_id with POST /video/generate. If you omit voice, a random voice is assigned; otherwise selected_voice_id can be passed as voice_id.
