Messages
A summary of common objects in chats, tool calls, and usage statistics.
Message Object
| Field | Type | Description |
|---|---|---|
role | string | Message role |
content | string/array | Text or multimodal content |
name | string | Optional name |
tool_calls | array | Tool calls initiated by the assistant |
tool_call_id | string | Call ID associated with the tool message |
Content Parts
| Type | Description |
|---|---|
text | Text input |
image_url | Image URL or base64 image |
input_audio | Audio input, including data and format |
file | File 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.
