Täglichen Verbrauch pro Service-Benutzer abrufen
curl --request GET \
--url https://api.devin.ai/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}"
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/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}', 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/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}",
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/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}"
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/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}")
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{
"total_acus": 123,
"consumption_by_date": [
{
"date": 123,
"acus": 123,
"acus_by_product": {
"devin": 123,
"cascade": 123,
"terminal": 123,
"review": 123,
"automation": 123
}
}
]
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}Verbrauch (Organisation)
Täglichen Verbrauch pro Service-Benutzer abrufen
Ruft den täglichen ACU-Verbrauch für einen bestimmten Service-Benutzer innerhalb der Organisation ab.
Nur in Enterprise-Tarifen verfügbar; bei anderen Tarifen wird 403 zurückgegeben.
Zeitzonenverhalten: Abrechnungszyklen verwenden Mitternacht PST (Pacific Standard Time) als Tagesgrenze; dies entspricht 08:00:00 UTC.
GET
/
v3
/
organizations
/
{org_id}
/
consumption
/
daily
/
service-users
/
{service_user_id}
Täglichen Verbrauch pro Service-Benutzer abrufen
curl --request GET \
--url https://api.devin.ai/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devin.ai/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}"
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/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}', 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/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}",
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/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}"
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/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/organizations/{org_id}/consumption/daily/service-users/{service_user_id}")
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{
"total_acus": 123,
"consumption_by_date": [
{
"date": 123,
"acus": 123,
"acus_by_product": {
"devin": 123,
"cascade": 123,
"terminal": 123,
"review": 123,
"automation": 123
}
}
]
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "about:blank",
"detail": "<string>",
"instance": "<string>",
"errors": [
{}
],
"error_code": "<string>"
}Die Verbrauchs-API steht nur Konten mit dem Enterprise-Plan zur Verfügung. Organisationen mit Teams- oder Self-Service-Plan
erhalten eine
403-Antwort.Aufschlüsselung nach Produkten
Jeder Datumseintrag in der Antwort enthält einacus_by_product-Objekt, das den gesamten ACU-Verbrauch nach Produktkomponenten aufschlüsselt: devin, automation, cascade, terminal und review (Devin Review). So sehen Sie für jeden Tag, wie sich der Verbrauch auf die einzelnen Produkte verteilt. Sind für devin, cascade oder terminal keine Daten auf Produktebene verfügbar, ist der Wert standardmäßig 0.0. automation und review sind null, wenn keine produktspezifischen Verbrauchsdaten vorliegen.
devin: Sitzungen, die von einer Person oder einem Service-Benutzer gestartet wurden, einschließlich Code-Scan- und Bereitschaftssitzungen.automation: Sitzungen und Code-Schritte, die von Automatisierungen ausgeführt werden. Bevor es dieses Feld gab, wurde dieser Verbrauch unterdevinerfasst.
Dieser Endpunkt berücksichtigt Devin-Review-ACUs nicht in
total_acus und acus, und
acus_by_product.review gibt null zurück. Devin rechnet die Nutzung durch Devin Review den Organisationen zu, nicht
einzelnen Nutzern oder Dienstbenutzern. Verwenden Sie Get Daily
Consumption, um die Devin-Review-ACUs
der Organisation abzurufen.Berechtigungen
Erfordert einen Dienstbenutzer oder ein persönliches Zugriffstoken mit der BerechtigungViewOrgConsumption auf Organisationsebene in einer Organisation mit dem Enterprise-Plan.
