Conversations (Text and Voice)

A conversation is a series of text, audio, and image exchanges between a user and a character.

You can use the conversation endpoint to ask the user's personal model for the context you need. For example, Imersian, an interior design app, uses the API to ask a user's personal model about aesthetic preferences.

You can also use the conversation endpoint for voice generation. For example, USlap uses the endpoint to generate audio in a user's voice for a daily motivational message.

Create a new conversation

Create a new conversation between a user and a character

POST https://api.vana.com/api/v0/conversations

Returns the ID of the newly created conversation

Request Body

NameTypeDescription

characterId*

uuid

Sample Response Body

{
    "success": true,
    "id": "d9e6d843-9fcc-4426-aafa-bfb92146019d"
}

List existing conversations

Lists conversations between a user and other characters

GET https://api.vana.com/api/v0/conversations

Sample Response Body

{
    "success": true,
    "conversations": [
        {
            "id": "be1ee506-bc45-4ec3-9795-13629d9cf1e2",
            "speakers": [
                {
                    "id": "130d0585-f940-4084-8527-31b14ab9a783",
                    "name": "kahtaf_dev",
                    "type": "account",
                    "avatarUrl": null
                },
                {
                    "id": "088473d6-e972-426a-b2bc-f74e2a374dd1",
                    "name": "annakaz",
                    "type": "character",
                    "avatarUrl": "https://storage.googleapis.com/vana-gotchi-data-development/088473d6-e972-426a-b2bc-f74e2a374dd1/generated/20231108193735_avatar.png?Expires=1700155546&GoogleAccessId=vana-app-user%40corsali-development.iam.gserviceaccount.com&Signature=gkTy53REs%2Fi9X4aOfPPBjauu9jckzp8N5OVrjngA%2F1uD3RVjuVaqIcEE5WwwCxHhzl5%2Bk0NvdktDEg8HAdyYPsFgaqDdNRm%2BhIiZvK6sG6zxkcHG4LPACaCbyYINLvJyStIOBF%2FyN%2FXZKUWvzu9OExKuCgOn46XNiNbi7bhi%2Bwv2gQwnTJDtKs6Ek0JVsFPjvq8itnmgsEar72yNYKBkTL66sby0aeL0XcgrrPCJAIP5RT98abUHVv7QQX%2BYnGJ0tWZ%2BhZ5Sv1%2BCw%2BHrrHuaxPgMpVtwW%2B9VvIoFqSrk%2BGp90HmfQiHuOOCj38ep2wlfF27Az6WRC9Qg40Hv3tg0fQ%3D%3D"
                }
            ],
            "created": "2023-11-10T23:58:09.055753Z",
            "updated": "2023-11-10T23:58:09.055753Z"
        }
    ]
}

List messages from a conversation

Lists messages for a given conversation

GET https://api.vana.com/api/v0/conversations/:conversation-id

Path Parameters

NameTypeDescription

conversation-id*

uuid

Sample Response Body

{
    "id": "be1ee506-bc45-4ec3-9795-13629d9cf1e2",
    "speakers": [
        {
            "id": "130d0585-f940-4084-8527-31b14ab9a783",
            "name": "kahtaf_dev",
            "type": "account",
            "avatarUrl": null
        },
        {
            "id": "088473d6-e972-426a-b2bc-f74e2a374dd1",
            "name": "annakaz",
            "type": "character",
            "avatarUrl": "https://storage.googleapis.com/vana-gotchi-data-development/088473d6-e972-426a-b2bc-f74e2a374dd1/generated/20231108193735_avatar.png?Expires=1700156023&GoogleAccessId=vana-app-user%40corsali-development.iam.gserviceaccount.com&Signature=SXjNyvURqfnEW4sAYZ%2FBUcCoBSemblpfjy1XwsTkuTaV8ouzPE7OMQCV06TJTh1oP%2FTKhDmBTKx%2F5QyhjeMPFrDyeozyoL502Mlpk014s1%2B%2FJAKwCVSY2Pg%2Fsd98bqXxgbMha%2B%2FiqAclX9CEKVUGaOmpzLoKWR9S2AZY%2FVtrlTMmUDgiVDIx1IkyxCQNPEVbH4I7Q9XPL5UpixQJRxv0ChHUlr2sWjyTDh7qcm8Ch0GRP%2Bs6RztMFNub47nik7M9jG7Os7O%2BpgVPVaAP3VCs99c5VklcWlBx0rMekLCMewjio1TSjqVjH6qvYt9Hvn65r642f21lyzHVGNVQ3eiD7g%3D%3D"
        }
    ],
    "created": "2023-11-10T23:58:09.055753Z",
    "updated": "2023-11-10T23:58:09.055753Z",
    "messages": [
        {
            "id": "602a2229-daa4-4a68-8c1a-88b46feee26d",
            "content": "Hi! Tell me about yourself",
            "mimetype": "text/plain",
            "participant_id": "130d0585-f940-4084-8527-31b14ab9a783",
            "participant_type": "account",
            "created": "2023-11-10T23:58:25.322663Z"
        },
        {
            "id": "be65f5d6-c9d7-4e52-94b7-389976b6e5e2",
            "content": " Well, I'm an AI version of a person named Anna. My purpose is to be her amplified digital representation! 😄\nMy creators designed me with all the knowledge and experiences that Anna has accumulated throughout her life. So yeah, you can say I know quite a lot about various topics - but don't worry, if there are some gaps in my memory banks (which sometimes happens), just ask away and we will explore it together! After all learning never ends right?✨",
            "mimetype": "text/plain",
            "participant_id": "088473d6-e972-426a-b2bc-f74e2a374dd1",
            "participant_type": "character",
            "created": "2023-11-10T23:58:35.164647Z"
        }
    ]
}

