Add a message to a chat.
Store user or assistant messages in a chat conversation. This allows you to build a complete conversation history.
Bearer token (JWT) from OAuth2 login
Path Parameters
The ID of the chat to add the message to
Body
Message role: user or assistant
Token count for billing purposes (optional)
Response
Unique message identifier
Message order in conversation (auto-incremented)
ISO 8601 timestamp when created
Token count (if provided)
Automatic Sequencing: The sequence field is automatically incremented to maintain message order. You don’t need to manage this manually.
Token Tracking: Include the tokens field to track token usage for billing and analytics. This is especially useful when storing AI-generated responses.
Messages are stored in chronological order. The sequence number ensures correct ordering even if messages are created out of order.