Conversations
Manage conversation sessions with AI avatars.
Create Conversation
POST /v1/conversationsCreates a new conversation session.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
avatar_id | string | Yes | Avatar identifier |
ai_provider | string | No | groq, openai, gemini, anthropic |
tts_provider | string | No | google, elevenlabs, browser |
system_prompt | string | No | Custom system prompt (max 2000 chars) |
Example Request
curl -X POST https://api.avatarium.ai/v1/conversations \
-H "Authorization: Bearer av_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"avatar_id": "aria-001",
"ai_provider": "groq",
"system_prompt": "You are a helpful assistant named Aria."
}'Example Response
{
"id": "conv_abc123xyz",
"avatar_id": "aria-001",
"created_at": "2025-01-15T10:00:00Z",
"config": {
"ai_provider": "groq",
"tts_provider": "google",
"voice_id": "en-US-Neural2-F"
}
}Get Conversation
GET /v1/conversations/:idRetrieves a conversation and its message history.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Conversation ID |
Example Request
curl https://api.avatarium.ai/v1/conversations/conv_abc123xyz \
-H "Authorization: Bearer av_live_xxxxx"Example Response
{
"id": "conv_abc123xyz",
"avatar_id": "aria-001",
"created_at": "2025-01-15T10:00:00Z",
"updated_at": "2025-01-15T10:05:00Z",
"messages": [
{
"id": "msg_001",
"role": "user",
"content": "Hello!",
"created_at": "2025-01-15T10:01:00Z"
},
{
"id": "msg_002",
"role": "assistant",
"content": "Hi there! How can I help you today?",
"audio_url": "https://cdn.avatarium.ai/audio/msg_002.mp3",
"created_at": "2025-01-15T10:01:01Z"
}
],
"usage": {
"ai_tokens": 125,
"tts_characters": 45
}
}Delete Conversation
DELETE /v1/conversations/:idDeletes a conversation and all associated messages.
Example Request
curl -X DELETE https://api.avatarium.ai/v1/conversations/conv_abc123xyz \
-H "Authorization: Bearer av_live_xxxxx"Example Response
{
"deleted": true
}