Talking avatar API from one photo
Create an avatar from one portrait with the API, then talk to it live.
Send one portrait to POST /v1/agent/generate and bitHuman creates a talking avatar from it in the bitHuman cloud. Then talk to the avatar in real time through the REST API, an SDK or the LiveKit plugin; the finished avatar runs anywhere its model runs.
Which model to use
Essence 2 renders a photoreal person from one portrait; Expression 2 renders any character (people, animals, cartoons) from one portrait.
| You have | Use |
|---|---|
| A photo of a real person | essence-2: photoreal, up to 1080p |
| A character, animal, robot or illustration | expression-2: any subject |
| Not sure | auto: people go to essence-2, everything else to expression-2 |
Every model except Expression 2 needs a clear, real human face. Always send model: an omitted model creates a first-generation Expression 1 agent.
Create the avatar
curl -X POST https://api.bithuman.ai/v1/agent/generate \
-H "Content-Type: application/json" -H "api-secret: $BITHUMAN_API_SECRET" \
-d '{"model": "auto", "prompt": "You are a friendly receptionist.", "image": "https://example.com/headshot.jpg"}'
{"success": true, "message": "Agent generation started", "agent_id": "A80HVD8577", "status": "processing"}
Poll GET /v1/agent/status/{agent_id} every few seconds until status is ready or failed. An Essence 2 avatar is ready in minutes; an Expression 2 avatar takes longer to build. Every step, with the voice and the persona: Create your own avatar.
What makes a good photo
One subject, in focus, facing the camera with a resting expression and the whole face visible (eyes, nose and mouth). The image is under 10 MB, at a URL that opens in a browser without signing in. For an animal or character, use expression-2 with a well-lit, front-facing photo and the face filling the frame.
What it costs to create
Creating your own avatar is a one-time 500 credits for Essence 2 (ready in a few minutes) or 2,000 credits for Expression 2 (it takes longer to build).
A failed creation is refunded automatically. API use needs the Creator plan or higher. Every rate is on Pricing.
Talk to it in real time
| You are building | Use |
|---|---|
| A web page | the web embed: https: |
| A LiveKit voice agent | the LiveKit plugin: bithuman. |
| An iPhone, iPad, Mac or Android app | the Swift package or the Android SDK, rendering on the device |
| A backend or a script | the Python SDK, or the REST API |
| A quick check from the terminal | the CLI: bithuman run <agent_ |
To make a live avatar say a line from your backend, call POST /v1/agent/{agent_id}/speak.
A real-time session bills to the second at the rates on Pricing; rendering on your own hardware or on the device bills a lower rate than the bitHuman cloud.
Try a sample first
The wise-pup sample (Expression 2) runs in the web embed with no account or install:
<iframe src="https://www.bithuman.ai/embed/A23WJF0199" allow="microphone *" style="width:100%;height:600px;border:0"></iframe>
Open the page, allow the microphone and talk: the avatar greets you and answers. A sample session ends after a minute. The sample avatars are sofia-ramirez (Essence 2) and wise-pup (Expression 2): Sample avatars.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
402 INSUFFICIENT_ | not enough credits | top up (the error’s topup_url) |
403 PLAN_ | a Free account, which cannot create agents, or a model outside your plan | choose a plan (the error’s upgrade_url) |
422 MODEL_ | any model but expression-2 for a subject that is not a real person, or no face found | use expression-2 or auto |
422 IMAGE_ | essence-2 with a face too small in frame, or several faces | upload a closer photo of one person |
failed with an image error | the image URL is not publicly fetchable | host the image publicly and create again (the failed creation is refunded) |