免费开始 →

API 参考

用量、支出与足迹

读取用量追踪记录、支出与节省报告、预算及其使用情况,以及估算的能耗与碳足迹。

完整的 API 参考

路由摘要和字段名称均以英文撰写,本页与文件中都是如此。

/api/v1/usage

GET /api/v1/usage

The workspace's usage traces, newest first (paginated)

认证
API 密钥
密钥作用域
usage:read
参数
limit · offset · cursor · since · model · agentId · status

/api/v1/report

GET /api/v1/report

The spend and savings report of the workspace

认证
API 密钥
密钥作用域
usage:read
参数
days · subscriptionCostUsd

/api/v1/budgets

GET /api/v1/budgets

The workspace's budgets and their use

认证
API 密钥
密钥作用域
budgets:read

/api/v1/greenops

GET /api/v1/greenops/footprint

The workspace's estimated energy and carbon footprint, over an API key

认证
API 密钥
密钥作用域
usage:read
参数
periodDays

GET /api/v1/greenops/energy

Energy per day and per strategy, and the workspace's energy budget

认证
API 密钥或已登录的会话
参数
workspaceId · days · feature

GET /api/v1/greenops/summary

GreenOps key figures (the dashboard's read)

认证
已登录的会话(控制台)
参数
workspaceId (必填) · periodDays

GET /api/v1/greenops/carbon

Estimated carbon totals and their monthly trend (the dashboard's read)

认证
已登录的会话(控制台)
参数
workspaceId (必填) · periodDays · months

GET /api/v1/greenops/provider-efficiency

Energy per 1,000 tokens, per provider and model (the dashboard's read)

认证
已登录的会话(控制台)
参数
workspaceId (必填) · periodDays

GET /api/v1/greenops/replay-savings

Energy saved by reusing answers (the dashboard's read)

认证
已登录的会话(控制台)
参数
workspaceId (必填) · periodDays

GET /api/v1/greenops/abatement

Avoided CO₂ with its traceability (the dashboard's read)

认证
已登录的会话(控制台)
参数
workspaceId (必填) · periodDays

GET /api/v1/greenops

已弃用 — Deprecated: use /api/v1/greenops/summary

认证
已登录的会话(控制台)
参数
workspaceId (必填) · periodDays