> ## Documentation Index
> Fetch the complete documentation index at: https://allhandsai-chore-regenerate-agent-sdk-openapi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Conversation Agent Final Response

> Get the agent's final response for a conversation.

Returns the text of the last agent finish message (FinishAction) or
the last agent text response (MessageEvent). Returns an empty string
if the agent has not produced a final response yet.



## OpenAPI

````yaml /openapi/agent-sdk.json get /api/conversations/{conversation_id}/agent_final_response
openapi: 3.1.0
info:
  description: OpenHands Agent Server - REST/WebSocket interface for OpenHands AI Agent
  title: OpenHands Agent Server
  version: 1.52.0
servers: []
security: []
paths:
  /api/conversations/{conversation_id}/agent_final_response:
    get:
      tags:
        - Conversations
      summary: Get Conversation Agent Final Response
      description: |-
        Get the agent's final response for a conversation.

        Returns the text of the last agent finish message (FinishAction) or
        the last agent text response (MessageEvent). Returns an empty string
        if the agent has not produced a final response yet.
      operationId: >-
        get_conversation_agent_final_response_api_conversations__conversation_id__agent_final_response_get
      parameters:
        - in: path
          name: conversation_id
          required: true
          schema:
            format: uuid
            title: Conversation Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentResponseResult'
          description: Successful Response
        '404':
          description: Conversation not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
components:
  schemas:
    AgentResponseResult:
      description: |-
        The agent's final response for a conversation.

        Contains the text of the last agent finish message or text response.
        Empty string if the agent has not produced a final response yet.
      properties:
        response:
          description: >-
            The agent's final response text. Extracted from either a
            FinishAction message or the last agent MessageEvent. Empty string if
            no final response is available.
          title: Response
          type: string
      required:
        - response
      title: AgentResponseResult
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-Session-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.