Täglichen Verbrauch des Nutzers abrufen
curl --request GET \
--url https://api.devin.ai/v3/enterprise/consumption/daily/users/{user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devin.ai/v3/enterprise/consumption/daily/users/{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/enterprise/consumption/daily/users/{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/enterprise/consumption/daily/users/{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/enterprise/consumption/daily/users/{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/enterprise/consumption/daily/users/{user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/consumption/daily/users/{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 (Enterprise)
Täglichen Verbrauch des Nutzers abrufen
Gibt den täglichen ACU-Verbrauch eines einzelnen Enterprise-Nutzers nach Datum und Produkt zurück. Bei den meisten Unternehmen sind ACUs für Devin Review in den Ergebnissen nicht enthalten.
GET
/
v3
/
enterprise
/
consumption
/
daily
/
users
/
{user_id}
Täglichen Verbrauch des Nutzers abrufen
curl --request GET \
--url https://api.devin.ai/v3/enterprise/consumption/daily/users/{user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devin.ai/v3/enterprise/consumption/daily/users/{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/enterprise/consumption/daily/users/{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/enterprise/consumption/daily/users/{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/enterprise/consumption/daily/users/{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/enterprise/consumption/daily/users/{user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3/enterprise/consumption/daily/users/{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 Verbrauch-API steht nur Accounts im Enterprise-Plan zur Verfügung. Teams und Self-Serve-Organisationen erhalten eine
403-Antwort; einen accountspezifischen Toggle, den der Support aktivieren könnte, gibt es nicht.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.
Bei den meisten Unternehmen sind Devin-Review-ACUs in
total_acus und acus nicht enthalten, und
acus_by_product.review gibt null zurück. Devin ordnet die Nutzung von Devin Review Organisationen und
Unternehmen zu, nicht einzelnen Nutzern. Bei einigen wenigen Unternehmen, die noch das veraltete Devin-Review-Reporting pro Nutzer
verwenden, enthalten diese Felder die Devin-Review-ACUs des jeweiligen Nutzers. Verwenden Sie Get Daily
Verbrauch, um alle Devin-Review-ACUs
Ihres Unternehmens abzurufen.Berechtigungen
Erfordert einen Servicebenutzer oder ein persönliches Zugriffstoken mit der BerechtigungViewAccountConsumption auf Enterprise-Ebene.
