Message
Represents a single chat message in a conversation.Unique identifier for the message
The role of the message sender:
user: Message from the userassistant: Message from the AI assistantsystem: System-level instruction or prompt
The message content. Can be:
- A simple string for text-only messages
- An array of
MessageContentobjects for multimodal messages (text + images)
When the message was created
Identifier of the model that generated this message (for assistant messages)
Indicates if the message is currently being streamed
Metadata for generated images contained in the message
Example
MessageContent
Represents individual content blocks within a multimodal message.The type of content:
text: Text contentimage_url: Image reference
The text content (when
type is 'text')Image URL configuration (when
type is 'image_url')Example
GeneratedImage
Metadata for AI-generated images.URL of the generated image
Image width in pixels
Image height in pixels
Image format (e.g., ‘png’, ‘jpg’, ‘webp’)
File size in bytes
The prompt used to generate the image
The model used to generate the image
When the image was generated