> ## Documentation Index
> Fetch the complete documentation index at: https://anam.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create your own custom avatar

> Create a custom avatar in Anam Lab or through the API. Preserve a prepared source image without cropping or outpainting.

Upload a photo or use your camera, then test your avatar in a live conversation.

Anam's one-shot avatar generator creates a personalized avatar from a single photo of a real person, a stock photo, or an AI-generated image with compatible facial features.

To change an existing avatar with prompts and reference images, see [Avatar personalization](https://anam.ai/docs/personas/avatars/personalization.md).

Every plan, including Free, supports unlimited saved custom avatars in the Lab and through the API. [Image-generation, moderation and creation limits](https://anam.ai/docs/resources/billing-and-limits.md#custom-avatars-and-creation-requests) still apply.

## Before you create

* Use a `.png`, `.jpg`/`.jpeg`, or `.webp` image up to 4.5MB.
* Use a square image at least `1152x1152`, with the face in focus and hands out of view.
* Leave clear space around the head, shoulders, and upper chest for landscape and portrait crops.

See [Custom avatar best practices](https://anam.ai/docs/personas/avatars/custom-avatar-best-practices.md) for complete source image guidance.

> [card] [Create a custom avatar](https://lab.anam.ai/build?action=create\&tab=avatar\&cta_id=custom-avatar-docs-inline)
>
> Upload a photo or take one with your camera in Anam Lab.

> [card] [View avatar examples](https://anam.ai/docs/personas/avatars/gallery.md)
>
> Browse the avatars available for your personas.

## Create in Anam Lab

**1. Open the Build page**

Go to the [Avatar tab in Anam Lab](https://lab.anam.ai/build?tab=avatar) and select **Add**.

**2. Add a new avatar**

Click the **Add** button, then either upload a photo or capture one with your webcam. For best results, follow the [custom avatar best practices](https://anam.ai/docs/personas/avatars/custom-avatar-best-practices.md).

**3. Generate**

Click **Create** and wait for your avatar to be generated. Once ready, it's available for use in any persona.

## Create via API

For programmatic avatar creation, use the [Create Avatar](https://anam.ai/docs/api-reference/avatars/create-avatar.md) endpoint. This is useful for building custom onboarding flows or batch-creating avatars.

```javascript theme={"system"}
const response = await fetch("https://api.anam.ai/v1/avatars", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${apiKey}`,
  },
  body: JSON.stringify({
    displayName: "My Custom Avatar",
    imageUrl: "https://example.com/photo.jpg",
  }),
});
```

### Preserve your source image

Set `imageProcessing` to `"preserve"` when you want to use a prepared image without resizing, cropping, padding, outpainting or alignment/refinement. This option is **API-only** and is not available in Anam Lab. The default, `"auto"`, applies normal image processing.

Prepare an image that meets all of these requirements:

* Exactly **1152×1152 pixels**.
* A static, 8-bit RGB or RGBA PNG, up to **4.5 MB**.
* Fully opaque, including every alpha value in an RGBA image.
* No EXIF metadata or animation. Animated PNGs are rejected.

Use a supported Cara 4 creation model: `cara-4`, `cara-4.1-express` or `cara-4-latest`. Do not combine `imageProcessing: "preserve"` with `zoomOutPercent`.

```bash theme={"system"}
curl --fail-with-body https://api.anam.ai/v1/avatars \
  -H "Authorization: Bearer $ANAM_API_KEY" \
  -F 'displayName=My character' \
  -F 'imageProcessing=preserve' \
  -F 'imageFile=@character.png;type=image/png'
```

You can also send `imageProcessing: "preserve"` in a JSON request with `imageUrl`. Images that do not meet the requirements are rejected rather than converted.

Moderation, [creation limits](https://anam.ai/docs/resources/billing-and-limits.md#custom-avatars-and-creation-requests) and facial compatibility checks still apply. Illustrated characters may work, but compatibility and animation quality depend on how human-like their facial features are. Preserve mode does not guarantee support for every character design.

The source stays unchanged, but animation frames can change. Retrieve the square source through `sourceImageUrl`. The `imageUrl` field returns the landscape still. Generated video still uses the normal [landscape or portrait framing](https://anam.ai/docs/personas/session/video.md); preserve mode does not change those output crops.

## Using your avatar

Once created, reference the avatar by its ID in your persona configuration:

```javascript theme={"system"}
const personaConfig = {
  name: "My Persona",
  avatarId: "your-custom-avatar-id",
  avatarModel: "cara-4",
  voiceId: "de23e340-1416-4dd8-977d-065a7ca11697",
  llmId: "a7cf662c-2ace-4de1-a21e-ef0fbf144bb7",
  systemPrompt: "You are a helpful assistant.",
};
```

You can find the avatar ID in Lab by clicking the three-dot menu on any avatar and selecting **Copy ID**.

> [card] [Create a custom avatar](https://lab.anam.ai/build?action=create\&tab=avatar\&cta_id=custom-avatar-docs-footer)
>
> Upload a photo or use your camera, then test your avatar in a live conversation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.