Letta Messages API

Send messages, list message history, search, and batch operations.

Documentation

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-agent-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-block-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-tool-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-source-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-run-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-group-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-identity-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-message-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-passage-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-archive-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-job-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-llm-config-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-embedding-config-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/json-schema/letta-provider-schema.json

Other Resources

OpenAPI Specification

letta-messages-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Letta Admin Messages API
  version: 1.0.0
  description: REST API for Letta, the stateful agents platform. Manage agents, memory blocks, archival passages, sources, custom tools, MCP servers, multi-agent groups, runs, and streaming responses. Available as Letta Cloud (managed) at https://api.letta.com/v1 and as the self-hosted open-source server (Apache-2.0) typically run at http://localhost:8283.
  contact:
    name: Letta
    url: https://www.letta.com/
    email: support@letta.com
  license:
    name: Apache-2.0
    url: https://github.com/letta-ai/letta/blob/main/LICENSE
  x-logo:
    url: https://www.letta.com/favicon.ico
servers:
- url: https://api.letta.com
  description: Letta Cloud (managed)
- url: https://app.letta.com
  description: Letta Cloud (app)
- url: http://localhost:8283
  description: Self-hosted Letta server
security:
- bearerAuth: []
tags:
- name: Messages
  description: Send messages, list message history, search, and batch operations.
