ContentPart
Content parts composing a message (flattened structure for JSON compatibility)
Usage profiles
| Usage | Fields and validation |
|---|---|
| In requests | View fields |
| In responses | View fields |
| In webhook payloads | View fields |
In requests
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
type | string (CONTENT_PART_TYPE_TEXT, CONTENT_PART_TYPE_IMAGE_URL, CONTENT_PART_TYPE_IMAGE_BASE64, CONTENT_PART_TYPE_FILE_ID, CONTENT_PART_TYPE_FILE_PATH, CONTENT_PART_TYPE_FILE_URL, CONTENT_PART_TYPE_FILE_DATA_URL, CONTENT_PART_TYPE_AUDIO_BASE64, CONTENT_PART_TYPE_REASONING) or integer (int32) (1, 2, 3, 4, 5, 6, 7, 8, 9) | Optional | Kind of content carried by this message part. |
content | string | Optional | Text content, image URL, file ID, or base64-encoded data. |
metadata | Map from string to string | Optional | Additional type-specific metadata (dimensions, mime_type, etc.). |
cachePreferred | boolean | Optional | Hint that this part is eligible for provider prompt caching. |
structuredMessage | StructuredMessage | Optional | Populated on TEXT parts for structured output responses. |
Values of type
Discriminator identifying which content representation a message part carries.
| Value | No. | Form | Meaning |
|---|---|---|---|
CONTENT_PART_TYPE_TEXT | 1 | Canonical | Plain text carried by the content part. |
CONTENT_PART_TYPE_IMAGE_URL | 2 | Canonical | An image supplied through a remote URL. |
CONTENT_PART_TYPE_IMAGE_BASE64 | 3 | Canonical | An image supplied as base64-encoded bytes. |
CONTENT_PART_TYPE_FILE_ID | 4 | Canonical | A provider file identifier or internal storage identifier resolved before generation. |
CONTENT_PART_TYPE_FILE_PATH | 5 | Canonical | A reference to a local file path. |
CONTENT_PART_TYPE_FILE_URL | 6 | Canonical | A file supplied through a public or signed URL. |
CONTENT_PART_TYPE_FILE_DATA_URL | 7 | Canonical | A file embedded in a data URL, including its media type and encoded data. |
CONTENT_PART_TYPE_AUDIO_BASE64 | 8 | Canonical | Base64-encoded audio; the part metadata identifies its audio format. |
CONTENT_PART_TYPE_REASONING | 9 | Canonical | A reasoning segment returned by a model provider, when available. |
Request validation
These rules apply when this value is supplied in a request. Request validation does not guarantee that response fields are present or satisfy the same rules.
| Applies to | Rule | Requirement |
|---|---|---|
type | Defined enum value | true |
In responses
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
type | string (CONTENT_PART_TYPE_TEXT, CONTENT_PART_TYPE_IMAGE_URL, CONTENT_PART_TYPE_IMAGE_BASE64, CONTENT_PART_TYPE_FILE_ID, CONTENT_PART_TYPE_FILE_PATH, CONTENT_PART_TYPE_FILE_URL, CONTENT_PART_TYPE_FILE_DATA_URL, CONTENT_PART_TYPE_AUDIO_BASE64, CONTENT_PART_TYPE_REASONING) or integer (int32) | Optional | Kind of content carried by this message part. |
content | string | Optional | Text content, image URL, file ID, or base64-encoded data. |
metadata | Map from string to string | Optional | Additional type-specific metadata (dimensions, mime_type, etc.). |
cachePreferred | boolean | Optional | Hint that this part is eligible for provider prompt caching. |
structuredMessage | StructuredMessage | Optional | Populated on TEXT parts for structured output responses. |
Values of type
Discriminator identifying which content representation a message part carries.
| Value | No. | Form | Meaning |
|---|---|---|---|
CONTENT_PART_TYPE_TEXT | 1 | Canonical | Plain text carried by the content part. |
CONTENT_PART_TYPE_IMAGE_URL | 2 | Canonical | An image supplied through a remote URL. |
CONTENT_PART_TYPE_IMAGE_BASE64 | 3 | Canonical | An image supplied as base64-encoded bytes. |
CONTENT_PART_TYPE_FILE_ID | 4 | Canonical | A provider file identifier or internal storage identifier resolved before generation. |
CONTENT_PART_TYPE_FILE_PATH | 5 | Canonical | A reference to a local file path. |
CONTENT_PART_TYPE_FILE_URL | 6 | Canonical | A file supplied through a public or signed URL. |
CONTENT_PART_TYPE_FILE_DATA_URL | 7 | Canonical | A file embedded in a data URL, including its media type and encoded data. |
CONTENT_PART_TYPE_AUDIO_BASE64 | 8 | Canonical | Base64-encoded audio; the part metadata identifies its audio format. |
CONTENT_PART_TYPE_REASONING | 9 | Canonical | A reasoning segment returned by a model provider, when available. |
Request validation
These rules apply when this value is supplied in a request. Request validation does not guarantee that response fields are present or satisfy the same rules.
| Applies to | Rule | Requirement |
|---|---|---|
type | Defined enum value | true |
In webhook payloads
Webhook JSON uses protobuf field names (snake_case).
| Field | Type | Presence | Meaning |
|---|---|---|---|
type | string (CONTENT_PART_TYPE_TEXT, CONTENT_PART_TYPE_IMAGE_URL, CONTENT_PART_TYPE_IMAGE_BASE64, CONTENT_PART_TYPE_FILE_ID, CONTENT_PART_TYPE_FILE_PATH, CONTENT_PART_TYPE_FILE_URL, CONTENT_PART_TYPE_FILE_DATA_URL, CONTENT_PART_TYPE_AUDIO_BASE64, CONTENT_PART_TYPE_REASONING) or integer (int32) | Optional | Kind of content carried by this message part. |
content | string | Optional | Text content, image URL, file ID, or base64-encoded data. |
metadata | Map from string to string | Optional | Additional type-specific metadata (dimensions, mime_type, etc.). |
cache_preferred | boolean | Optional | Hint that this part is eligible for provider prompt caching. |
structured_message | StructuredMessage | Optional | Populated on TEXT parts for structured output responses. |
Values of type
Discriminator identifying which content representation a message part carries.
| Value | No. | Form | Meaning |
|---|---|---|---|
CONTENT_PART_TYPE_TEXT | 1 | Canonical | Plain text carried by the content part. |
CONTENT_PART_TYPE_IMAGE_URL | 2 | Canonical | An image supplied through a remote URL. |
CONTENT_PART_TYPE_IMAGE_BASE64 | 3 | Canonical | An image supplied as base64-encoded bytes. |
CONTENT_PART_TYPE_FILE_ID | 4 | Canonical | A provider file identifier or internal storage identifier resolved before generation. |
CONTENT_PART_TYPE_FILE_PATH | 5 | Canonical | A reference to a local file path. |
CONTENT_PART_TYPE_FILE_URL | 6 | Canonical | A file supplied through a public or signed URL. |
CONTENT_PART_TYPE_FILE_DATA_URL | 7 | Canonical | A file embedded in a data URL, including its media type and encoded data. |
CONTENT_PART_TYPE_AUDIO_BASE64 | 8 | Canonical | Base64-encoded audio; the part metadata identifies its audio format. |
CONTENT_PART_TYPE_REASONING | 9 | Canonical | A reasoning segment returned by a model provider, when available. |
Request validation
These rules apply when this value is supplied in a request. Request validation does not guarantee that response fields are present or satisfy the same rules.
| Applies to | Rule | Requirement |
|---|---|---|
type | Defined enum value | true |
Where used
| Reference | Relationship |
|---|---|
| Append a message without generating | POST /api/v1/llm/append-message |
| Send a message to a conversation | POST /api/v1/llm/send-message |
| Send a message and wait for the result | POST /api/v1/llm/send-message-sync |
| Withdraw your rating on a message | POST /api/v1/llm/delete-message-rating |
| Get full conversation state | POST /api/v1/llm/conversation-state |
| List MCP resources | POST /api/v1/llm/mcp-list-resources |
| Read an MCP resource | POST /api/v1/llm/mcp-read-resource |
| Rate an assistant message | POST /api/v1/llm/rate-message |
| Submit client-side tool results and wait for the next segment | POST /api/v1/llm/submit-client-tool-results-sync |
| llm.message_published | Webhook JSON uses protobuf field names (snake_case). |
| Message | Nested in model |
| Message | Nested in model |
| Message | Nested in model |
| PdfAnnotation | Nested in model |
| PdfAnnotation | Nested in model |
| PdfAnnotation | Nested in model |
| Resource | Nested in model |
Download the public reference contract.
Document: DOC-API-MODEL-content-part.