The Apps API is in beta. Its endpoints and responses may change.
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 for how a turn ends. A200 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.
When the AI waits for you
Some steps pause for approval. A tool call withstatus set to waiting_for_user_input means the AI can’t continue until you answer it. Find it with Read conversation messages, then answer it with Submit tool-call input, or answer several at once with Submit tool-call input (batch).
Changing course
- Stop generation stops the turn that’s running. Changes already saved as a checkpoint are kept.
- Undo message rolls the app back to the checkpoint a message produced.
- Edit and resend replaces an earlier message and rebuilds from there, so the changes after it are undone.
Endpoints
- Send chat message: Send a message to the AI chat and run the turn it starts.
- Read conversation messages: Read the chat’s messages and replies, oldest first.
- Submit tool-call input: Approve or reject one tool call the AI is waiting on.
- Submit tool-call input (batch): Answer several waiting tool calls at once.
- Stop generation: Stop the turn the AI is running.
- Undo message: Roll the app back to the checkpoint a message produced.
- Edit and resend: Replace an earlier message and rebuild from there.