paths:
  /v1/messages/:
    get:
      tags:
      - Messages
      summary: List All Messages
      description: List messages across all agents for the current user.
      operationId: list_all_messages
      parameters:
      - name: before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order
          title: Before
        description: Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order
      - name: after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order
          title: After
        description: Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order
      - name: limit
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          description: Maximum number of messages to return
          default: 100
          title: Limit
        description: Maximum number of messages to return
      - name: order
        in: query
        required: false
        schema:
          enum:
          - asc
          - desc
          type: string
          description: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
          default: desc
          title: Order
        description: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
      - name: conversation_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Conversation ID to filter messages by
          title: Conversation Id
        description: Conversation ID to filter messages by
      - name: include_return_message_types
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              $ref: '#/components/schemas/MessageType'
          - type: 'null'
          description: Message types to include in response. When null, all message types are returned.
          title: Include Return Message Types
        description: Message types to include in response. When null, all message types are returned.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LettaMessageUnion'
                title: Response List All Messages
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/messages/search:
    post:
      tags:
      - Messages
      summary: Search All Messages
      description: 'Search messages across the organization with optional agent filtering.

        Returns messages with FTS/vector ranks and total RRF score.



        This is a cloud-only feature.'
      operationId: search_all_messages
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchAllMessagesRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                  - $ref: '#/components/schemas/SystemMessageListResult'
                  - $ref: '#/components/schemas/UserMessageListResult'
                  - $ref: '#/components/schemas/ReasoningMessageListResult'
                  - $ref: '#/components/schemas/AssistantMessageListResult'
                  discriminator:
                    propertyName: message_type
                    mapping:
                      system_message: '#/components/schemas/SystemMessageListResult'
                      user_message: '#/components/schemas/UserMessageListResult'
                      reasoning_message: '#/components/schemas/ReasoningMessageListResult'
                      assistant_message: '#/components/schemas/AssistantMessageListResult'
                title: Response Search All Messages
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/messages/batches:
    post:
      tags:
      - Messages
      summary: Create Batch
      description: 'Submit a batch of agent runs for asynchronous processing.


        Creates a job that will fan out messages to all listed agents and process them in parallel.

        The request will be rejected if it exceeds 256MB.'
      operationId: create_batch
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBatch'
              description: Messages and config for all agents
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchJob'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Messages
      summary: List Batches
      description: List all batch runs.
      operationId: list_batches
      parameters:
      - name: before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order
          title: Before
        description: Job ID cursor for pagination. Returns jobs that come before this job ID in the specified sort order
      - name: after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order
          title: After
        description: Job ID cursor for pagination. Returns jobs that come after this job ID in the specified sort order
      - name: limit
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          description: Maximum number of jobs to return
          default: 100
          title: Limit
        description: Maximum number of jobs to return
      - name: order
        in: query
        required: false
        schema:
          enum:
          - asc
          - desc
          type: string
          description: Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
          default: desc
          title: Order
        description: Sort order for jobs by creation time. 'asc' for oldest first, 'desc' for newest first
      - name: order_by
        in: query
        required: false
        schema:
          const: created_at
          type: string
          description: Field to sort by
          default: created_at
          title: Order By
        description: Field to sort by
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BatchJob'
                title: Response List Batches
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/messages/batches/{batch_id}:
    get:
      tags:
      - Messages
      summary: Retrieve Batch
      description: Retrieve the status and details of a batch run.
      operationId: retrieve_batch
      parameters:
      - name: batch_id
        in: path
        required: true
        schema:
          type: string
          title: Batch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchJob'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/messages/batches/{batch_id}/messages:
    get:
      tags:
      - Messages
      summary: List Messages for Batch
      description: Get response messages for a specific batch job.
      operationId: list_messages_for_batch
      parameters:
      - name: batch_id
        in: path
        required: true
        schema:
          type: string
          title: Batch Id
      - name: before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order
          title: Before
        description: Message ID cursor for pagination. Returns messages that come before this message ID in the specified sort order
      - name: after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order
          title: After
        description: Message ID cursor for pagination. Returns messages that come after this message ID in the specified sort order
      - name: limit
        in: query
        required: false
        schema:
          anyOf:
          - type: integer
          - type: 'null'
          description: Maximum number of messages to return
          default: 100
          title: Limit
        description: Maximum number of messages to return
      - name: order
        in: query
        required: false
        schema:
          enum:
          - asc
          - desc
          type: string
          description: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
          default: desc
          title: Order
        description: Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first
      - name: order_by
        in: query
        required: false
        schema:
          const: created_at
          type: string
          description: Field to sort by
          default: created_at
          title: Order By
        description: Field to sort by
      - name: agent_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Filter messages by agent ID
          title: Agent Id
        description: Filter messages by agent ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LettaBatchMessages'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/messages/batches/{batch_id}/cancel:
    patch:
      tags:
      - Messages
      summary: Cancel Batch
      description: Cancel a batch run.
      operationId: cancel_batch
      parameters:
      - name: batch_id
        in: path
        required: true
        schema:
          type: string
          title: Batch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/messages/{message_id}:
    get:
      tags:
      - Messages
      summary: Retrieve Message
      description: Retrieve a message by ID.
      operationId: retrieve_message
      parameters:
      - name: message_id
        in: path
        required: true
        schema:
          type: string
          minLength: 44
          maxLength: 44
          pattern: ^message-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: The ID of the message in the format 'message-<uuid4>'
          examples:
          - message-123e4567-e89b-42d3-8456-426614174000
          title: Message Id
        description: The ID of the message in the format 'message-<uuid4>'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LettaMessageUnion'
                title: Response Retrieve Message
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ApprovalReturn:
      properties:
        type:
          type: string
          const: approval
          title: Type
          description: The message type to be created.
          default: approval
        tool_call_id:
          type: string
          title: Tool Call Id
          description: The ID of the tool call that corresponds to this approval
        approve:
          type: boolean
          title: Approve
          description: Whether the tool has been approved
        reason:
          anyOf:
          - type: string
          - type: 'null'
          title: Reason
          description: An optional explanation for the provided approval status
      type: object
      required:
      - tool_call_id
      - approve
      title: ApprovalReturn
    CreateBatch:
      properties:
        requests:
          items:
            $ref: '#/components/schemas/LettaBatchRequest'
          type: array
          title: Requests
          description: List of requests to be processed in batch.
        callback_url:
          anyOf:
          - type: string
            maxLength: 2083
            minLength: 1
            format: uri
          - type: 'null'
          title: Callback Url
          description: 'Optional URL to call via POST when the batch completes. The callback payload will be a JSON object with the following fields: {''job_id'': string, ''status'': string, ''completed_at'': string}. Where ''job_id'' is the unique batch job identifier, ''status'' is the final batch status (e.g., ''completed'', ''failed''), and ''completed_at'' is an ISO 8601 timestamp indicating when the batch job completed.'
      type: object
      required:
      - requests
      title: CreateBatch
    SystemMessage:
      properties:
        id:
          type: string
          title: Id
        date:
          type: string
          format: date-time
          title: Date
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        message_type:
          type: string
          const: system_message
          title: Message Type
          description: The type of the message.
          default: system_message
        otid:
          anyOf:
          - type: string
          - type: 'null'
          title: Otid
          description: The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
        sender_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Sender Id
        step_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Step Id
        is_err:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Err
        seq_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Seq Id
        run_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Run Id
        content:
          type: string
          title: Content
          description: The message content sent by the system
      type: object
      required:
      - id
      - date
      - content
      title: SystemMessage
      description: "A message generated by the system. Never streamed back on a response, only used for cursor pagination.\n\nArgs:\n    id (str): The ID of the message\n    date (datetime): The date the message was created in ISO format\n    name (Optional[str]): The name of the sender of the message\n    content (str): The message content sent by the system"
    CompactionStats:
      properties:
        trigger:
          type: string
          title: Trigger
          description: What triggered the compaction (e.g., 'context_window_exceeded', 'post_step_context_check')
        context_tokens_before:
          anyOf:
          - type: integer
          - type: 'null'
          title: Context Tokens Before
          description: Token count before compaction (from LLM usage stats, includes full context sent to LLM)
        context_tokens_after:
          anyOf:
          - type: integer
          - type: 'null'
          title: Context Tokens After
          description: Token count after compaction (message tokens only, does not include tool definitions)
        context_window:
          type: integer
          title: Context Window
          description: The model's context window size
        messages_count_before:
          type: integer
          title: Messages Count Before
          description: Number of messages before compaction
        messages_count_after:
          type: integer
          title: Messages Count After
          description: Number of messages after compaction
      type: object
      required:
      - trigger
      - context_window
      - messages_count_before
      - messages_count_after
      title: CompactionStats
      description: Statistics about a memory compaction operation.
    MessageRole:
      type: string
      enum:
      - assistant
      - user
      - tool
      - function
      - system
      - approval
      - summary
      title: MessageRole
    ToolReturnContent:
      properties:
        type:
          type: string
          const: tool_return
          title: Type
          description: Indicates this content represents a tool return event.
          default: tool_return
        tool_call_id:
          type: string
          title: Tool Call Id
          description: References the ID of the ToolCallContent that initiated this tool call.
        content:
          type: string
          title: Content
          description: The content returned by the tool execution.
        is_error:
          type: boolean
          title: Is Error
          description: Indicates whether the tool execution resulted in an error.
      type: object
      required:
      - tool_call_id
      - content
      - is_error
      title: ToolReturnContent
    ImageContent:
      properties:
        type:
          type: string
          const: image
          title: Type
          description: The type of the message.
          default: image
        source:
          oneOf:
          - $ref: '#/components/schemas/UrlImage'
          - $ref: '#/components/schemas/Base64Image'
          - $ref: '#/components/schemas/LettaImage'
          title: Source
          description: The source of the image.
          discriminator:
            propertyName: type
            mapping:
              base64: '#/components/schemas/Base64Image'
              letta: '#/components/schemas/LettaImage'
              url: '#/components/schemas/UrlImage'
      type: object
      required:
      - source
      title: ImageContent
    LettaBatchRequest:
      properties:
        messages:
          anyOf:
          - items:
              anyOf:
              - $ref: '#/components/schemas/MessageCreate'
              - $ref: '#/components/schemas/ApprovalCreate'
              - $ref: '#/components/schemas/ToolReturnCreate'
            type: array
          - type: 'null'
          title: Messages
          description: The messages to be sent to the agent.
        input:
          anyOf:
          - type: string
          - items:
              oneOf:
              - $ref: '#/components/schemas/TextContent'
              - $ref: '#/components/schemas/ImageContent'
              - $ref: '#/components/schemas/ToolCallContent'
              - $ref: '#/components/schemas/ToolReturnContent'
              - $ref: '#/components/schemas/ReasoningContent'
              - $ref: '#/components/schemas/RedactedReasoningContent'
              - $ref: '#/components/schemas/OmittedReasoningContent'
              - $ref: '#/components/schemas/SummarizedReasoningContent'
              discriminator:
                propertyName: type
                mapping:
                  image: '#/components/schemas/ImageContent'
                  omitted_reasoning: '#/components/schemas/OmittedReasoningContent'
                  reasoning: '#/components/schemas/ReasoningContent'
                  redacted_reasoning: '#/components/schemas/RedactedReasoningContent'
                  summarized_reasoning: '#/components/schemas/SummarizedReasoningContent'
                  text: '#/components/schemas/TextContent'
                  tool_call: '#/components/schemas/ToolCallContent'
                  tool_return: '#/components/schemas/ToolReturnContent'
            type: array
          - type: 'null'
          title: Input
          description: 'Syntactic sugar for a single user message. Equivalent to messages=[{''role'': ''user'', ''content'': input}].'
        max_steps:
          type: integer
          title: Max Steps
          description: Maximum number of steps the agent should take to process the request.
          default: 50
        use_assistant_message:
          type: boolean
          title: Use Assistant Message
          description: Whether the server should parse specific tool call arguments (default `send_message`) as `AssistantMessage` objects. Still supported for legacy agent types, but deprecated for letta_v1_agent onward.
          default: true
          deprecated: true
        assistant_message_tool_name:
          type: string
          title: Assistant Message Tool Name
          description: The name of the designated message tool. Still supported for legacy agent types, but deprecated for letta_v1_agent onward.
          default: send_message
          deprecated: true
        assistant_message_tool_kwarg:
          type: string
          title: Assistant Message Tool Kwarg
          description: The name of the message argument in the designated message tool. Still supported for legacy agent types, but deprecated for letta_v1_agent onward.
          default: message
          deprecated: true
        include_return_message_types:
          anyOf:
          - items:
              $ref: '#/components/schemas/MessageType'
            type: array
          - type: 'null'
          title: Include Return Message Types
          description: Only return specified message types in the response. If `None` (default) returns all messages.
        enable_thinking:
          type: string
          title: Enable Thinking
          description: If set to True, enables reasoning before responses or tool calls from the agent.
          default: true
          deprecated: true
        client_tools:
          anyOf:
          - items:
              $ref: '#/components/schemas/ClientToolSchema'
            type: array
          - type: 'null'
          title: Client Tools
          description: Client-side tools that the agent can call. When the agent calls a client-side tool, execution pauses and returns control to the client to execute the tool and provide the result via a ToolReturn.
        client_skills:
          anyOf:
          - items:
              $ref: '#/components/schemas/ClientSkillSchema'
            type: array
          - type: 'null'
          title: Client Skills
          description: Client-side skills available in the environment. These are rendered in the system prompt's available skills section alongside agent-scoped skills from MemFS.
        override_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Override Model
          description: Model handle to use for this request instead of the agent's default model. This allows sending a message to a different model without changing the agent's configuration.
        include_compaction_messages:
          type: boolean
          title: Include Compaction Messages
          description: If True, compaction events emit structured `SummaryMessage` and `EventMessage` types. If False (default), compaction messages are not included in the response.
          default: false
        return_logprobs:
          type: boolean
          title: Return Logprobs
          description: If True, returns log probabilities of the output tokens in the response. Useful for RL training. Only supported for OpenAI-compatible providers (including SGLang).
          default: false
        top_logprobs:
          anyOf:
          - type: integer
          - type: 'null'
          title: Top Logprobs
          description: Number of most likely tokens to return at each position (0-20). Requires return_logprobs=True.
        return_token_ids:
          type: boolean
          title: Return Token Ids
          description: If True, returns token IDs and logprobs for ALL LLM generations in the agent step, not just the last one. Uses SGLang native /generate endpoint. Returns 'turns' field with TurnTokenData for each assistant/tool turn. Required for proper multi-turn RL training with loss masking.
          default: false
        override_system:
          anyOf:
          - type: string
          - type: 'null'
          title: Override System
          description: Optional per-request system prompt override. When set, this is passed directly to the underlying LLM request and bypasses the persisted/compiled system message for that request.
        agent_id:
          type: string
          maxLength: 42
          minLength: 42
          pattern: ^agent-[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          title: Agent Id
          description: The ID of the agent to send this batch request for
          examples:
          - agent-123e4567-e89b-42d3-8456-426614174000
      type: object
      required:
      - agent_id
      title: LettaBatchRequest
    LettaBatchMessages:
      properties:
        messages:
          items:
            $ref: '#/components/schemas/Message'
          type: array
          title: Messages
      type: object
      required:
      - messages
      title: LettaBatchMessages
    AssistantMessage:
      properties:
        id:
          type: string
          title: Id
        date:
          type: string
          format: date-time
          title: Date
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        message_type:
          type: string
          const: assistant_message
          title: Message Type
          description: The type of the message.
          default: assistant_message
        otid:
          anyOf:
          - type: string
          - type: 'null'
          title: Otid
          description: The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
        sender_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Sender Id
        step_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Step Id
        is_err:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Is Err
        seq_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Seq Id
        run_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Run Id
        content:
          anyOf:
          - items:
              $ref: '#/components/schemas/LettaAssistantMessageContentUnion'
            type: array
          - type: string
          title: Content
          description: The message content sent by the agent (can be a string or an array of content parts)
      type: object
      required:
      - id
      - date
      - content
      title: AssistantMessage
      description: "A message sent by the LLM in response to user input. Used in the LLM context.\n\nArgs:\n    id (str): The ID of the message\n    date (datetime): The date the message was created in ISO format\n    name (Optional[str]): The name of the sender of the message\n    content (Union[str, List[LettaAssistantMessageContentUnion]]): The message content sent by the agent (can be a string or an array of content parts)"
    BatchJob:
      properties:
        created_by_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Created By Id
          description: The id of the user that made this object.
        last_updated_by_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Updated By Id
          description: The id of the user that made this object.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The unix timestamp of when the job was created.
        updated_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updated At
          description: The timestamp when the object was last updated.
        status:
          $ref: '#/components/schemas/JobStatus'
          description: The status of the job.
          default: created
        completed_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Completed At
          description: The unix timestamp of when the job was completed.
        stop_reason:
          anyOf:
          - $ref: '#/components/schemas/StopReasonType'
          - type: 'null'
          description: The reason why the job was stopped.
        metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Metadata
          description: The metadata of the job.
        job_type:
          $ref: '#/components/schemas/JobType'
          default: batch
        background:
          anyOf:
          - type: boolean
          - type: 'null'

# --- truncated at 32 KB (92 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/letta/refs/heads/main/openapi/letta-messages-api-openapi.yml