> ## Documentation Index
> Fetch the complete documentation index at: https://docs.retellai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create chat agent

> Build a Retell chat agent in the dashboard or API for text conversations, convert a voice agent to chat, and deploy via web widget, SMS, or API.

Chat agents hold text conversations with your users. They use the same prompt types, [functions](https://docs.retellai.com/build/add-function-calling), and [knowledge bases](https://docs.retellai.com/build/knowledge-base.md) as voice agents, so you can offer the experience you built for calls over text as well — on your website, over SMS, or inside your own app.

> [!NOTE]
>
> Retell has no built-in integrations with third-party chat platforms such as WhatsApp or Messenger. Beyond the [website widget](https://docs.retellai.com/deploy/chat-widget.md) and [SMS](https://docs.retellai.com/deploy/enable-sms.md), you connect your own channel through the [chat API](https://docs.retellai.com/api-references/create-chat.md).

## When to use a chat agent

Use a chat agent when your users type instead of talk:

* **Website support** — answer product, billing, or order questions in a chat widget on your site.
* **SMS conversations** — run two-way text threads on a Twilio number, such as appointment reminders with reschedule handling.
* **In-app assistant** — power a chat UI you build into your own web or mobile app.

For example, an e-commerce store embeds a chat agent in its help center to handle order-status questions: the agent looks up the order with a custom function and replies with the tracking link, so support staff only see the conversations the agent escalates.

## Create a chat agent

**1. Start a new agent**

In the dashboard, open **Agents**, click **Create an Agent**, and select **Chat Agent**.

**2. Pick an agent type**

Choose **Single prompt** for simple free-form conversations or **Conversational flow** for structured flows. Custom LLM is voice-only, so it can't power a chat agent.

**3. Configure the agent**

Write the [prompt](https://docs.retellai.com/build/prompt-engineering-guide.md), attach functions and a knowledge base, and adjust the chat settings described below.

![Retell dashboard Agents page with the Create an Agent dropdown open, showing Voice Agent and Chat Agent options with Chat Agent highlighted](https://mintcdn.com/retellai/yfI-f20iptEBfJzl/images/create-chat-agent.png?fit=max\&auto=format\&n=yfI-f20iptEBfJzl\&q=85\&s=2a7c5049e6841edf7dfb9d3836c2d699)

The Create an Agent menu on the Agents page, with the Chat Agent option highlighted.

To create chat agents programmatically, call [Create Chat Agent](https://docs.retellai.com/api-references/create-chat-agent.md) with a Retell LLM or conversation flow response engine.

## Convert an existing voice agent

Converting creates a **new chat agent** based on your voice agent's setup. The original voice agent is not modified and keeps working as before.

**1. Open the voice agent**

In the agent builder, click the **More options** menu in the top-right corner and select **Convert to Chat Agent**.

**2. Confirm the conversion**

A dialog confirms that a new chat agent will be created and your original agent stays unchanged. Click **Convert**.

**3. Review the new chat agent**

Retell opens the new chat agent. Voice-only features are removed during conversion, so review the prompt and flow and adjust anything that referenced them.

Conversion removes what doesn't apply to text:

* **Nodes and functions**: call transfer (including bridge and cancel transfer), press digit (IVR navigation), and mid-call SMS are deleted, and any dangling flow connections are cleaned up.
* **Settings**: voice, speech, transcription, and call settings (voicemail detection, DTMF input, and similar) don't exist on chat agents.

![Convert to Chat Agent confirmation explaining that a new chat agent is created and the original remains unchanged, with Cancel and Convert buttons.](https://mintcdn.com/retellai/Mg1hiS-BnevMo90k/images/agent-settings-convert-chat-confirm.png?fit=max\&auto=format\&n=Mg1hiS-BnevMo90k\&q=85\&s=e58381b7d8cbfc57b5181100e0fd3760)

Review the conversion confirmation before creating a chat agent.

Conversion works in both directions: a chat agent's **More options** menu offers **Convert to Voice Agent**.

## Chat settings

Chat agents share most configuration with voice agents — prompt, functions, knowledge base, [webhooks](https://docs.retellai.com/features/webhook-overview.md), security, and **Post chat extraction** — and add a **Chat settings** section:

* **Auto-close inactive chats** — end the chat automatically when the user stops responding. Set the timeout anywhere from 2 minutes to 72 hours (`end_chat_after_silence_ms`; the API default is 1 hour).
* **Auto-close message** — an optional message sent when a chat is closed automatically (`auto_close_message`).

For chat events, webhooks fire `chat_started`, `chat_ended`, and `chat_analyzed` by default; add `transcript_updated` through the agent's `webhook_events` if you need per-message updates.

The agent's **Workflow** page works the same as it does for voice, with the two function slots named **pre-chat** and **post-chat functions**: look the user up in your CRM before the agent's first message, then log the outcome once the chat ends. See [agent workflow](https://docs.retellai.com/agent/agent-workflow.md).

### Welcome message

For a single-prompt chat agent, choose **User speaks first** or **AI speaks first** under **Welcome Message**. Inbound chats always start with the user, regardless of this setting. For [outbound SMS](https://docs.retellai.com/deploy/enable-sms.md#set-up-two-way-sms-conversation), select **AI speaks first**; otherwise the agent sends no initial message.

With **AI speaks first**, choose **Dynamic message** to generate the greeting from the agent's instructions, or **Custom message** to send the text you enter. Custom messages support [dynamic variables](https://docs.retellai.com/build/dynamic-variables.md), such as `Hi {{customer_name}}, can we confirm your appointment?`.

For a conversation flow chat agent, select the begin node and set **Who speaks first** to **AI speaks first**. Configure the opening message in the flow's first speaking node.

## Deploy your chat agent

Chat agents are headless — Retell does not host a chat UI for end users, so you choose how to surface the agent:

* **Website widget** — embed a single `<script>` tag on your site for text chat, in-browser voice calls, or both, with no backend required. See [website widget](https://docs.retellai.com/deploy/chat-widget.md).
* **SMS** — connect the agent to a Twilio phone number so users can text it directly. See [Enable SMS](https://docs.retellai.com/deploy/enable-sms.md).
* **Custom integration** — build your own UI on the chat API: [Create chat](https://docs.retellai.com/api-references/create-chat.md) starts a session, [Create chat completion](https://docs.retellai.com/deploy/create-chat-completion.md) exchanges messages, and the session stays open until you call [End chat](https://docs.retellai.com/api-references/end-chat.md) or the inactivity timeout closes it.

Once live, set up [alert rules](https://docs.retellai.com/features/alerting-overview.md) on chat volume, success rate, negative sentiment, or cost to hear about problems without watching the dashboard.

## FAQ

> [accordion] Can a chat agent use my custom LLM?
>
> No. Custom LLM agents are voice-only.

> [accordion] Does converting a voice agent change or delete the original?
>
> No. Conversion creates a separate chat agent; the original voice agent is untouched and any phone numbers attached to it keep working.

> [accordion] How does a chat session end?
>
> Three ways: the agent ends it (an end-chat node or function), you end it with the [End chat API](https://docs.retellai.com/api-references/end-chat.md), or the user goes silent past the inactivity timeout and Retell closes it automatically.

> [accordion] How are chat agents billed?
>
> Chat is billed per agent message, with add-ons (such as guardrails) also charged per message. See [pricing](https://www.retellai.com/pricing) for current rates.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.