> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-docs-automation-github-pr-review.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取 AI 助手调用方统计

> 返回指定日期范围内按调用方类型（网页端、API 和其他）划分的助手查询次数明细。

<div id="usage">
  ## 使用方法
</div>

使用此端点查看助手查询在不同调用方类型之间的分布情况。响应将总查询次数细分为：

* **web**: 来自文档站点的查询
* **api**: 来自直接 API 调用的查询
* **other**: 来自其他来源的查询（例如集成、SDK）
* **total**: 所有查询类型的总和

<div id="filtering">
  ## 筛选
</div>

使用 `dateFrom` 和 `dateTo` 参数按日期范围筛选。


## OpenAPI

````yaml zh/analytics.openapi.json GET /v1/analytics/{projectId}/assistant/caller-stats
openapi: 3.1.0
info:
  title: Mintlify Analytics Export API
  version: 1.0.0
  description: 用于导出文档 Analytics 数据的 API
servers:
  - url: https://api.mintlify.com
    description: 生产环境
security: []
paths:
  /v1/analytics/{projectId}/assistant/caller-stats:
    get:
      tags:
        - Analytics
      summary: 获取 AI 助手调用方统计
      description: 返回指定日期范围内按调用方类型（网页端、API 和其他）划分的助手查询次数明细。
      parameters:
        - $ref: '#/components/parameters/projectId'
        - schema:
            type: string
            description: ISO 8601 或 YYYY-MM-DD 格式的日期
            example: '2024-01-01'
          required: false
          name: dateFrom
          in: query
        - schema:
            type: string
            description: >-
              ISO 8601 或 YYYY-MM-DD 格式的日期。`dateTo`
              为不包含在内的上限。结果将包含早于该日期的记录，但不包含该日期当天的记录。
            example: '2024-01-01'
          required: false
          name: dateTo
          in: query
      responses:
        '200':
          description: 按调用方类型划分的助手查询次数
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssistantCallerStatsResponse'
        '400':
          description: 无效的查询参数
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsErrorResponse'
        '500':
          description: 服务器错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsErrorResponse'
      security:
        - bearerAuth: []
components:
  parameters:
    projectId:
      schema:
        $ref: '#/components/schemas/projectId'
      required: true
      name: projectId
      in: path
  schemas:
    AssistantCallerStatsResponse:
      type: object
      properties:
        web:
          type: number
          description: 来自网页端（文档站点）的助手查询次数。
        api:
          type: number
          description: 来自 API 调用的助手查询次数。
        other:
          type: number
          description: 来自其他来源（例如集成、SDK）的助手查询次数。
        total:
          type: number
          description: 所有调用方类型的助手查询总数。
      required:
        - web
        - api
        - other
        - total
    AnalyticsErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: 描述错误原因的错误信息。
        details:
          type: array
          description: 关于该错误的其他详细信息。
          items:
            type: object
            properties:
              message:
                type: string
                description: 对某个特定校验或处理错误的说明。
            required:
              - message
      required:
        - error
    projectId:
      type: string
      description: >-
        你的项目 ID，可在控制台的 [API
        keys](https://dashboard.mintlify.com/settings/organization/api-keys)
        页面中复制。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authorization 请求头需要使用 Bearer Token。请使用管理员 API key（以 `mint_`
        开头）。这是仅供服务端使用的密钥。你可以在控制台的 [API keys
        页面](https://dashboard.mintlify.com/settings/organization/api-keys) 中生成。

````