Start a chat and receive its id. Every response policy is switched on, the same as a chat started in the browser, so the decision model answers from the first message. Name a workspace of yours in workspaceId and the chat also works under that workspace's policies.
POST
/api/v1/chats
Parameter
Type
Description
name
string
A title for the chat. Optional, and it is better to leave it out: a chat with no name takes its title from the first message it is given, which is the first thing that says what it is about.
workspaceId
string
A workspace of yours to start the chat inside. The chat then works under that workspace's policies as well as the ones above: the decision policies its behaviors run under are estimated, and the response policies they add reach the prompt. A workspace that is not yours is a 404.
The whole chat: the row, its messages oldest first, and the decision turns that informed the replies. It is one request because a caller asking for a chat needs all three, and three requests is three chances to be answered about a chat that changed in between.
Replace the chat's response policy selection. This is the whole per-chat configuration: the policies declare which decision variables get estimated, so an empty list means the decision model is never called. A chat has no name to set here -- its title comes from the first message it is given.
PATCH
/api/v1/chats/:chatId
Parameter
Type
Description
policies *
string[]
The response policies this chat has switched on. The policies declare which decision variables get estimated, so an empty list turns the decision model off for this chat and spends nothing per message.
The request was not a chat this endpoint could act on -- no name, no policies array, or a policy id this application does not define.
401
status
No key, an unknown key, or a deactivated one.
404
status
No chat with that id belongs to this key. An id that does not exist and an id that is somebody else's get the same answer, so this never confirms that a chat exists.