FastGPTFastGPT
历史参考/历史 API 参数

应用接口(历史参数归档)

保留生成文档迁移前的应用日志与统计接口手写参数;当前契约请查看部署实例的 System OpenAPI。

本页保留手写参考的历史语境,部分字段、端点及模型名称属于旧版。当前任务请阅读当前集成指南,接口参数以部署实例的生成参考为准。

前置准备

  1. 准备 API Key:可直接使用团队级 API 密钥(账号 → API 密钥)
  2. 准备应用的 AppId

从应用详情 URL 获取 appId

日志接口

获取应用总体数据统计

curl --location --request GET 'https://cloud.fastgpt.cn/api/proApi/core/app/logs/getTotalData?appId=68c46a70d950e8850ae564ba' \
--header 'Authorization: Bearer apikey'
  {
      "code": 200,
      "statusText": "",
      "message": "",
      "data": {
          "totalUsers": 0,
          "totalChats": 0,
          "totalPoints": 0,
          "totalInputTokens": 0,
          "totalOutputTokens": 0
      }
  }

入参:

  • appId: 应用 ID

出参:

  • totalUsers: 累积使用用户数量
  • totalChats: 累积对话数量
  • totalPoints: 累积积分消耗
  • totalInputTokens: 累积输入 Token 数
  • totalOutputTokens: 累积输出 Token 数

获取应用图表数据

curl --location --request POST 'https://cloud.fastgpt.cn/api/proApi/core/app/logs/getChartData' \
--header 'Authorization: Bearer apikey' \
--header 'Content-Type: application/json' \
--data-raw '{
  "appId": "68c46a70d950e8850ae564ba",
  "dateStart": "2025-09-19T16:00:00.000Z",
  "dateEnd": "2025-09-27T15:59:59.999Z",
  "offset": 1,
  "source": [
      "test",
      "online",
      "share",
      "api",
      "cronJob",
      "wechat",
      "feishu",
      "official_account",
      "wecom",
      "mcp"
  ],
  "userTimespan": "day",
  "chatTimespan": "day",
  "appTimespan": "day"
}'
{
    "code": 200,
    "statusText": "",
    "message": "",
    "data": {
        "userData": [
            {
                "timestamp": 1758585600000,
                "summary": {
                    "userCount": 1,
                    "newUserCount": 0,
                    "retentionUserCount": 0,
                    "points": 1.1132600000000001,
                    "sourceCountMap": {
                        "test": 1,
                        "online": 0,
                        "share": 0,
                        "api": 0,
                        "cronJob": 0,
                        "wechat": 0,
                        "feishu": 0,
                        "official_account": 0,
                        "wecom": 0,
                        "mcp": 0
                  }
                }
            }
        ],
        "chatData": [
            {
                "timestamp": 1758585600000,
                "summary": {
                    "chatItemCount": 1,
                    "chatCount": 1,
                    "errorCount": 0,
                    "points": 1.1132600000000001,
                    "inputTokens": 120,
                    "outputTokens": 80
                }
            }
        ],
        "appData": [
            {
                "timestamp": 1758585600000,
                "summary": {
                    "goodFeedBackCount": 0,
                    "badFeedBackCount": 0,
                    "chatCount": 1,
                    "totalResponseTime": 22.31
                }
            }
        ]
    }
}

入参:

  • appId: 应用 ID
  • dateStart: 开始时间
  • dateEnd: 结束时间
  • source: 日志来源
  • offset: 用户留存偏移量,单位随 userTimespan 变化
  • userTimespan: 用户数据时间跨度 //day|week|month|quarter
  • chatTimespan: 对话数据时间跨度 //day|week|month|quarter
  • appTimespan: 应用数据时间跨度 //day|week|month|quarter

出参:

  • userData: 用户数据数组
    • timestamp: 时间戳
    • summary: 汇总数据对象
      • userCount: 活跃用户数量
      • newUserCount: 新用户数量
      • retentionUserCount: 留存用户数量
      • points: 总积分消耗
      • sourceCountMap: 各来源用户数量
  • chatData: 对话数据数组
    • timestamp: 时间戳
    • summary: 汇总数据对象
      • chatItemCount: 对话次数
      • chatCount: 会话次数
      • errorCount: 错误对话次数
      • points: 总积分消耗
      • inputTokens: 输入 Token 总数
      • outputTokens: 输出 Token 总数
  • appData: 应用数据数组
    • timestamp: 时间戳
    • summary: 汇总数据对象
      • goodFeedBackCount: 好评反馈数量
      • badFeedBackCount: 差评反馈数量
      • chatCount: 对话次数
      • totalResponseTime: 总响应时间
在 GitHub 上编辑

文件更新时间

本页导航

准备好开始了吗?

让你的企业知识真正被 AI 用起来