> ## 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.

> ## Agent Instructions
> Internal links on these pages omit the .md extension. Append .md to a docs page URL, or send an Accept: text/markdown header, to get that page as markdown.

# 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.
</Note>

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](/developers/references/apps-api/get-started/concepts#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](/developers/references/apps-api/sections/chat-retries).

## 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](/api-reference/read-conversation-messages), then answer it with [Submit tool-call input](/api-reference/submit-tool-call-input), or answer several at once with [Submit tool-call input (batch)](/api-reference/submit-tool-call-input-batch).

## Changing course

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

## Endpoints

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

To retry a request safely, see [Retrying chat requests](/developers/references/apps-api/sections/chat-retries).


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