Creating Custom Personas with the API

You can create your own custom personas using the Anam API’s /v1/personas endpoint. Custom personas allow you to define specific characteristics and behaviors for your use case.

Required Parameters

Persona Parameters

ParameterDescription
nameThe name for the persona. Used as a human-readable identifier.
avatarIdThe avatar ID for the persona.
voiceIdThe voice ID for the persona.
brainTypeWhich LLM used to power the responses
brainConfiguration for the persona’s LLM.

Brain Parameters

ParameterDescription
systemPromptThe prompt used for initializing LLM interactions.

Implementation Example

Here’s how to create a custom persona using the API:

curl -X POST "https://api.anam.ai/v1/personas" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-api-key" \
  -d '{
    "name": "Leo",
    "avatarId": "121d5df1-3f3e-4a48-a237-8ff488e9eed8",
    "voiceId": "b7274f87-8b72-4c5b-bf52-954768b28c75",
    "brainType": "ANAM_LLAMA_v3_3_70B_V1",
    "brain": {
      "systemPrompt": "You are Leo, a virtual receptionist..."
    }
  }'

The API will respond with the created persona’s details, including its ID:

{
  "id": "new_persona_id",
  "name": "Leo",
  "avatar": {
    "id": "121d5df1-3f3e-4a48-a237-8ff488e9eed8",
    "displayName": "Leo",
    "variantName": "window sofa corner",
    "imageUrl": "https://lab.anam.ai/persona_thumbnails/leo_windowsofacorner.png",
    "createdAt": "2021-01-01T00:00:00Z",
    "updatedAt": "2021-01-02T00:00:00Z"
  },
  "voice": {
    "id": "b7274f87-8b72-4c5b-bf52-954768b28c75",
    "displayName": "Leo",
    "createdAt": "2021-01-01T00:00:00Z",
    "updatedAt": "2021-01-02T00:00:00Z"
  },
  "brainType": "ANAM_LLAMA_v3_3_70B_V1",
  "brain": {
    "systemPrompt": "You are Leo, a virtual receptionist...",
  }
}

Using Your Custom Persona

Once created, you can use your custom persona following the Production Usage guide.