Chat turns
Omitcursor to start a conversation. Pass the cursor from the previous response to continue it. When you send a cursor, do not repeat earlier messages.
Tool confirmation
Call Function, Run Python code, and Call REST API wait for confirmation before they run. The response then contains atoolConfirmation action. Send the same cursor and a toolConfirmation message with status set to ALLOW or DENY.
Streaming
Setstream to true to receive server-sent events. Each event is an agent session response:
progressis a status update while the agent is working.responseChunkis a fragment of the reply. Concatenate the fragments.resultis the complete response, including messages, cursor, and actions. It is the last event.cursoris sent at the start whenstreamOptions.returnCursoristrue. Save it so you can resume if the stream stops. Treatresult.cursoras the cursor to store.
stream is false, the response is a single result.
The stable (
20230101) API reference does not include AI agents. Use the beta or alpha API reference for /ai/agents/... concepts and endpoint documentation.