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

# Chat

> Build an app by sending messages to its AI chat, follow the replies, and answer the AI's questions with the Base44 Apps API

> [!NOTE]
>
> The Apps API is in beta. Its endpoints and responses may change.

These endpoints drive an app's AI chat. Send a message and the AI builds from it, read the conversation, answer the questions the AI pauses on, and roll back changes you don't want. Sending a message is how you build an app after you create it.

## Turns

Each message starts a turn, which covers everything the AI does in response. A turn can take several minutes on a large change, and the request stays open until it settles. Each turn consumes credits. See [Apps API concepts](https://docs.base44.com/developers/references/apps-api/get-started/concepts.md#turns) for how a turn ends.

A `200` response doesn't mean the turn succeeded, so read the result before you treat it as done. To retry a request without paying twice, see [Retrying chat requests](https://docs.base44.com/developers/references/apps-api/sections/chat-retries.md).

## When the AI waits for you

Some steps pause for approval. A tool call with `status` set to `waiting_for_user_input` means the AI can't continue until you answer it. Find it with [Read conversation messages](https://docs.base44.com/api-reference/read-conversation-messages.md), then answer it with [Submit tool-call input](https://docs.base44.com/api-reference/submit-tool-call-input.md), or answer several at once with [Submit tool-call input (batch)](https://docs.base44.com/api-reference/submit-tool-call-input-batch.md).

## Change course

* [Stop generation](https://docs.base44.com/api-reference/stop-generation.md) stops the turn that's running. Changes already saved as a checkpoint are kept.
* [Undo message](https://docs.base44.com/api-reference/undo-message.md) rolls the app back to the checkpoint a message produced.
* [Edit and resend](https://docs.base44.com/api-reference/edit-and-resend.md) replaces an earlier message and rebuilds from there, so the changes after it are undone.

## Endpoints

* [Send chat message](https://docs.base44.com/api-reference/send-chat-message.md): Send a message to the AI chat and run the turn it starts.
* [Read conversation messages](https://docs.base44.com/api-reference/read-conversation-messages.md): Read the chat's messages and replies, oldest first.
* [Submit tool-call input](https://docs.base44.com/api-reference/submit-tool-call-input.md): Approve or reject one tool call the AI is waiting on.
* [Submit tool-call input (batch)](https://docs.base44.com/api-reference/submit-tool-call-input-batch.md): Answer several waiting tool calls at once.
* [Stop generation](https://docs.base44.com/api-reference/stop-generation.md): Stop the turn the AI is running.
* [Undo message](https://docs.base44.com/api-reference/undo-message.md): Roll the app back to the checkpoint a message produced.
* [Edit and resend](https://docs.base44.com/api-reference/edit-and-resend.md): Replace an earlier message and rebuild from there.

To retry a request safely, see [Retry chat requests](https://docs.base44.com/developers/references/apps-api/sections/chat-retries.md).


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