Stop generation
Changed on<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>
Stops the turn the AI is currently running and returns the app once it has settled.
Files the AI finished writing before the stop are kept, so the app's code matches the backend functions and entity schemas the turn already applied. A change that spans several files can be left incomplete. The conversation keeps the partial turn, so send a new message with Send chat message to carry on from there.
The stopped turn is charged for the work the AI finished before the stop, at the same rate as a completed turn. The amount is reported as credits_charged in the usage of the last reply the AI finished before the stop. A turn stopped before its first reply costs nothing.
To throw the stopped turn's changes away, roll back to the checkpoint of the message that started it with Undo message. An app's first turn has no earlier checkpoint, so it can't be undone this way.
On an app imported from GitHub, Stop still discards the stopped turn's uncommitted changes.
Stopping an app that is not running anything is not an error. You get the app back unchanged, which makes this safe to call whenever you are unsure whether a turn is still going.
If messages are waiting in the queue, stopping also pauses it, so none of them start and new messages you send join it. Call Resume message queue to carry on.
Set branch_id to stop the turn running on that branch. On a branch, Stop also cancels an update from main that's in progress there, even when no turn is running. Without branch_id, Stop acts on main and leaves turns on branches running.
<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>
Request
- Base URL: https://app.base44.com
- URL: https://app.base44.com/api/apps/{app_id}/chat/stop
- Auth: HTTP bearer
Path parameters
ID of the app whose AI chat this request acts on.
Query parameters
ID of the branch to work on, as returned by List branches. Omit it to work on the app's main branch.
Response
Successful Response
Example response
{
"id": "6820f3a4e7b91d003c45a1f2",
"name": "My CRM",
"status": {
"state": "ready",
"details": "Publishing app",
"request_id": "a1b2c3d4e5f67890abcdef12",
"last_updated_date": "2026-08-02T14:30:00Z",
"error_source": "build",
"paywall_context": {
"billing_organization_id": "67e0b12c4d8a3f005b21c9e4",
"user_id": "6706af53b9c1e2004a37d85f",
"evaluated_at": "2026-08-02T14:30:00Z"
}
},
"conversation": {
"id": "1f0c2b7a-9d51-4c3e-8a62-7b4d5e6f8a90",
"messages": [
{
"id": "7f3a1c88-52d4-4a0e-9b31-2c6f0d8e4a19",
"role": "assistant",
"content": "I added a contact form to the home page.",
"file_urls": [
"https://example.com/mockup.png"
],
"checkpoint_id": "6886b8d390dc7e2f4a2c91b3",
"tool_calls": [
{
"id": "toolu_01A9FJd3kP2mNqRs7VwXyZ4b",
"name": "create_file",
"status": "waiting_for_user_input",
"requires_user_input": true,
"arguments_string": "{\"file_path\": \"src/pages/Home.jsx\", \"content\": \"export default function Home() {}\"}"
}
],
"usage": {
"prompt_tokens": 18432,
"completion_tokens": 742,
"credits_charged": 1.5
},
"metadata": {
"created_date": "2026-08-02T14:30:00",
"created_by_email": "developer@example.com"
}
}
]
}
}Changes
- breaking
queryrequest parameterbranch_idlist-of-types was narrowed by removing typesnull - info
for the
queryrequest parameterbranch_id, the type was generalized from no type tostring
- breaking
- info
added the new optional
queryrequest parameterbranch_id
- info