Skip to main content
The Conversation Service provides endpoints for creating and managing conversations, chat sessions, and handling message interactions with language models.

Authentication

All endpoints require a valid Bearer token in the Authorization header.

Base URL

Endpoints

Create Conversation

Create a new conversation.
Endpoint: POST /api/conversation/create Query Parameters: Request Body: Response:

Create Chat Session

Create a new chat session for a conversation with a specific language model.
Endpoint: POST /api/conversation/create_session Query Parameters: Request Body: Response:

Stream Chat

Send a message and receive a streaming response from the language model.
Endpoint: POST /api/conversation/stream_chat Query Parameters: Request Body: Response: Server-sent events (SSE) stream with the following event types:
  • start: Indicates the beginning of the response with a message ID
  • content: Contains chunks of the model’s response content
  • end: Indicates the end of the response

List Conversations

Get a list of all conversations for an organization.
Endpoint: GET /api/conversation/list Query Parameters:

Get Conversation with Sessions

Get details of a specific conversation including its chat sessions.
Endpoint: GET /api/conversation/get_with_sessions Query Parameters:

Get Messages

Get messages from a conversation.
Endpoint: GET /api/conversation/messages Query Parameters:

Error Responses

Implementation Notes

  • The streaming API uses Server-Sent Events (SSE) to deliver model responses
  • Messages are stored in the database and can be retrieved historically
  • Multiple chat sessions can be created for a single conversation, each using a different model
  • Responses are generated asynchronously, allowing for real-time streaming of content