curl --request GET \
--url https://api.veryfront.com/accounts/{account_id}/usage/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.veryfront.com/accounts/{account_id}/usage/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.veryfront.com/accounts/{account_id}/usage/models', 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.veryfront.com/accounts/{account_id}/usage/models",
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.veryfront.com/accounts/{account_id}/usage/models"
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.veryfront.com/accounts/{account_id}/usage/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.veryfront.com/accounts/{account_id}/usage/models")
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{
"scope": {
"kind": "account",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"timeframe": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"granularity": "hour",
"bucket_count": 1,
"previous": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"granularity": "hour",
"bucket_count": 1
}
},
"summary": {
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"models_used": 1,
"funding": "managed",
"previous": {
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"models_used": 1,
"funding": "managed"
}
},
"models": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"model": "<string>",
"model_provider": "<string>",
"inference_provider": "<string>",
"funding": "managed",
"serving": [
{
"host": "<string>",
"region": "<string>"
}
]
}
],
"projects": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_name": "<string>",
"project_slug": "<string>",
"models": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"model": "<string>",
"model_provider": "<string>",
"inference_provider": "<string>",
"funding": "managed",
"serving": [
{
"host": "<string>",
"region": "<string>"
}
]
}
],
"funding": "managed"
}
],
"series": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"bucket_start": "2023-11-07T05:31:56Z",
"models": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"model": "<string>",
"model_provider": "<string>",
"inference_provider": "<string>",
"funding": "managed",
"serving": [
{
"host": "<string>",
"region": "<string>"
}
]
}
],
"funding": "managed",
"groups": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"dimensions": {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model": "<string>",
"model_provider": "<string>",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_kind": "api_key",
"member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"member_kind": "member"
},
"funding": "managed"
}
]
}
],
"attribution": {
"enabled": true,
"member_filtered": true
},
"group_by": [
"project"
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}Get account model usage
Read recorded model calls and tokens for an account. Requires account.billing.read.
curl --request GET \
--url https://api.veryfront.com/accounts/{account_id}/usage/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.veryfront.com/accounts/{account_id}/usage/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.veryfront.com/accounts/{account_id}/usage/models', 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.veryfront.com/accounts/{account_id}/usage/models",
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.veryfront.com/accounts/{account_id}/usage/models"
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.veryfront.com/accounts/{account_id}/usage/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.veryfront.com/accounts/{account_id}/usage/models")
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{
"scope": {
"kind": "account",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"timeframe": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"granularity": "hour",
"bucket_count": 1,
"previous": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"granularity": "hour",
"bucket_count": 1
}
},
"summary": {
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"models_used": 1,
"funding": "managed",
"previous": {
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"models_used": 1,
"funding": "managed"
}
},
"models": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"model": "<string>",
"model_provider": "<string>",
"inference_provider": "<string>",
"funding": "managed",
"serving": [
{
"host": "<string>",
"region": "<string>"
}
]
}
],
"projects": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_name": "<string>",
"project_slug": "<string>",
"models": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"model": "<string>",
"model_provider": "<string>",
"inference_provider": "<string>",
"funding": "managed",
"serving": [
{
"host": "<string>",
"region": "<string>"
}
]
}
],
"funding": "managed"
}
],
"series": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"bucket_start": "2023-11-07T05:31:56Z",
"models": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"model": "<string>",
"model_provider": "<string>",
"inference_provider": "<string>",
"funding": "managed",
"serving": [
{
"host": "<string>",
"region": "<string>"
}
]
}
],
"funding": "managed",
"groups": [
{
"capture": {
"complete_requests": 0,
"partial_requests": 0,
"missing_requests": 0,
"unknown_requests": 0
},
"requests": 0,
"input_tokens": 0,
"output_tokens": 0,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"dimensions": {
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model": "<string>",
"model_provider": "<string>",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_kind": "api_key",
"member_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"member_kind": "member"
},
"funding": "managed"
}
]
}
],
"attribution": {
"enabled": true,
"member_filtered": true
},
"group_by": [
"project"
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"cause": "schedule_concurrency_forbidden",
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}Authorizations
Use a JWT bearer token or a Veryfront API key in the Authorization header.
Path Parameters
Query Parameters
Whole local days, defaulting to 30d. Explicit from/to bounds take precedence over preset, including SDK-supplied defaults.
7d, 30d, 90d Inclusive start. Supply both from and to; these bounds take precedence over preset.
Exclusive end, no later than the end of today in timezone.
UTC hours, or local calendar days, Monday-based weeks and months.
hour, day, week, month Grouping dimensions supported by this operation. Repeat the parameter or use a comma-separated list.
4project, model, api_key, member Compare preceding calendar months for whole-month custom ranges, local days for whole-day ranges and presets, or equal elapsed duration otherwise.
previous_period Filter to calls with this recorded actor user ID.
Project UUID or slug within the selected account.
1 - 255Response
Recorded account model usage.
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
One row per model/vendor/inference-provider identity, ranked by calls.
Show child attributes
Show child attributes
Account usage by project and model; null project ID is unscoped usage. Empty for project reports.
Show child attributes
Show child attributes
Bucket totals and model breakdowns. Quiet buckets have zero totals and no model or grouping rows.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Requested series grouping dimensions; omitted for the default report.
project, model, api_key, member