跳转到主要内容
GET
/
v2
/
enterprise
/
consumption
/
daily
每日消耗端点
curl --request GET \
  --url https://api.devin.ai/v2/enterprise/consumption/daily \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.devin.ai/v2/enterprise/consumption/daily"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.devin.ai/v2/enterprise/consumption/daily', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v2/enterprise/consumption/daily",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.devin.ai/v2/enterprise/consumption/daily"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.devin.ai/v2/enterprise/consumption/daily")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.devin.ai/v2/enterprise/consumption/daily")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "consumption_by_date": {},
  "consumption_by_org_id": {},
  "total_acus": 123,
  "consumption_by_user": {}
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
需要 Enterprise 管理员的个人 API key。 返回你所在 Enterprise 在当前计费周期内按日期和组织划分的每日 ACU 消耗数据。

时区行为

计费周期以 PST(太平洋标准时间)午夜 作为每天的边界时间,对应 08:00:00 UTC。要与 Devin 仪表板中显示的用量数据保持一致,你必须传入带有此时区偏移的时间戳。 例如,要查询从 2025 年 12 月 5 日到 2026 年 1 月 5 日这一计费周期的用量:
curl "https://api.devin.ai/v2/enterprise/consumption/daily?start_date=2025-12-05T08:00:00Z&end_date=2026-01-05T08:00:00Z" \
  -H "Authorization: Bearer YOUR_API_KEY"
如果你传入的日期没有带上 T08:00:00Z 后缀(例如 2025-12-05),API 将使用 UTC 当天的零点时间,这可能会导致与仪表盘上显示的用量总计略有差异。

按组织过滤

当按 org_ids 进行过滤时,结果中只会包含 Devin 会话的 ACU 使用量。由 Cascade 和 Terminal 消耗的 ACU 不会包含在内,因为这些产品的使用情况不与任何组织关联。

授权

Authorization
string
header
必填

仅供 Enterprise 管理员使用的个人 API Key(apk_user_*)

查询参数

start_date
string<date-time> | null
end_date
string<date-time> | null
start
string<date-time> | null
end
string<date-time> | null
org_ids
string[] | null

响应

成功响应

consumption_by_date
Consumption By Date · object
必填
consumption_by_org_id
Consumption By Org Id · object
必填
total_acus
number
必填
consumption_by_user
Consumption By User · object | null