With Anam’s API, you can create custom personas on the fly. This allows you to dynamically generate personas based on user preferences, context, or any other criteria.
Deprecation Notice: The brainType field has been replaced with llmId to support custom language models. For backwards compatibility, you can still use your existing brainType values as llmId. See our Custom LLMs guide for more details.

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

ParameterDescriptionTypeRequiredDefault
avatarIdThe ID of the avatar to use (get from Avatar Gallery)stringYes
voiceIdThe ID of the voice to use (get from Voice Gallery)stringYes
llmIdWhich LLM used to power the responsesstringNo0934d97d-0c3a-4f33-91b0-5e136a0ef466
systemPromptInitial instructions that define the persona’s behavior and personalitystringNoDefault helpful assistant persona
nameOptional name for internal organizationstringNo

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",
    "llmId": "ANAM_LLAMA_v3_3_70B_V1",
    "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"
  },
  "llmId": "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.