Skip to content

Messages ​

A summary of common objects in chats, tool calls, and usage statistics.

Message Object ​

FieldTypeDescription
rolestringMessage role
contentstring/arrayText or multimodal content
namestringOptional name
tool_callsarrayTool calls initiated by the assistant
tool_call_idstringCall ID associated with the tool message

Content Parts ​

TypeDescription
textText input
image_urlImage URL or base64 image
input_audioAudio input, including data and format
fileFile input, depending on the model and channel

Multimodal Example ​

json
{
  "role": "user",
  "content": [
    {"type": "text", "text": "Describe this image"},
    {"type": "image_url", "image_url": {"url": "https://example.com/image.png"}}
  ]
}

The field formats for images, audio, and files are not supported by all models. Before making a call, confirm the model's capabilities, file size limits, and upstream channel restrictions.