跳转到主要内容
GET
/
v3beta1
/
enterprise
/
consumption
/
daily
获取每日用量
curl --request GET \
  --url https://api.devin.ai/v3beta1/enterprise/consumption/daily \
  --header 'Authorization: Bearer <token>'
{
  "consumption_by_date": [
    {
      "acus": 123,
      "date": 123
    }
  ],
  "total_acus": 123
}

权限

需要具备企业级别 ManageBilling 权限的服务用户。

时区行为

计费周期以 PST(太平洋标准时间)每天的午夜(零点) 作为日期边界,对应的时间为 08:00:00 UTC。要与 Devin 仪表盘中显示的用量数据保持一致,你需要传入与该时区偏移对齐的 Unix 时间戳。 例如,要查询从 2025 年 12 月 5 日到 2026 年 1 月 5 日这一计费周期的用量,需要先将 PST 午夜时间转换为 Unix 时间戳:
  • 2025 年 12 月 5 日 PST 午夜 = 2025-12-05T08:00:00Z = 1733385600
  • 2026 年 1 月 5 日 PST 午夜 = 2026-01-05T08:00:00Z = 1736064000
curl "https://api.devin.ai/v3beta1/enterprise/consumption/daily?time_after=1733385600&time_before=1736064000" \
  -H "Authorization: Bearer YOUR_API_KEY"
如果你传入的时间戳没有与太平洋时间(PST)午夜对齐,计算得到的用量总数可能会与仪表板中显示的数值略有差异。

授权

Authorization
string
header
必填

服务用户凭据(前缀:cog_)

查询参数

time_before
integer | null
time_after
integer | null

响应

成功响应

consumption_by_date
ConsumptionByDateResponse · object[]
必填
total_acus
number
必填