v1 inference

Generate persona-based chat response

Generate AI response as a specific persona with Elicit Labs Modal System.

This endpoint:
- Retrieves persona information and characteristics
- Formats messages with persona-specific context and memories
- Generates response in the persona's unique style and voice
- Optionally learns from the conversation (disabled_learning=False)
- Returns synchronous response with formatted messages

**Required Parameters:**
- user_id (str, required): The owning user ID
- persona_id (str, required): The persona ID to chat as

**Authentication**: Requires valid API key or JWT token in Authorization header
post/v1/inference/persona-chat

Request body

user_idstring required

User ID (always required)

persona_idstring required

Persona ID to chat as (required for persona chat)

session_idstring nullable

Session identifier

modelstring

LLM model to use for generation

disabled_learningboolean

Whether to disable learning

Example request

{
  "content": [
    {
      "content": "You are a helpful AI assistant.",
      "role": "system"
    },
    {
      "content": "Hello, how are you?",
      "role": "user"
    }
  ],
  "model": "gpt-4.1-mini",
  "persona_id": "persona-456",
  "session_id": "session-abc",
  "user_id": "user-123"
}

Response

Successful Response

messagesobject[] nullable required

Formatted messages with memory context

responsestring nullable

Generated response content

Example response

{
  "messages": [
    {
      "content": "You are a helpful AI assistant...",
      "role": "system"
    },
    {
      "content": "Hello, how are you?",
      "role": "user"
    },
    {
      "content": "I'm doing well, thank you for asking. How can I help you today?",
      "role": "assistant"
    }
  ],
  "response": "I'm doing well, thank you for asking. How can I help you today?"
}

Changes