Skip to main content

Messages

Message types used in chat completions.

MessageType

Messages follow a role-based structure with multi-modal content support.

Fields

role
string
required
The message sender role. One of:
  • "system" — System instructions
  • "user" — User input
  • "assistant" — Model response
  • "tool" — Tool call result
content
ContentType[]
required
Array of content items. Each item has a modality and value.

ContentType

Content items represent different modalities within a message.

Text Content

Image Content

Tool Call Content

Returned by the model when it wants to invoke a tool.

Tool Result Content

Sent back to the model with the tool’s response.