Digital Twins
Create a companion based on a real person's likeness and voice
A digital twin is a companion based on a real person. It uses the person's actual voice recording and likeness to produce an avatar that looks and sounds like them. Once created, a digital twin returns a companion ID that you use the same way as any other companion — attach it to an agent, deploy to any channel.
For fictional or generated personas, use a companion instead.
Grant consent first. An admin must enable digital twins in the dashboard, or the API fails with DigitalTwinConsentRequired.
Creating a digital twin
Create a twin from identity, voice, and video
Parameter reference
All fields for the creation request
Voice recording requirements
Formats, size, and duration for voice samples
External client ID
Link the twin to a person in your system
Avatar models
Choose between v1 and v2 generation
Response
The companion object returned on creation
Listing your digital twins
Filter the companions endpoint by persona type
Using a digital twin in an agent
Set the twin ID as the agent's companion
Creating a digital twin
Call POST /public/digital-twins with the person's identity, a voice recording, and a reference image or video for the avatar.
curl -X POST https://companion-api.napster.com/public/digital-twins \
-H "X-Api-Key: $NAPSTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"firstName": "Sarah",
"lastName": "Johnson",
"description": "VP of Customer Success at Acme Corp. Confident, warm, and knowledgeable. Speaks clearly and directly, with a focus on helping customers get the most out of the product.",
"gender": "female",
"ethnicity": "Caucasian",
"voiceUrl": "https://example.com/recordings/sarah-voice-sample.wav",
"videoUrl": "https://example.com/videos/sarah-speaking.mp4",
"externalClientId": "sarah-johnson-001",
"version": "v2"
}'Parameter reference
| Parameter | Type | Required | Description |
|---|---|---|---|
firstName | string | Yes | The person's first name. |
lastName | string | Yes | The person's last name. |
description | string | Yes | Role, personality, and communication style. Becomes the foundation of the agent's system prompt. |
gender | string | Yes | One of male, female, or nonBinary. |
ethnicity | string | Yes | Use the ethnicities endpoint to get supported values. |
voiceUrl | string | No | URL of a voice recording of the person. Used to clone their voice. Must be publicly reachable over HTTPS. Optional for v2, where videoUrl alone can supply both appearance and voice. |
externalClientId | string | Yes | A unique identifier for the person. See External client ID below. |
pictureUrl | string | No | URL of a reference image for avatar generation. Used by v1, and by v2 when you don't have a reference video. |
videoUrl | string | No | URL of a reference video of the person speaking. Used by v2 for the highest quality. |
version | string | No | Avatar model. "v1" (default) or "v2". See Avatar Models. |
tags | object | No | Key-value string pairs for labeling. |
All identity fields (firstName, lastName, gender, ethnicity) are required for digital twins, unlike custom companions where they are optional.
Voice recording requirements
The voiceUrl is what makes the digital twin sound like the real person. Provide a clear recording of the person speaking naturally — the longer and more natural the sample, the better the voice clone.
| Requirement | Value |
|---|---|
| Supported formats | mp3, wav, m4a, flac, ogg, webm, mp4 |
| Max file size | 10 MB |
| Minimum duration | 60 seconds |
| Maximum duration | 300 seconds (5 minutes) |
The URL must be publicly reachable over HTTPS.
External client ID
The externalClientId is your own unique identifier for the person this digital twin represents — an employee ID, CRM contact ID, or any stable ID from your system. It links the digital twin back to the real individual so you can correlate sessions, analytics, and updates across your platform. For example, if Sarah leaves the company and is replaced, you can create a new digital twin with a different externalClientId while keeping the old one for historical records.
Avatar models
Two avatar models are available — v1 (fast) and v2 (highest quality). Set the version field to "v1" or "v2"; if omitted, it defaults to "v1". v1 takes a still image (pictureUrl). v2 takes a reference video (videoUrl) for the best results, or a still image (pictureUrl) when you don't have video. See Avatar Models for the full comparison.
Response
The response returns a companion object with an id:
{
"id": "comp_abc123",
"firstName": "Sarah",
"lastName": "Johnson",
"description": "VP of Customer Success at Acme Corp...",
"gender": "female",
"ethnicity": "Caucasian"
}Listing your digital twins
Digital twins are listed through the same companions endpoint. Use the personaType query parameter to filter:
curl https://companion-api.napster.com/public/companions?personaType=digitalTwin \
-H "X-Api-Key: $NAPSTER_API_KEY"Using a digital twin in an agent
Use the returned id as the companionId when creating an agent — same as any other companion:
curl -X POST https://companion-api.napster.com/public/agents \
-H "X-Api-Key: $NAPSTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"companionId": "comp_abc123",
"name": "Sarah - Customer Success",
"providerSettings": {
"temperature": 0.7
}
}'From here, follow the standard flow: configure the agent, add tools and knowledge, and deploy to a channel.