Skip to content

Messages

Create Message
client.messages.create(MessageCreateParams { content, task_id, created_at, streaming_status } body, RequestOptionsoptions?): TaskMessage { content, task_id, id, 3 more }
POST/messages
List Messages
client.messages.list(MessageListParams { task_id, filters, limit, 3 more } query, RequestOptionsoptions?): MessageListResponse { content, task_id, id, 3 more }
GET/messages
Update Message
client.messages.update(stringmessageID, MessageUpdateParams { content, task_id, streaming_status } body, RequestOptionsoptions?): TaskMessage { content, task_id, id, 3 more }
PUT/messages/{message_id}
Get Message
client.messages.retrieve(stringmessageID, RequestOptionsoptions?): TaskMessage { content, task_id, id, 3 more }
GET/messages/{message_id}
List Messages Paginated
client.messages.listPaginated(MessageListPaginatedParams { task_id, cursor, direction, 2 more } query, RequestOptionsoptions?): MessageListPaginatedResponse { data, has_more, next_cursor }
GET/messages/paginated
ModelsExpand Collapse
DataContent { author, data, style, type }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Record<string, unknown>

The contents of the data message.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "data"

The type of the message, in this case data.

MessageAuthor = "user" | "agent"
One of the following:
"user"
"agent"
MessageStyle = "static" | "active"
One of the following:
"static"
"active"
ReasoningContent { author, summary, content, 2 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: Array<string>

A list of short reasoning summaries

content?: Array<string> | null

The reasoning content or chain-of-thought text

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "reasoning"

The type of the message, in this case reasoning.

TaskMessage { content, task_id, id, 3 more }

Represents a message in the agent system.

This entity is used to store messages in MongoDB, with each message associated with a specific task.

The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.

One of the following:
TextContent { author, content, attachments, 3 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: string

The contents of the text message.

attachments?: Array<Attachment> | null

Optional list of file attachments with structured metadata.

file_id: string

The unique ID of the attached file

name: string

The name of the file

size: number

The size of the file in bytes

type: string

The MIME type or content type of the file

format?: TextFormat

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "text"

The type of the message, in this case text.

ReasoningContent { author, summary, content, 2 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: Array<string>

A list of short reasoning summaries

content?: Array<string> | null

The reasoning content or chain-of-thought text

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "reasoning"

The type of the message, in this case reasoning.

DataContent { author, data, style, type }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Record<string, unknown>

The contents of the data message.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "data"

The type of the message, in this case data.

ToolRequestContent { arguments, author, name, 3 more }
arguments: Record<string, unknown>

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: string

The name of the tool that is being requested.

tool_call_id: string

The ID of the tool call that is being requested.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_request"

The type of the message, in this case tool_request.

ToolResponseContent { author, content, name, 4 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: unknown

The result of the tool.

name: string

The name of the tool that is being responded to.

tool_call_id: string

The ID of the tool call that is being responded to.

is_error?: boolean | null

Whether the tool call resulted in an error. None when the harness does not report a status.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_response"

The type of the message, in this case tool_response.

task_id: string

ID of the task this message belongs to

id?: string | null

The task message’s unique id

created_at?: string | null

The timestamp when the message was created

formatdate-time
streaming_status?: "IN_PROGRESS" | "DONE" | null
One of the following:
"IN_PROGRESS"
"DONE"
updated_at?: string | null

The timestamp when the message was last updated

formatdate-time
TextContent { author, content, attachments, 3 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: string

The contents of the text message.

attachments?: Array<Attachment> | null

Optional list of file attachments with structured metadata.

file_id: string

The unique ID of the attached file

name: string

The name of the file

size: number

The size of the file in bytes

type: string

The MIME type or content type of the file

format?: TextFormat

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "text"

The type of the message, in this case text.

TextFormat = "markdown" | "plain" | "code"
One of the following:
"markdown"
"plain"
"code"
ToolRequestContent { arguments, author, name, 3 more }
arguments: Record<string, unknown>

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: string

The name of the tool that is being requested.

tool_call_id: string

The ID of the tool call that is being requested.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_request"

The type of the message, in this case tool_request.

ToolResponseContent { author, content, name, 4 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: unknown

The result of the tool.

name: string

The name of the tool that is being responded to.

tool_call_id: string

The ID of the tool call that is being responded to.

is_error?: boolean | null

Whether the tool call resulted in an error. None when the harness does not report a status.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_response"

The type of the message, in this case tool_response.

MessageListResponse = Array<TaskMessage { content, task_id, id, 3 more } >

The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.

One of the following:
TextContent { author, content, attachments, 3 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: string

The contents of the text message.

attachments?: Array<Attachment> | null

Optional list of file attachments with structured metadata.

file_id: string

The unique ID of the attached file

name: string

The name of the file

size: number

The size of the file in bytes

type: string

The MIME type or content type of the file

format?: TextFormat

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "text"

The type of the message, in this case text.

ReasoningContent { author, summary, content, 2 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: Array<string>

A list of short reasoning summaries

content?: Array<string> | null

The reasoning content or chain-of-thought text

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "reasoning"

The type of the message, in this case reasoning.

DataContent { author, data, style, type }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Record<string, unknown>

The contents of the data message.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "data"

The type of the message, in this case data.

ToolRequestContent { arguments, author, name, 3 more }
arguments: Record<string, unknown>

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: string

The name of the tool that is being requested.

tool_call_id: string

The ID of the tool call that is being requested.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_request"

The type of the message, in this case tool_request.

ToolResponseContent { author, content, name, 4 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: unknown

The result of the tool.

name: string

The name of the tool that is being responded to.

tool_call_id: string

The ID of the tool call that is being responded to.

is_error?: boolean | null

Whether the tool call resulted in an error. None when the harness does not report a status.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_response"

The type of the message, in this case tool_response.

task_id: string

ID of the task this message belongs to

id?: string | null

The task message’s unique id

created_at?: string | null

The timestamp when the message was created

formatdate-time
streaming_status?: "IN_PROGRESS" | "DONE" | null
One of the following:
"IN_PROGRESS"
"DONE"
updated_at?: string | null

The timestamp when the message was last updated

formatdate-time
MessageListPaginatedResponse { data, has_more, next_cursor }

Response with cursor pagination metadata.

data: Array<TaskMessage { content, task_id, id, 3 more } >

List of messages

The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.

One of the following:
TextContent { author, content, attachments, 3 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: string

The contents of the text message.

attachments?: Array<Attachment> | null

Optional list of file attachments with structured metadata.

file_id: string

The unique ID of the attached file

name: string

The name of the file

size: number

The size of the file in bytes

type: string

The MIME type or content type of the file

format?: TextFormat

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "text"

The type of the message, in this case text.

ReasoningContent { author, summary, content, 2 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: Array<string>

A list of short reasoning summaries

content?: Array<string> | null

The reasoning content or chain-of-thought text

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "reasoning"

The type of the message, in this case reasoning.

DataContent { author, data, style, type }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Record<string, unknown>

The contents of the data message.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "data"

The type of the message, in this case data.

ToolRequestContent { arguments, author, name, 3 more }
arguments: Record<string, unknown>

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: string

The name of the tool that is being requested.

tool_call_id: string

The ID of the tool call that is being requested.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_request"

The type of the message, in this case tool_request.

ToolResponseContent { author, content, name, 4 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: unknown

The result of the tool.

name: string

The name of the tool that is being responded to.

tool_call_id: string

The ID of the tool call that is being responded to.

is_error?: boolean | null

Whether the tool call resulted in an error. None when the harness does not report a status.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_response"

The type of the message, in this case tool_response.

task_id: string

ID of the task this message belongs to

id?: string | null

The task message’s unique id

created_at?: string | null

The timestamp when the message was created

formatdate-time
streaming_status?: "IN_PROGRESS" | "DONE" | null
One of the following:
"IN_PROGRESS"
"DONE"
updated_at?: string | null

The timestamp when the message was last updated

formatdate-time
has_more?: boolean

Whether there are more messages to fetch

next_cursor?: string | null

Cursor for fetching the next page of older messages

MessagesBatch

Batch Update Messages
client.messages.batch.update(BatchUpdateParams { task_id, updates } body, RequestOptionsoptions?): BatchUpdateResponse { content, task_id, id, 3 more }
PUT/messages/batch
Batch Create Messages
client.messages.batch.create(BatchCreateParams { contents, task_id, created_at } body, RequestOptionsoptions?): BatchCreateResponse { content, task_id, id, 3 more }
POST/messages/batch
ModelsExpand Collapse
BatchUpdateResponse = Array<TaskMessage { content, task_id, id, 3 more } >

The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.

One of the following:
TextContent { author, content, attachments, 3 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: string

The contents of the text message.

attachments?: Array<Attachment> | null

Optional list of file attachments with structured metadata.

file_id: string

The unique ID of the attached file

name: string

The name of the file

size: number

The size of the file in bytes

type: string

The MIME type or content type of the file

format?: TextFormat

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "text"

The type of the message, in this case text.

ReasoningContent { author, summary, content, 2 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: Array<string>

A list of short reasoning summaries

content?: Array<string> | null

The reasoning content or chain-of-thought text

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "reasoning"

The type of the message, in this case reasoning.

DataContent { author, data, style, type }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Record<string, unknown>

The contents of the data message.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "data"

The type of the message, in this case data.

ToolRequestContent { arguments, author, name, 3 more }
arguments: Record<string, unknown>

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: string

The name of the tool that is being requested.

tool_call_id: string

The ID of the tool call that is being requested.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_request"

The type of the message, in this case tool_request.

ToolResponseContent { author, content, name, 4 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: unknown

The result of the tool.

name: string

The name of the tool that is being responded to.

tool_call_id: string

The ID of the tool call that is being responded to.

is_error?: boolean | null

Whether the tool call resulted in an error. None when the harness does not report a status.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_response"

The type of the message, in this case tool_response.

task_id: string

ID of the task this message belongs to

id?: string | null

The task message’s unique id

created_at?: string | null

The timestamp when the message was created

formatdate-time
streaming_status?: "IN_PROGRESS" | "DONE" | null
One of the following:
"IN_PROGRESS"
"DONE"
updated_at?: string | null

The timestamp when the message was last updated

formatdate-time
BatchCreateResponse = Array<TaskMessage { content, task_id, id, 3 more } >

The content of the message. This content is not OpenAI compatible. These are messages that are meant to be displayed to the user.

One of the following:
TextContent { author, content, attachments, 3 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: string

The contents of the text message.

attachments?: Array<Attachment> | null

Optional list of file attachments with structured metadata.

file_id: string

The unique ID of the attached file

name: string

The name of the file

size: number

The size of the file in bytes

type: string

The MIME type or content type of the file

format?: TextFormat

The format of the message. This is used by the client to determine how to display the message.

One of the following:
"markdown"
"plain"
"code"
style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "text"

The type of the message, in this case text.

ReasoningContent { author, summary, content, 2 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
summary: Array<string>

A list of short reasoning summaries

content?: Array<string> | null

The reasoning content or chain-of-thought text

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "reasoning"

The type of the message, in this case reasoning.

DataContent { author, data, style, type }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
data: Record<string, unknown>

The contents of the data message.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "data"

The type of the message, in this case data.

ToolRequestContent { arguments, author, name, 3 more }
arguments: Record<string, unknown>

The arguments to the tool.

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
name: string

The name of the tool that is being requested.

tool_call_id: string

The ID of the tool call that is being requested.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_request"

The type of the message, in this case tool_request.

ToolResponseContent { author, content, name, 4 more }

The role of the messages author, in this case system, user, assistant, or tool.

One of the following:
"user"
"agent"
content: unknown

The result of the tool.

name: string

The name of the tool that is being responded to.

tool_call_id: string

The ID of the tool call that is being responded to.

is_error?: boolean | null

Whether the tool call resulted in an error. None when the harness does not report a status.

style?: MessageStyle

The style of the message. This is used by the client to determine how to display the message.

One of the following:
"static"
"active"
type?: "tool_response"

The type of the message, in this case tool_response.

task_id: string

ID of the task this message belongs to

id?: string | null

The task message’s unique id

created_at?: string | null

The timestamp when the message was created

formatdate-time
streaming_status?: "IN_PROGRESS" | "DONE" | null
One of the following:
"IN_PROGRESS"
"DONE"
updated_at?: string | null

The timestamp when the message was last updated

formatdate-time