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

# Poll for new content

> Follow an agent's reply as it's written, a piece at a time — ideal for scripts and agent loops.

Each call returns only the **new** blocks since your last one and long-polls (waits up to the deadline) for more. Pass `since` = the `cursor` from your previous call (`0` on the first call); `has_more` tells you whether the reply is still going. For browsers, `GET /messages/{id}/stream` (SSE) is the natural fit.


## OpenAPI

````yaml api-reference/openapi.json GET /messages/{message_id}/chunk
openapi: 3.1.0
info:
  title: Biomni Public API — V0
  description: >-
    The public API for **Biomni** — the AI agent platform for clinical genomics
    (variant annotation, ClinVar lookups, PMID-cited literature, and project
    file drives). Create projects and Tasks, send messages to the agent, stream
    its replies, manage files, and check your usage — all from your own code.


    **Authentication**: send `Authorization: Bearer <your-api-key>`. The adapter
    forwards your key straight to Biomni; it never stores it.


    **Safe retries**: send `Idempotency-Key: <token>` on POST endpoints
    (`/projects`, `/tasks`, `/messages`, `/files/uploads`) so a retried request
    won't create a duplicate.
  version: 0.1.0
servers:
  - url: https://api.phylo.bio/api/v1
security: []
paths:
  /messages/{message_id}/chunk:
    get:
      tags:
        - chunk
      summary: Poll for new content
      description: >-
        Follow an agent's reply as it's written, a piece at a time — ideal for
        scripts and agent loops.
      operationId: chunk_message_messages__message_id__chunk_get
      parameters:
        - name: message_id
          in: path
          required: true
          schema:
            type: string
            title: Message Id
        - name: since
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Block-index cursor; 0 on first call.
            default: 0
            title: Since
          description: Block-index cursor; 0 on first call.
        - name: wait_ms
          in: query
          required: false
          schema:
            type: integer
            maximum: 30000
            minimum: 0
            description: Long-poll deadline in ms. Capped at 30000.
            default: 15000
            title: Wait Ms
          description: Long-poll deadline in ms. Capped at 30000.
      responses:
        '200':
          description: New blocks (possibly empty if the deadline hit).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageChunk'
              example:
                message_id: msg_2f1c9a
                blocks:
                  - type: text
                    text: Looking up rs80357065 in ClinVar…
                cursor: 12
                status: running
                has_more: true
                total_blocks: 12
                returned_from: 8
      security:
        - bearerAuth: []
components:
  schemas:
    MessageChunk:
      properties:
        message_id:
          type: string
          title: Message Id
        blocks:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Blocks
        cursor:
          type: integer
          title: Cursor
        status:
          type: string
          title: Status
        has_more:
          type: boolean
          title: Has More
        total_blocks:
          type: integer
          title: Total Blocks
        returned_from:
          type: integer
          title: Returned From
      type: object
      required:
        - message_id
        - cursor
        - status
        - has_more
        - total_blocks
        - returned_from
      title: MessageChunk
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Requires an API key. See the Authentication guide.

````