> ## 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.

# Cancel a reply

> Stop the agent while it's still writing this reply.

Applies to the whole Task the message belongs to (the agent works one reply at a time); equivalent to `POST /tasks/{task_id}/cancel`.


## OpenAPI

````yaml api-reference/openapi.json POST /messages/{message_id}/cancel
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}/cancel:
    post:
      tags:
        - messages
      summary: Cancel a reply
      description: Stop the agent while it's still writing this reply.
      operationId: cancel_message_messages__message_id__cancel_post
      parameters:
        - name: message_id
          in: path
          required: true
          schema:
            type: string
            title: Message Id
        - name: force
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Force
      responses:
        '200':
          description: Cancel accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusAck'
              examples:
                graceful:
                  summary: Graceful cancel — settles at `cancelling` then `cancelled`
                  value:
                    id: msg_1a0ef0fa8e26
                    status: cancelling
                force:
                  summary: Force cancel — settles immediately
                  value:
                    id: msg_1a0ef0fa8e26
                    status: cancelled
      security:
        - bearerAuth: []
components:
  schemas:
    StatusAck:
      properties:
        id:
          type: string
          title: Id
        status:
          type: string
          title: Status
      type: object
      required:
        - id
        - status
      title: StatusAck
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Requires an API key. See the Authentication guide.

````