Skip to main content
ElevenLabs Documentation Docs

Search documentation

Type to search this documentation.

On this pageOverview

Chat Mode

There are two main ways to enable chat mode:

  1. Agent Configuration: Configure your agent for text-only mode when creating it via the API
  2. Runtime Overrides: Use SDK overrides to enforce text-only conversations programmatically

This guide covers both approaches and how to implement chat mode across different SDKs.

Configure an agent for text-only mode to make it the default for every conversation with that agent.

Open your agent in the dashboard, navigate to the Advanced tab, and enable the Text only toggle. Save your changes.

Bash
elevenlabs agents pull --agent "<agent-name>"

Set conversation_config.conversation.text_only:

JSON
{
  "conversation_config": {
    "conversation": {
      "text_only": true
    }
  }
}
Bash
elevenlabs agents push --agent "<agent-name>"
Python
from elevenlabs import ElevenLabs

elevenlabs = ElevenLabs()

elevenlabs.conversational_ai.agents.update(
    agent_id="agent_7101k5zvyjhmfg983brhmhkd98n6",
    conversation_config={
        "conversation": {"text_only": True},
    },
)
TypeScript
import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

const elevenlabs = new ElevenLabsClient();

await elevenlabs.conversationalAi.agents.update("agent_7101k5zvyjhmfg983brhmhkd98n6", {
  conversationConfig: {
    conversation: { textOnly: true },
  },
});

To enable chat mode at runtime using overrides (rather than configuring at the agent level), you can use the textOnly override in your conversation configuration:

Python
from elevenlabs.client import ElevenLabs
from elevenlabs.conversational_ai.conversation import Conversation, ConversationInitiationData

# Configure for text-only mode with proper structure
conversation_override = {
    "conversation": {
        "text_only": True
    }
}

config = ConversationInitiationData(
    conversation_config_override=conversation_override
)

conversation = Conversation(
    elevenlabs,
    agent_id,
    requires_auth=bool(api_key),
    config=config,
    # Important: Ensure agent_response callback is set
    callback_agent_response=lambda response: print(f"Agent: {response}"),
    callback_user_transcript=lambda transcript: print(f"User: {transcript}"),
)

conversation.start_session()
JavaScript
const conversation = await Conversation.startSession({
  agentId: "<your-agent-id>",
  overrides: {
    conversation: {
      textOnly: true,
    },
  },
});

This configuration ensures that:

  • No audio input/output is used
  • All communication happens through text messages
  • The conversation operates in a chat-like interface mode
  1. Agent Response Event: Always configure the agent_response callback or event handler to receive and display the agent's text messages.

  2. Agent Configuration: If your agent is specifically set to chat mode in the agent settings, it will automatically use text-only conversations without requiring the override.

  3. No Audio Interface: When using text-only mode, you don't need to configure audio interfaces or request microphone permissions.

Python
def handle_agent_response(response):
    """Critical handler for displaying agent messages"""
    print(f"Agent: {response}")  # Update your UI with the response
    update_chat_ui(response)

config = ConversationInitiationData(
    conversation_config_override={"conversation": {"text_only": True}}
)

conversation = Conversation(
  elevenlabs,
  agent_id,
  config=config,
  callback_agent_response=handle_agent_response,
)

conversation.start_session()
JavaScript
const conversation = await Conversation.startSession({
  agentId: "<your-agent-id>",
  overrides: {
    conversation: {
      textOnly: true,
    },
  },
  // Critical: Handle agent responses
  onMessage: (message) => {
    if (message.type === "agent_response") {
      console.log("Agent:", message.text);
      // Display in your UI
      displayAgentMessage(message.text);
    }
  },
});

In chat mode, you'll need to send user messages programmatically instead of through audio:

Python
# Send a text message to the agent
conversation.send_user_message("Hello, how can you help me today?")
JavaScript
// Send a text message to the agent
conversation.sendUserMessage({
  text: "Hello, how can you help me today?",
});

Chat mode provides significant concurrency advantages over voice conversations:

  • Higher Limits: Chat-only conversations have 25x higher concurrency limits than voice conversations
  • Separate Pool: Text conversations use a dedicated concurrency pool, independent of voice conversation limits
  • Scalability: Ideal for high-throughput applications like customer support, chatbots, or automated testing
Plan Voice Concurrency Chat-only Concurrency
Free 4 100
Starter 6 150
Creator 10 250
Pro 20 500
Scale 30 750
Business 30 750
Enterprise Elevated Elevated (25x)

Chat mode is ideal for:

  • Chat Interfaces: Building traditional chat UIs without voice
  • Testing: Testing agent logic without audio dependencies
  • Accessibility: Providing text-based alternatives for users
  • Silent Environments: When audio input/output is not appropriate
  • Integration Testing: Automated testing of agent conversations

If the agent's responses are not appearing:

  1. Verify the agent_response callback is properly configured
  2. Check that the agent is configured for chat mode or the textOnly override is set
  3. Ensure the WebSocket connection is established successfully
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu