Skip to main content

ContentPart

Content parts composing a message (flattened structure for JSON compatibility)

Usage profiles​

UsageFields and validation
In requestsView fields
In responsesView fields
In webhook payloadsView fields

In requests​

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
typestring (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)OptionalKind of content carried by this message part.
contentstringOptionalText content, image URL, file ID, or base64-encoded data.
metadataMap from string to stringOptionalAdditional type-specific metadata (dimensions, mime_type, etc.).
cachePreferredbooleanOptionalHint that this part is eligible for provider prompt caching.
structuredMessageStructuredMessageOptionalPopulated on TEXT parts for structured output responses.

Values of type​

Discriminator identifying which content representation a message part carries.

ValueNo.FormMeaning
CONTENT_PART_TYPE_TEXT1CanonicalPlain text carried by the content part.
CONTENT_PART_TYPE_IMAGE_URL2CanonicalAn image supplied through a remote URL.
CONTENT_PART_TYPE_IMAGE_BASE643CanonicalAn image supplied as base64-encoded bytes.
CONTENT_PART_TYPE_FILE_ID4CanonicalA provider file identifier or internal storage identifier resolved before generation.
CONTENT_PART_TYPE_FILE_PATH5CanonicalA reference to a local file path.
CONTENT_PART_TYPE_FILE_URL6CanonicalA file supplied through a public or signed URL.
CONTENT_PART_TYPE_FILE_DATA_URL7CanonicalA file embedded in a data URL, including its media type and encoded data.
CONTENT_PART_TYPE_AUDIO_BASE648CanonicalBase64-encoded audio; the part metadata identifies its audio format.
CONTENT_PART_TYPE_REASONING9CanonicalA 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 toRuleRequirement
typeDefined enum valuetrue

In responses​

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
typestring (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)OptionalKind of content carried by this message part.
contentstringOptionalText content, image URL, file ID, or base64-encoded data.
metadataMap from string to stringOptionalAdditional type-specific metadata (dimensions, mime_type, etc.).
cachePreferredbooleanOptionalHint that this part is eligible for provider prompt caching.
structuredMessageStructuredMessageOptionalPopulated on TEXT parts for structured output responses.

Values of type​

Discriminator identifying which content representation a message part carries.

ValueNo.FormMeaning
CONTENT_PART_TYPE_TEXT1CanonicalPlain text carried by the content part.
CONTENT_PART_TYPE_IMAGE_URL2CanonicalAn image supplied through a remote URL.
CONTENT_PART_TYPE_IMAGE_BASE643CanonicalAn image supplied as base64-encoded bytes.
CONTENT_PART_TYPE_FILE_ID4CanonicalA provider file identifier or internal storage identifier resolved before generation.
CONTENT_PART_TYPE_FILE_PATH5CanonicalA reference to a local file path.
CONTENT_PART_TYPE_FILE_URL6CanonicalA file supplied through a public or signed URL.
CONTENT_PART_TYPE_FILE_DATA_URL7CanonicalA file embedded in a data URL, including its media type and encoded data.
CONTENT_PART_TYPE_AUDIO_BASE648CanonicalBase64-encoded audio; the part metadata identifies its audio format.
CONTENT_PART_TYPE_REASONING9CanonicalA 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 toRuleRequirement
typeDefined enum valuetrue

In webhook payloads​

Webhook JSON uses protobuf field names (snake_case).

FieldTypePresenceMeaning
typestring (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)OptionalKind of content carried by this message part.
contentstringOptionalText content, image URL, file ID, or base64-encoded data.
metadataMap from string to stringOptionalAdditional type-specific metadata (dimensions, mime_type, etc.).
cache_preferredbooleanOptionalHint that this part is eligible for provider prompt caching.
structured_messageStructuredMessageOptionalPopulated on TEXT parts for structured output responses.

Values of type​

Discriminator identifying which content representation a message part carries.

ValueNo.FormMeaning
CONTENT_PART_TYPE_TEXT1CanonicalPlain text carried by the content part.
CONTENT_PART_TYPE_IMAGE_URL2CanonicalAn image supplied through a remote URL.
CONTENT_PART_TYPE_IMAGE_BASE643CanonicalAn image supplied as base64-encoded bytes.
CONTENT_PART_TYPE_FILE_ID4CanonicalA provider file identifier or internal storage identifier resolved before generation.
CONTENT_PART_TYPE_FILE_PATH5CanonicalA reference to a local file path.
CONTENT_PART_TYPE_FILE_URL6CanonicalA file supplied through a public or signed URL.
CONTENT_PART_TYPE_FILE_DATA_URL7CanonicalA file embedded in a data URL, including its media type and encoded data.
CONTENT_PART_TYPE_AUDIO_BASE648CanonicalBase64-encoded audio; the part metadata identifies its audio format.
CONTENT_PART_TYPE_REASONING9CanonicalA 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 toRuleRequirement
typeDefined enum valuetrue

Where used​

ReferenceRelationship
Append a message without generatingPOST /api/v1/llm/append-message
Send a message to a conversationPOST /api/v1/llm/send-message
Send a message and wait for the resultPOST /api/v1/llm/send-message-sync
Withdraw your rating on a messagePOST /api/v1/llm/delete-message-rating
Get full conversation statePOST /api/v1/llm/conversation-state
List MCP resourcesPOST /api/v1/llm/mcp-list-resources
Read an MCP resourcePOST /api/v1/llm/mcp-read-resource
Rate an assistant messagePOST /api/v1/llm/rate-message
Submit client-side tool results and wait for the next segmentPOST /api/v1/llm/submit-client-tool-results-sync
llm.message_publishedWebhook JSON uses protobuf field names (snake_case).
MessageNested in model
MessageNested in model
MessageNested in model
PdfAnnotationNested in model
PdfAnnotationNested in model
PdfAnnotationNested in model
ResourceNested in model

Download the public reference contract.

Document: DOC-API-MODEL-content-part.