跳到主要内容

Operations

turing-cli operations 用于查询 Turing Platform/Core 的用量、费用、token、模型和请求明细。

在智能体工作流中,可以配合 SkillHub 上的 Turing Operations skill 使用本页命令;如果还需要先读取账单、表格、PDF 或 PPT 材料,可搭配 Documents skill 调用 turing-cli documents convert。也可以按自己使用的智能体或 IDE 规范自行配置自有 skills。

查询模型可以理解为:

账号维度 (--type, 选 1 个) × 数据拆分 (--include, 可选多个) + 指标

Portal / CoWork(turing-claw, openclaw) 不是 --type,也不是查询过滤条件;它们是 by_tool 返回结果里的 bucket。比如“某个人的 Portal / CoWork(turing-claw, openclaw) 用量”应先用 --type username --value X 查这个人的总用量,再从 by_tool 里读取对应 bucket。API Key 的花费拆分则用 --include by_apikey(仅 person / client 维度)。

查询流程

大多数查询分两步:

operations search -> 找到准确的 type/value
operations dashboards -> 查询 summary 或 by_* 明细
turing-cli operations search [flags]

按关键字在用户、部门和 client 中模糊搜索。它只返回身份字段,不返回费用。

参数默认值说明
-q, --q QUERY模糊关键字;为空时列出当前权限可见的用户
--start DATE当月 1 号起始日期,格式 YYYY-MM-DD,按北京时间解释
--end DATE今天结束日期,格式 YYYY-MM-DD,包含当天
--limit N50分页大小,有效范围 1-500
--offset N0分页偏移
--include-adminfalse包含 admin 服务账号
-h, --help查看命令帮助

搜索维度:

维度说明
username用户名
email邮箱
realname姓名
employee_id工号
ldap_1 / ldap_2 / ldap_3部门层级
client应用 / client / 计费租户

示例:

turing-cli operations search -q zhang
turing-cli operations search -q 鸿鹄 --limit 100
turing-cli operations search --start 2026-05-01 --end 2026-05-27 -q san.zhang

has_usage_in_window 只有在人维度命中时才是真实探活。部门和 client 命中恒为 false,表示“未探活 / 未知”,不代表没有用量;请继续调用 dashboards 查询实际花费。

operations dashboards

turing-cli operations dashboards --type TYPE --value VALUE [flags]

type/value 精确查询用量、费用和明细拆分。默认只返回 summary;需要 by_* 明细时用 --include--all

参数必填默认值说明
--type TYPE账号维度;见下方 --type
--value VALUE条件必填resource value;精确值,大小写敏感;platform 不需要
--start DATE当月 1 号起始日期,格式 YYYY-MM-DD,按北京时间解释
--end DATE今天结束日期,格式 YYYY-MM-DD,包含当天
--include LIST数据拆分,逗号分隔;默认只返回 summary
--allfalse返回全部拆分,等价于 --include all
-h, --help查看命令帮助

账号维度 --type

--type 只表示“查谁”,每次只能选一个。有效值以 CLI 的 validResourceTypes 为准:

账号家族typevalue
personusername用户名,如 san.zhang
personemail邮箱
personrealname姓名
personemployee_id工号
orgldap_1 / ldap_2 / ldap_3部门名
clientclientclient 名称,如 co-patent
platformplatform不需要 --value;全平台所有 client 汇总

数据拆分 --include

--include 表示“怎么拆”,可以逗号分隔选择多个:

include说明兼容性
by_client按 client 拆分;platform 下是各 client 排名通用
by_day按北京时间日期拆分通用
by_user按用户拆分仅 org / client;person 本身就是 1 人,platform 不返回
by_apikey按 API Key 拆分;默认额度合并为 (default),自定义按名字(无名为 (unnamed)),只显示未删除的仅 person / client(须锁定单个主体);org / platform 不返回
by_service按模型或服务拆分通用
by_region按地区 / 环境拆分仅 client / platform
by_tool按工具入口拆分;Portal / CoWork(turing-claw, openclaw) / AI Coding 等在这里看通用
all返回全部拆分仍受上方兼容性约束

description / display_name 只在 client 维度或 by_client 行中出现。

指标

summary 始终返回这些指标;各拆分行按 API schema 返回对应字段:

指标含义
bill_usd花费,单位 USD (旧名 total / total_usd,兼容别名,2026-08-05 后移除)
request_count请求数
user_count去重活跃用户数;platform summary 为 null
tokenstoken 总量
input_tokens / output_tokensinput / output token

常用查询

个人总量,并按工具、模型和 client 拆分。Portal / CoWork(turing-claw, openclaw) 从 by_tool bucket 读取,不是单独的过滤条件:

turing-cli operations dashboards \
--type username \
--value san.zhang \
--include by_tool,by_service,by_client

client 总量,并按地区、模型和用户拆分:

turing-cli operations dashboards \
--type client \
--value co-patent \
--include by_region,by_service,by_user \
--start 2026-05-01 \
--end 2026-05-31

按 email 查个人:

turing-cli operations dashboards \
--type email \
--value san.zhang@tcl.com

部门维度:

turing-cli operations dashboards \
--type ldap_2 \
--value "AI 算法平台部" \
--start 2026-05-01 \
--end 2026-05-27

全平台总额 + 各产业排名:

turing-cli operations dashboards --type platform --include by_client

兼容矩阵

account --typeby_clientby_dayby_userby_serviceby_regionby_tool
person: username / email / realname / employee_id--
org: ldap_1 / ldap_2 / ldap_3-
client: client
platform: platform-

输出字段

字段含义
dimension.resource_type / dimension.resource_value本次查询的账号维度
summary.bill_usd总花费,单位 USD;费用以后端计费数据为准
summary.request_count请求数
summary.tokenstoken 总量
summary.input_tokens / summary.output_tokensinput / output token
summary.user_count去重活跃用户数;platform 为 null
by_apikey按 API Key 拆分(仅 person / client);每行 name(自定义 key 名 / (default) / (unnamed))+ bill_usd 等指标;只含未删除的 key
by_service按服务 / 模型拆分
by_region按地区 + 环境拆分
by_tool按工具 / 产品线拆分
by_tool_scopeby_tool 的标签来源范围;跨地区 client / platform 查询时需结合 unclassified 理解
unclassified未被工具桶覆盖的剩余流量

权限范围

角色可查范围
self任意已登录用户可查自己
CLIENT_ADMIN可查自己管理的 client
OPERATOR(图灵平台管理员)可查别人、部门维度、其它 client 和 platform

如果你是图灵平台管理员(OPERATOR),查询 platform 维度时即使不带 --include,也会默认返回额外的平台级拆分视角,不止总额;其它角色看不到这部分。

越权查询会返回 HTTP 403。每次调用都会在 stderr 输出 [trace] trace_xxx,stdout 保持纯 JSON。

排错

错误处理
HTTP 403API Key 权限不足
HTTP 404资源不存在;先用 operations search 找正确写法
HTTP 503后端短暂不可用;稍后重试并保留 trace
connection refused / timeout检查网络、代理配置或后端服务状态