Send a message (Synchronous)

Send a new message in a conversation

POST https://api.vana.com/api/v0/conversations/:conversation-id/chat

Path Parameters

NameTypeDescription

conversation-id*

uuid

Request Body

NameTypeDescription

data*

String

The content of the message

mimeType

String

Represents the mimeType of the data field (ex: text/plain, image/png)

allow

String Array

The allowed mimetypes of the response from the character. To receive text, use [text/plain]. To receive audio, use [audio/mp3].

Sample Request Body

{
    "data": "Hi there", 
    "mimeType": "text/plain",
    "allow": ["text/plain"]
}

Sample Response Body

{
    "data": "Hey there! It's always a pleasure to hear from you. I hope you're doing well. Just like any day, I'm here to assist you with any app or information you need. Don't hesitate to ask me anything. I'm your personal AI, after all!", 
    "mimeType": "text/plain"
}

Send a message (Stream)

Send a new message in a conversation

POST https://api.vana.com/api/v0/conversations/:conversation-id/chat/stream

Path Parameters

NameTypeDescription

conversation-id*

uuid

Request Body

NameTypeDescription

data*

String

The content of the message

mimeType

String

Represents the mimeType of the data field (ex: text/plain, image/png)

allow

String Array

The allowed mimetypes of the response from the character. To receive text, use [text/plain]. To receive audio, use [audio/mp3].

Sample Request Body

{
    "data": "Hi there", 
    "mimeType": "text/plain",
    "allow": ["text/plain"]
}

Sample Response Body

{"id":"767e557b-6e9d-4a80-9719-85d889d63bb1","object":"chat.completion.chunk","created":1701973459,"model":"vanagotchi","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":""},"finish_reason":"stop"}]}

{"id":"767e557b-6e9d-4a80-9719-85d889d63bb1","object":"chat.completion.chunk","created":1701973459,"model":"vanagotchi","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" all!"},"finish_reason":null}]}

{"id":"767e557b-6e9d-4a80-9719-85d889d63bb1","object":"chat.completion.chunk","created":1701973459,"model":"vanagotchi","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"m your personal AI, after"},"finish_reason":null}]}

{"id":"767e557b-6e9d-4a80-9719-85d889d63bb1","object":"chat.completion.chunk","created":1701973459,"model":"vanagotchi","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" to ask me anything. I'"},"finish_reason":null}]}

{"id":"767e557b-6e9d-4a80-9719-85d889d63bb1","object":"chat.completion.chunk","created":1701973459,"model":"vanagotchi","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" need. Don't hesitate"},"finish_reason":null}]}

...

{"id":"767e557b-6e9d-4a80-9719-85d889d63bb1","object":"chat.completion.chunk","created":1701973459,"model":"vanagotchi","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Hello"},"finish_reason":null}]}

Clear a conversation

Deletes all the messages in a conversation

POST https://api.vana.com/api/v0/conversations/:conversation-id/clear

Path Parameters

NameTypeDescription

conversation-id*

uuid

\Sample Response Body

{
    "success": "true"
}

Last updated