Skip to main content
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#overview

Message

Chat message

At least one of content or tool_calls must contain an entry; both lists may be nonempty. role must select a listed message role. Requiredness and allowed values are declared separately.

Type-reference view: API Schema 9frhv4euve, API Schema 9ftjkkjhfa. Request and response views describe this type; they do not declare an endpoint.

Meaning and usage​

Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#meaning

See the definition above.

Usage profiles​

Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#fields

UsageFields and validation
In requestsView fields
In responsesView fields

In requests​

Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-rolerolestring (ROLE_SYSTEM, ROLE_USER, ROLE_ASSISTANT, ROLE_TOOL) or integer (int32) (0, 1, 2, 3)Required in requestsRole of the participant that produced the chat message.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-contentcontentArray of ContentPartOptionalContent parts composing the chat message.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-toolcallstoolCallsArray of ToolCallOptionalAssistant-to-tool invocations.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-namenamestringOptionalSee meaning below.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-timestamptimestampstring (date-time)OptionalTimestamp associated with the conversation message or event.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-messageidmessageIdstringOptionalUnique message identifier.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-annotationsannotationsArray of AnnotationOptionalStructured annotations (e.g., standardized web search URL citations, PDF reuse tokens)
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-sequencesequencestring (int64)OptionalMonotonic, per-conversation sequence number for stable ordering (1-based) Pattern: ^-?\d+$.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-generatedbygeneratedBystringOptionalWorkflow run id or generator key that produced this message (e.g., workflow run key)
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-usageusageUsageOptionalToken usage for this generation (populated for assistant messages)
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-modelmodelstringOptionalModel that generated this message (e.g., "anthropic/claude-sonnet-4")
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-generationcontextgenerationContextGenerationContextOptionalDynamic context that shaped this generation (memories, search params, turn info)
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-clientcontextclientContextClientContextOptionalArbitrary client-supplied context attached by the client for this message
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-feedbackfeedbackArray of MessageFeedbackOptionalFeedback on an assistant message, with one entry per rater identified by rated_by. A later rating by the same rater replaces their earlier entry.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-sourceusermessageidsourceUserMessageIdstringOptionalSee meaning below.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-field-finishreasonfinishReasonstringOptionalWhy the model stopped, verbatim from the provider: "stop", "tool_calls", "length", "error". Empty for historical messages.

name

Name identifying the sender of the chat message.

optional sender name

sourceUserMessageId

Identifier of the user message that opened this conversation turn. Generated messages in the same turn share this value; a user message carries its own message_id. Empty on historical messages that predate turn attribution.

Use this field for turn attribution rather than inferring it from message adjacency or a client-supplied message_id. The generated_by identifier groups messages by generation run but does not identify the user message that opened the turn.

Values of role​

Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#request-values-role

Participant role attached to a conversation message and forwarded in model context.

ValueNo.FormMeaning
ROLE_SYSTEM0CanonicalInstructions or context provided as a system message.
ROLE_USER1CanonicalInput supplied by the user or customer application.
ROLE_ASSISTANT2CanonicalContent produced by the assistant, including its tool-call requests.
ROLE_TOOL3CanonicalA tool result supplied back to the assistant.

Request validation​

Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#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
Messagenative.group.message_contentcontent or tool_calls required
roleRequired valuetrue
roleDefined enum valuetrue

In responses​

Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#response

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-roleSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-rolerolestring (ROLE_SYSTEM, ROLE_USER, ROLE_ASSISTANT, ROLE_TOOL) or integer (int32)Required in requestsRole of the participant that produced the chat message.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-contentSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-contentcontentArray of ContentPartOptionalContent parts composing the chat message.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-toolcallsSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-toolcallstoolCallsArray of ToolCallOptionalAssistant-to-tool invocations.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-nameSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-namenamestringOptionalSee meaning below.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-timestampSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-timestamptimestampstring (date-time)OptionalTimestamp associated with the conversation message or event.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-messageidSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-messageidmessageIdstringOptionalUnique message identifier.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-annotationsSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-annotationsannotationsArray of AnnotationOptionalStructured annotations (e.g., standardized web search URL citations, PDF reuse tokens)
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-sequenceSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-sequencesequencestring (int64)OptionalMonotonic, per-conversation sequence number for stable ordering (1-based) Pattern: ^-?\d+$.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-generatedbySection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-generatedbygeneratedBystringOptionalWorkflow run id or generator key that produced this message (e.g., workflow run key)
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-usageSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-usageusageUsageOptionalToken usage for this generation (populated for assistant messages)
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-modelSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-modelmodelstringOptionalModel that generated this message (e.g., "anthropic/claude-sonnet-4")
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-generationcontextSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-generationcontextgenerationContextGenerationContextOptionalDynamic context that shaped this generation (memories, search params, turn info)
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-clientcontextSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-clientcontextclientContextClientContextOptionalArbitrary client-supplied context attached by the client for this message
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-feedbackSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-feedbackfeedbackArray of MessageFeedbackOptionalFeedback on an assistant message, with one entry per rater identified by rated_by. A later rating by the same rater replaces their earlier entry.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-sourceusermessageidSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-sourceusermessageidsourceUserMessageIdstringOptionalSee meaning below.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#field-finishreasonSection ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-field-finishreasonfinishReasonstringOptionalWhy the model stopped, verbatim from the provider: "stop", "tool_calls", "length", "error". Empty for historical messages.

name

Name identifying the sender of the chat message.

optional sender name

sourceUserMessageId

Identifier of the user message that opened this conversation turn. Generated messages in the same turn share this value; a user message carries its own message_id. Empty on historical messages that predate turn attribution.

Use this field for turn attribution rather than inferring it from message adjacency or a client-supplied message_id. The generated_by identifier groups messages by generation run but does not identify the user message that opened the turn.

Values of role​

Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-values-role

Participant role attached to a conversation message and forwarded in model context.

ValueNo.FormMeaning
ROLE_SYSTEM0CanonicalInstructions or context provided as a system message.
ROLE_USER1CanonicalInput supplied by the user or customer application.
ROLE_ASSISTANT2CanonicalContent produced by the assistant, including its tool-call requests.
ROLE_TOOL3CanonicalA tool result supplied back to the assistant.
Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#validation

Request validation​

Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#response-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
Messagenative.group.message_contentcontent or tool_calls required
roleRequired valuetrue
roleDefined enum valuetrue

Where used​

Section ID: DOC-API-MODEL-schema-1j3dcf7kvu#where-used

ReferenceRelationship
Withdraw your rating on a messagePOST /api/v1/llm/delete-message-rating
Get full conversation statePOST /api/v1/llm/conversation-state
Rate an assistant messagePOST /api/v1/llm/rate-message
Send a message and wait for the resultPOST /api/v1/llm/send-message-sync
Submit client-side tool results and wait for the next segmentPOST /api/v1/llm/submit-client-tool-results-sync
Append a message without generatingPOST /api/v1/llm/append-message
Send a message to a conversationPOST /api/v1/llm/send-message
ReceiveMessageRequestAPI JSON uses JSON field names (camelCase).
ClientToolDispatchAPI JSON uses JSON field names (camelCase).
Models containing this value
ModelRelationship
ReceiveMessageRequestNested in model
ReceiveMessageRequestNested in model
LLMMessagePublishedEventNested in model
LLMMessagePublishedEventNested in model
ClientToolDispatchNested in model
ClientToolDispatchNested in model

Download the public reference contract.

Document ID: DOC-API-MODEL-schema-1j3dcf7kvu