> ## Documentation Index
> Fetch the complete documentation index at: https://docs.verahealth.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Reconnect to an agentic stream

> Picks up an answer started by a streamed `POST /api/chat/v3` after the connection dropped. Vera keeps generating when the connection drops, so the answer is still there to collect.

While the answer is being generated, the stream is replayed from its first frame and then continues live, in the same frame format as `POST /api/chat/v3`. Discard what you had built and parse it from the start.

Once the answer has finished, the response is `204` with no body.

### Authorization

Any API key of the partner that started the thread can reconnect, including a rotated one. Keys of any other partner get **404**.



## OpenAPI

````yaml /docs/api-reference/openapi.json get /api/chat/v3/threads/{threadId}/stream
openapi: 3.1.0
info:
  title: Vera Health API
  version: 1.0.0
  description: >-
    Send medical questions and receive evidence-based answers with citations as
    a Server-Sent Events stream.
  contact:
    name: Vera Health
    url: https://www.verahealth.ai
servers:
  - url: https://www.verahealth.ai
    description: Production server
security:
  - apiKeyAuth: []
tags:
  - name: v2
    description: >-
      Send a medical question and receive an evidence-based answer as a
      Server-Sent Events stream.
  - name: v3
    description: >-
      Preview agentic endpoint. Runs Vera's tool-using agent and lets each
      request choose which optional tool groups are available. Testing only.
  - name: v1
    description: Legacy v1 chat endpoint. New integrations should use v2.
paths:
  /api/chat/v3/threads/{threadId}/stream:
    get:
      tags:
        - v3
      summary: Reconnect to an agentic stream
      description: >-
        Picks up an answer started by a streamed `POST /api/chat/v3` after the
        connection dropped. Vera keeps generating when the connection drops, so
        the answer is still there to collect.


        While the answer is being generated, the stream is replayed from its
        first frame and then continues live, in the same frame format as `POST
        /api/chat/v3`. Discard what you had built and parse it from the start.


        Once the answer has finished, the response is `204` with no body.


        ### Authorization


        Any API key of the partner that started the thread can reconnect,
        including a rotated one. Keys of any other partner get **404**.
      operationId: reconnect-to-an-agentic-stream
      parameters:
        - name: threadId
          in: path
          required: true
          description: >-
            The `x-thread-id` header of the original `POST /api/chat/v3`
            response.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: >-
            The answer is still being generated: the stream is replayed from its
            first frame, then continues live.
          content:
            text/event-stream:
              schema:
                type: string
        '204':
          description: The answer already finished. Nothing is replayed.
        '401':
          description: Missing or invalid API key.
          content:
            text/plain:
              schema:
                type: string
              example: Unauthorized
        '403':
          description: This key is not enabled for the agentic endpoint.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - message
                  - code
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  code:
                    type: string
        '404':
          description: No such thread, or it belongs to another partner.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - message
                  - code
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  code:
                    type: string
        '500':
          description: >-
            Branch on `code`. `RESUME_UNAVAILABLE`: the answer could not be
            reached just now and may still be running; retry this request
            shortly instead of asking again. `ANSWER_NOT_SAVED` or
            `THREAD_NOT_FOUND_ON_RESUME`: the answer was lost; ask the question
            again.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                  - message
                  - code
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  code:
                    type: string
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -N
            https://www.verahealth.ai/api/chat/v3/threads/7d1f0c52-3a9e-4b8e-9f6a-2c4d5e6f7a81/stream
            \
              -H "x-api-key: YOUR_API_KEY"
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Contact support@verahealth.ai to obtain your
        API key.

````

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