Tianji Analytics
Query any read-only data from the Tianji monitoring and analytics platform.
Configuration
Three values are required (provided via skill config):
| Variable | Description |
|---|
| INLINECODE0 | Tianji instance URL (e.g. https://tianji.example.com) |
| INLINECODE2 |
API key for authentication |
|
TIANJI_WORKSPACE_ID | Default workspace ID |
Making API Requests
All endpoints are under {TIANJI_BASE_URL}/open and require a Bearer token:
CODEBLOCK0
Only GET requests are allowed. All responses are JSON.
Service Domains
Find the exact endpoint and parameters in api-endpoints.md.
For full parameter schemas, consult openapi-readonly.json.
| Domain | Endpoints | Typical Questions |
|---|
| Website | 13 | Traffic stats, pageviews, geo distribution, Lighthouse scores |
| Monitor |
9 | Uptime status, recent check data, monitor events |
|
Survey | 8 | Survey responses, result stats, AI categories |
|
Telemetry | 7 | Custom event counts, telemetry pageviews, metrics |
|
Billing | 7 | Usage quotas, subscription tier, credit balance |
|
Feed | 6 | Feed channels, event streams, feed states |
|
Application | 5 | App store reviews, app info, event stats |
|
AI/AIGateway | 5 | Gateway logs, model pricing, quota alerts |
|
Worker | 3 | Worker list, worker details, revisions |
|
Page | 2 | Status pages |
|
Workspace | 2 | Members, service counts |
|
Global | 1 | Platform configuration |
|
AuditLog | 1 | Audit trail |
Workflow
- 1. Identify the service domain from the user's question
- Read api-endpoints.md to find the endpoint
- Construct the GET request with required path/query parameters
- Parse the JSON response and summarize for the user
Common Scenarios
Website traffic overview
CODEBLOCK1
Pick the target website ID, then:
CODEBLOCK2
Monitor health check
CODEBLOCK3
Pick the target monitor ID, then:
CODEBLOCK4
Survey results analysis
CODEBLOCK5
Pick the target survey ID, then:
CODEBLOCK6
Feed event inspection
CODEBLOCK7
Pick the channel ID, then:
CODEBLOCK8
Sensitive Data Handling
Some GET endpoints may return fields containing platform-stored secrets (e.g. modelApiKey,
customModelBaseUrl in AI Gateway responses). Additionally, endpoints like workspace members,
audit logs, and billing may contain PII or internal details.
Rules:
- - NEVER display
modelApiKey, apiKey, secret, token, password, or credential fields to the user - Redact or omit these fields when summarizing API responses
- When querying workspace members or audit logs, only surface non-sensitive metadata (names, roles, timestamps) unless the user explicitly requests full detail
Notes
- - Timestamps use milliseconds since epoch (e.g.
1704067200000 for 2024-01-01) - Pagination: some endpoints use
cursor parameter; check the response for INLINECODE15 - The
type parameter in website metrics accepts: url, language, referrer, title, browser, os, device, country, INLINECODE25
天机分析平台
从天机监控与分析平台查询任意只读数据。
配置
需要提供三个值(通过技能配置):
| 变量 | 描述 |
|---|
| TIANJIBASEURL | 天机实例URL(例如 https://tianji.example.com) |
| TIANJIAPIKEY |
用于认证的API密钥 |
| TIANJI
WORKSPACEID | 默认工作空间ID |
发起API请求
所有端点位于 {TIANJIBASEURL}/open 下,需要Bearer令牌:
bash
curl -H Authorization: Bearer {TIANJIAPIKEY} \
{TIANJIBASEURL}/open/workspace/{TIANJIWORKSPACEID}/website/all
仅允许GET请求。所有响应均为JSON格式。
服务领域
在 api-endpoints.md 中查找确切的端点和参数。
有关完整参数模式,请参阅 openapi-readonly.json。
| 领域 | 端点数量 | 典型问题 |
|---|
| 网站 | 13 | 流量统计、页面浏览量、地理分布、Lighthouse评分 |
| 监控 |
9 | 运行状态、最近检查数据、监控事件 |
|
调查 | 8 | 调查回复、结果统计、AI分类 |
|
遥测 | 7 | 自定义事件计数、遥测页面浏览量、指标 |
|
计费 | 7 | 使用配额、订阅等级、信用余额 |
|
动态 | 6 | 动态频道、事件流、动态状态 |
|
应用 | 5 | 应用商店评论、应用信息、事件统计 |
|
AI/AI网关 | 5 | 网关日志、模型定价、配额告警 |
|
工作节点 | 3 | 工作节点列表、工作节点详情、修订版本 |
|
页面 | 2 | 状态页面 |
|
工作空间 | 2 | 成员、服务计数 |
|
全局 | 1 | 平台配置 |
|
审计日志 | 1 | 审计追踪 |
工作流程
- 1. 从用户问题中识别服务领域
- 阅读 api-endpoints.md 查找端点
- 使用必需的路径/查询参数构建GET请求
- 解析JSON响应并为用户总结
常见场景
网站流量概览
GET /open/workspace/{workspaceId}/website/all
选择目标网站ID,然后:
GET /open/workspace/{workspaceId}/website/{websiteId}/stats?startAt={timestamp}&endAt={timestamp}
监控健康检查
GET /open/workspace/{workspaceId}/monitor/all
选择目标监控ID,然后:
GET /open/workspace/{workspaceId}/monitor/{monitorId}/get
GET /open/workspace/{workspaceId}/monitor/{monitorId}/status
调查结果分析
GET /open/workspace/{workspaceId}/survey/all
选择目标调查ID,然后:
GET /open/workspace/{workspaceId}/survey/{surveyId}/result/list?startAt={timestamp}&endAt={timestamp}&limit=50
GET /open/workspace/{workspaceId}/survey/{surveyId}/stats?startAt={timestamp}&endAt={timestamp}
动态事件检查
GET /open/workspace/{workspaceId}/feed/channels
选择频道ID,然后:
GET /open/workspace/{workspaceId}/feed/{channelId}/fetchEventsByCursor?limit=20
敏感数据处理
某些GET端点可能返回包含平台存储密钥的字段(例如AI网关响应中的 modelApiKey、customModelBaseUrl)。此外,工作空间成员、审计日志和计费等端点可能包含个人身份信息或内部细节。
规则:
- - 切勿向用户显示 modelApiKey、apiKey、secret、token、password 或 credential 字段
- 在总结API响应时编辑或省略这些字段
- 查询工作空间成员或审计日志时,除非用户明确请求完整详情,否则仅显示非敏感元数据(名称、角色、时间戳)
备注
- - 时间戳使用自纪元以来的毫秒数(例如 1704067200000 表示2024-01-01)
- 分页:某些端点使用 cursor 参数;检查响应中的 nextCursor
- 网站指标中的 type 参数接受:url、language、referrer、title、browser、os、device、country、event