文档

API 参考

发送消息

向智能体发送消息并获取其回复。

发送到已有任务。先用 POST /tasks 创建任务。如果智能体仍在工作,响应只包含目前的回复;其余部分通过 GET /tasks/{task_id}/messages/{id} 获取。

模型档位

model 为新任务设置档位:

  • standard:速度与能力的默认平衡
  • fast:更轻量模型上的更低延迟
  • max:能力最强的模型

未知值返回 422。档位在创建任务时固定,因此传入 task_id 时会被忽略。POST /tasks 不接受档位。

技能

skill 在你的消息上运行一个技能。传入列出技能中的 id 或 name;你的 content 作为输入。未知技能返回 404。传入 task_id 时忽略。

附加文件

file_ids 必须引用已在任务项目中完成上传的文件。无法读取的文件会被跳过:消息仍会发送,只是不带该附件。

OpenAPI

openapi: 3.1.0
info:
  title: BioAgent API — V1
  description: Public API for BioAgent, the biomedical AI agent platform.
  version: 0.1.0
servers:
  - url: https://bioagent.cloud/api/v1
    description: >-
      BioAgent public API base URL. Every endpoint on this page is served from
      this host.
security: []
paths:
  /experimental/tasks/{task_id}/messages:
    post:
      tags:
        - messages
      summary: Send a message
      description: Send a message to the agent and get its reply.
      operationId: send_message_experimental_tasks__task_id__messages_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMessageRequest'
            examples:
              string:
                summary: Plain text content
                value:
                  content: >-
                    Please re-check variant rs80357065 against the latest
                    ClinVar submission.
              with_file_ids:
                summary: Attach project files with typed content blocks
                value:
                  content:
                    - type: text
                      text: Compare this VCF against the baseline panel.
                  file_ids:
                    - file_014Cj9dpG90jsSrTLXhguYoq
              with_skill:
                summary: Run a Skill on this message
                value:
                  content: Summarize the findings for a clinical audience.
                  skill: literature-deep-review
      responses:
        '200':
          description: >-
            Message sent. Always includes `user_message`; includes
            `assistant_message` once the agent has replied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageResult'
              example:
                type: message_result
                user_message:
                  type: message
                  id: msg_a4f9b5cc30d8
                  task_id: tsk_017ilCeuDpMWTSH9Ah1syUGJ
                  role: user
                  platform: api
                assistant_message:
                  id: msg_1a0ef0fa8e26
                  type: message
                  task_id: tsk_017ilCeuDpMWTSH9Ah1syUGJ
                  created_at: '2026-08-12T21:21:08.735000Z'
                  role: assistant
                  status: completed
                  completed_at: '2026-08-12T21:31:37.204000Z'
                  content:
                    - type: text
                      text: >-
                        Loaded the genetic-variant-annotation skill. For these 3
                        BRCA1 variants I'll (1) query ClinVar's REST API
                        directly for each rsID to get current assertions, review
                        status, star ratings, and conditions, and (2)
                        cross-reference NCBI's ClinVar records for conflicting
                        submissions and literature PMIDs.
                    - type: tool_use
                      id: toolu_01RkjLRcNtbVHBBwWDDk7gmF
                      name: Skill
                      input:
                        action: load
                        name: genetic-variant-annotation
                    - type: tool_result
                      tool_use_id: toolu_01RkjLRcNtbVHBBwWDDk7gmF
                      content: >-
                        # Skill: genetic-variant-annotation

                        **Category**: genomics_genetics

                        **Description**: Annotate genomic variants in VCF files
                        with functional effects, clinical significance, and
                        pathogenicity predictions. … (truncated)
                    - type: text
                      text: >-
                        Here is the full structured report. Two deliverables are
                        saved: `report_Patient001_BRCA1_variants.md` and
                        `Patient001_BRCA1_variant_report.json`. All three
                        variants are confirmed pathogenic by ClinVar (3-star
                        review); PARP inhibitor eligibility applies for HBOC and
                        ovarian indications.
                  platform: api
                  input:
                    user_message_id: msg_a4f9b5cc30d8
                    file_ids: []
      security:
        - bearerAuth: []
components:
  schemas:
    SendMessageRequest:
      properties:
        content:
          anyOf:
            - type: string
            - items:
                additionalProperties: true
                type: object
              type: array
          title: Content
        file_ids:
          items:
            type: string
          type: array
          title: File Ids
        skill:
          anyOf:
            - type: string
            - type: 'null'
          title: Skill
          description: >-
            Skill to run, given as an id or name from `GET /skills`. Your
            `content` is the skill's input.
      additionalProperties: false
      type: object
      required:
        - content
      title: SendMessageRequest
      description: |-
        Body for `POST /tasks/{task_id}/messages`.

        `content` is a string or a list of content blocks. Task-level settings
        (title, model tier, plan/auto mode) belong to `POST /tasks`.
    SendMessageResult:
      properties:
        type:
          type: string
          const: message_result
          title: Type
          default: message_result
        task:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task
        user_message:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: User Message
        assistant_message:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Assistant Message
        raw:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Raw
      type: object
      title: SendMessageResult
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Requires an API key. See the Authentication guide.