> ## Documentation Index
> Fetch the complete documentation index at: https://arizeai-433a7140.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List Session Messages

> Page through an owned session's persisted transcript, oldest first.



## OpenAPI

````yaml get /v1/agent_sessions/{session_id}/messages
openapi: 3.1.0
info:
  title: Arize-Phoenix REST API
  description: Schema for Arize-Phoenix REST API
  version: '1.0'
servers: []
security: []
paths:
  /v1/agent_sessions/{session_id}/messages:
    get:
      tags:
        - chat
      summary: List Session Messages
      description: Page through an owned session's persisted transcript, oldest first.
      operationId: listAgentSessionMessages
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Opaque pagination cursor.
            title: Cursor
          description: Opaque pagination cursor.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            exclusiveMinimum: 0
            default: 100
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAgentSessionMessagesResponseBody'
        '401':
          content:
            text/plain:
              schema:
                type: string
          description: Unauthorized
        '403':
          content:
            text/plain:
              schema:
                type: string
          description: Forbidden
        '404':
          content:
            text/plain:
              schema:
                type: string
          description: Not Found
        '422':
          content:
            text/plain:
              schema:
                type: string
          description: Unprocessable Entity
components:
  schemas:
    ListAgentSessionMessagesResponseBody:
      properties:
        data:
          items:
            $ref: '#/components/schemas/PhoenixUIMessage'
          type: array
          title: Data
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - data
        - next_cursor
      title: ListAgentSessionMessagesResponseBody
    PhoenixUIMessage:
      properties:
        id:
          type: string
          title: Id
        role:
          type: string
          enum:
            - system
            - user
            - assistant
          title: Role
        metadata:
          anyOf:
            - $ref: '#/components/schemas/MessageMetadata'
            - type: 'null'
        parts:
          items:
            anyOf:
              - $ref: '#/components/schemas/TextUIPart'
              - $ref: '#/components/schemas/ReasoningUIPart'
              - $ref: '#/components/schemas/ToolInputStreamingPart'
              - $ref: '#/components/schemas/ToolInputAvailablePart'
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__ToolOutputAvailablePart
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__ToolOutputErrorPart
              - $ref: '#/components/schemas/ToolApprovalRequestedPart'
              - $ref: '#/components/schemas/ToolApprovalRespondedPart'
              - $ref: '#/components/schemas/ToolOutputDeniedPart'
              - $ref: '#/components/schemas/DynamicToolInputStreamingPart'
              - $ref: '#/components/schemas/DynamicToolInputAvailablePart'
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__DynamicToolOutputAvailablePart
              - $ref: >-
                  #/components/schemas/phoenix__db__types__data_stream_protocol__request_types__DynamicToolOutputErrorPart
              - $ref: '#/components/schemas/DynamicToolApprovalRequestedPart'
              - $ref: '#/components/schemas/DynamicToolApprovalRespondedPart'
              - $ref: '#/components/schemas/DynamicToolOutputDeniedPart'
              - $ref: '#/components/schemas/SourceUrlUIPart'
              - $ref: '#/components/schemas/SourceDocumentUIPart'
              - $ref: '#/components/schemas/FileUIPart'
              - $ref: '#/components/schemas/DataUIPart'
              - $ref: '#/components/schemas/StepStartUIPart'
          type: array
          title: Parts
      additionalProperties: false
      type: object
      required:
        - id
        - role
        - parts
      title: PhoenixUIMessage
      description: '``UIMessage`` with metadata narrowed to the Phoenix wire shapes.'
    MessageMetadata:
      properties:
        phoenix:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/PhoenixAssistantMessageMetadata'
                - $ref: '#/components/schemas/PhoenixUserMessageMetadata'
              discriminator:
                propertyName: type
                mapping:
                  assistant:
                    $ref: '#/components/schemas/PhoenixAssistantMessageMetadata'
                  user:
                    $ref: '#/components/schemas/PhoenixUserMessageMetadata'
            - type: 'null'
          title: Phoenix
        pydantic_ai:
          anyOf:
            - $ref: '#/components/schemas/PydanticAIMessageMetadata'
            - type: 'null'
      additionalProperties: false
      type: object
      title: MessageMetadata
      description: '``UIMessage.metadata`` as a registry of namespaces.'
    TextUIPart:
      properties:
        type:
          type: string
          const: text
          title: Type
          default: text
        text:
          type: string
          title: Text
        state:
          anyOf:
            - type: string
              enum:
                - streaming
                - done
            - type: 'null'
          title: State
        providerMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Providermetadata
      additionalProperties: false
      type: object
      required:
        - text
      title: TextUIPart
      description: A text part of a message.
    ReasoningUIPart:
      properties:
        type:
          type: string
          const: reasoning
          title: Type
          default: reasoning
        text:
          type: string
          title: Text
        state:
          anyOf:
            - type: string
              enum:
                - streaming
                - done
            - type: 'null'
          title: State
        providerMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Providermetadata
      additionalProperties: false
      type: object
      required:
        - text
      title: ReasoningUIPart
      description: A reasoning part of a message.
    ToolInputStreamingPart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: input-streaming
          title: State
          default: input-streaming
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolInputStreamingPart
      description: Tool part in input-streaming state.
    ToolInputAvailablePart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: input-available
          title: State
          default: input-available
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolInputAvailablePart
      description: Tool part in input-available state.
    phoenix__db__types__data_stream_protocol__request_types__ToolOutputAvailablePart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-available
          title: State
          default: output-available
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        output:
          anyOf:
            - {}
            - type: 'null'
          title: Output
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        resultProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Resultprovidermetadata
        preliminary:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Preliminary
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolOutputAvailablePart
      description: Tool part in output-available state.
    phoenix__db__types__data_stream_protocol__request_types__ToolOutputErrorPart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-error
          title: State
          default: output-error
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        rawInput:
          anyOf:
            - {}
            - type: 'null'
          title: Rawinput
        errorText:
          type: string
          title: Errortext
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        resultProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Resultprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
        - errorText
      title: ToolOutputErrorPart
      description: Tool part in output-error state.
    ToolApprovalRequestedPart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: approval-requested
          title: State
          default: approval-requested
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolApprovalRequestedPart
      description: Tool part in approval-requested state (awaiting user decision).
    ToolApprovalRespondedPart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: approval-responded
          title: State
          default: approval-responded
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolApprovalRespondedPart
      description: >-
        Tool part in approval-responded state (user approved/denied, execution
        pending).
    ToolOutputDeniedPart:
      properties:
        type:
          type: string
          pattern: ^tool-
          title: Type
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-denied
          title: State
          default: output-denied
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - type
        - toolCallId
      title: ToolOutputDeniedPart
      description: Tool part in output-denied state (tool was denied, terminal state).
    DynamicToolInputStreamingPart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: input-streaming
          title: State
          default: input-streaming
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
      title: DynamicToolInputStreamingPart
      description: Dynamic tool part in input-streaming state.
    DynamicToolInputAvailablePart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: input-available
          title: State
          default: input-available
        input:
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
      title: DynamicToolInputAvailablePart
      description: Dynamic tool part in input-available state.
    phoenix__db__types__data_stream_protocol__request_types__DynamicToolOutputAvailablePart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-available
          title: State
          default: output-available
        input:
          title: Input
        output:
          title: Output
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        resultProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Resultprovidermetadata
        preliminary:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Preliminary
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
        - output
      title: DynamicToolOutputAvailablePart
      description: Dynamic tool part in output-available state.
    phoenix__db__types__data_stream_protocol__request_types__DynamicToolOutputErrorPart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-error
          title: State
          default: output-error
        input:
          title: Input
        errorText:
          type: string
          title: Errortext
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        resultProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Resultprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
        - errorText
      title: DynamicToolOutputErrorPart
      description: Dynamic tool part in output-error state.
    DynamicToolApprovalRequestedPart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: approval-requested
          title: State
          default: approval-requested
        input:
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
      title: DynamicToolApprovalRequestedPart
      description: Dynamic tool part in approval-requested state (awaiting user decision).
    DynamicToolApprovalRespondedPart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: approval-responded
          title: State
          default: approval-responded
        input:
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
      title: DynamicToolApprovalRespondedPart
      description: >-
        Dynamic tool part in approval-responded state (user approved/denied,
        execution pending).
    DynamicToolOutputDeniedPart:
      properties:
        type:
          type: string
          const: dynamic-tool
          title: Type
          default: dynamic-tool
        toolName:
          type: string
          title: Toolname
        toolCallId:
          type: string
          title: Toolcallid
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        state:
          type: string
          const: output-denied
          title: State
          default: output-denied
        input:
          title: Input
        providerExecuted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Providerexecuted
        callProviderMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Callprovidermetadata
        approval:
          anyOf:
            - $ref: '#/components/schemas/ToolApprovalRequested'
            - $ref: '#/components/schemas/ToolApprovalResponded'
            - type: 'null'
          title: Approval
      additionalProperties: false
      type: object
      required:
        - toolName
        - toolCallId
        - input
      title: DynamicToolOutputDeniedPart
      description: >-
        Dynamic tool part in output-denied state (tool was denied, terminal
        state).
    SourceUrlUIPart:
      properties:
        type:
          type: string
          const: source-url
          title: Type
          default: source-url
        sourceId:
          type: string
          title: Sourceid
        url:
          type: string
          title: Url
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        providerMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Providermetadata
      additionalProperties: false
      type: object
      required:
        - sourceId
        - url
      title: SourceUrlUIPart
      description: A source part of a message.
    SourceDocumentUIPart:
      properties:
        type:
          type: string
          const: source-document
          title: Type
          default: source-document
        sourceId:
          type: string
          title: Sourceid
        mediaType:
          type: string
          title: Mediatype
        title:
          type: string
          title: Title
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        providerMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Providermetadata
      additionalProperties: false
      type: object
      required:
        - sourceId
        - mediaType
        - title
      title: SourceDocumentUIPart
      description: A document source part of a message.
    FileUIPart:
      properties:
        type:
          type: string
          const: file
          title: Type
          default: file
        mediaType:
          type: string
          title: Mediatype
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        url:
          type: string
          title: Url
        providerMetadata:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Providermetadata
      additionalProperties: false
      type: object
      required:
        - mediaType
        - url
      title: FileUIPart
      description: A file part of a message.
    DataUIPart:
      properties:
        type:
          type: string
          pattern: ^data-
          title: Type
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        data:
          title: Data
      additionalProperties: false
      type: object
      required:
        - type
        - data
      title: DataUIPart
      description: Data part with dynamic type based on data name.
    StepStartUIPart:
      properties:
        type:
          type: string
          const: step-start
          title: Type
          default: step-start
      additionalProperties: false
      type: object
      title: StepStartUIPart
      description: A step boundary part of a message.
    PhoenixAssistantMessageMetadata:
      properties:
        type:
          type: string
          const: assistant
          title: Type
        sessionId:
          type: string
          title: Sessionid
        turnTraceContext:
          anyOf:
            - $ref: '#/components/schemas/TurnTraceContext'
            - type: 'null'
        usage:
          anyOf:
            - $ref: '#/components/schemas/AssistantMessageMetadataUsage'
            - type: 'null'
        interrupted:
          type: boolean
          title: Interrupted
          default: false
      additionalProperties: false
      type: object
      required:
        - type
        - sessionId
      title: PhoenixAssistantMessageMetadata
      description: The ``phoenix`` metadata namespace of an assistant message.
    PhoenixUserMessageMetadata:
      properties:
        type:
          type: string
          const: user
          title: Type
        currentDateTime:
          type: string
          maxLength: 128
          title: Currentdatetime
        timeZone:
          type: string
          maxLength: 128
          title: Timezone
        isCompactionMessage:
          type: boolean
          title: Iscompactionmessage
          default: false
      additionalProperties: false
      type: object
      required:
        - type
        - currentDateTime
        - timeZone
      title: PhoenixUserMessageMetadata
      description: |-
        The ``phoenix`` metadata namespace the browser attaches to outgoing
        user messages.
    PydanticAIMessageMetadata:
      properties:
        timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Timestamp
      additionalProperties: false
      type: object
      title: PydanticAIMessageMetadata
      description: |-
        Local pin of pydantic-ai's message-level ``pydantic_ai`` metadata
        namespace (its private ``_PydanticAIMessageMetadata``), merged into the
        assistant metadata by the stream's metadata chunk.
    ToolApprovalRequested:
      properties:
        id:
          type: string
          title: Id
      additionalProperties: false
      type: object
      required:
        - id
      title: ToolApprovalRequested
      description: Tool approval in requested state (awaiting user response).
    ToolApprovalResponded:
      properties:
        id:
          type: string
          title: Id
        approved:
          type: boolean
          title: Approved
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
      additionalProperties: false
      type: object
      required:
        - id
        - approved
      title: ToolApprovalResponded
      description: Tool approval in responded state (user has approved or denied).
    TurnTraceContext:
      properties:
        traceId:
          type: string
          pattern: ^[0-9a-f]{32}$
          title: Traceid
        rootSpanId:
          type: string
          pattern: ^[0-9a-f]{16}$
          title: Rootspanid
        startedAt:
          type: string
          format: date-time
          title: Startedat
      additionalProperties: false
      type: object
      required:
        - traceId
        - rootSpanId
        - startedAt
      title: TurnTraceContext
      description: The trace identity a turn's spans are parented to.
    AssistantMessageMetadataUsage:
      properties:
        tokens:
          $ref: '#/components/schemas/AssistantMessageMetadataUsageTokens'
        promptDetails:
          anyOf:
            - $ref: >-
                #/components/schemas/AssistantMessageMetadataUsageCacheTokenDetails
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - tokens
      title: AssistantMessageMetadataUsage
    AssistantMessageMetadataUsageTokens:
      properties:
        prompt:
          type: integer
          title: Prompt
        completion:
          type: integer
          title: Completion
        total:
          type: integer
          title: Total
      additionalProperties: false
      type: object
      required:
        - prompt
        - completion
        - total
      title: AssistantMessageMetadataUsageTokens
    AssistantMessageMetadataUsageCacheTokenDetails:
      properties:
        cacheRead:
          type: integer
          title: Cacheread
        cacheWrite:
          type: integer
          title: Cachewrite
      additionalProperties: false
      type: object
      required:
        - cacheRead
        - cacheWrite
      title: AssistantMessageMetadataUsageCacheTokenDetails
      description: |-
        Prompt-cache token counts, mounted as the usage payload's
        ``prompt_details`` because cached tokens are a breakdown of the prompt.

````