Fatturazione
Billing Usage API (Beta)
deprecated
SUNSET as of 2026-09-16: this endpoint no longer returns usage data and answers every request with a 410. Use GET /api/v1/billing/usage-history instead, which returns the same ledger entries with cursor pagination: replace page and limit with pageSize plus the nextCursor from each response, and startDate and endDate with startTimestamp and endTimestamp.
GET
/
billing
/
usage
/api/v1/billing/usage
curl --request GET \
--url https://api.venice.ai/api/v1/billing/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.venice.ai/api/v1/billing/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.venice.ai/api/v1/billing/usage', 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.venice.ai/api/v1/billing/usage",
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.venice.ai/api/v1/billing/usage"
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.venice.ai/api/v1/billing/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.venice.ai/api/v1/billing/usage")
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{
"error": "<string>"
}Esporta i dati di utilizzo di un utente. Di seguito le descrizioni dei campi della risposta:
- timestamp: Il timestamp di creazione della voce di utilizzo
- sku: Il prodotto associato alla voce di utilizzo
- pricePerUnitUsd: Il prezzo per unità in USD
- unit: Il numero di unità consumate
- amount: L’importo totale addebitato per la voce di utilizzo
- currency: La valuta addebitata per la voce di utilizzo
- notes: Note relative alla voce di utilizzo
- inferenceDetails.requestId: L’ID della richiesta associata all’inferenza
- inferenceDetails.inferenceExecutionTime: Tempo impiegato per l’esecuzione dell’inferenza in millisecondi
- inferenceDetails.promptTokens: Numero di token richiesti nel prompt. Presente solo per l’utilizzo di LLM.
- inferenceDetails.completionTokens: Numero di token usati nel completamento. Presente solo per l’utilizzo di LLM.
Autorizzazioni
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Risposta
410 - application/json
Sunset on 2026-09-16. The error message names GET /api/v1/billing/usage-history and the parameters to rename.
A description of the error
Questa pagina è stata utile?
⌘I
/api/v1/billing/usage
curl --request GET \
--url https://api.venice.ai/api/v1/billing/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.venice.ai/api/v1/billing/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.venice.ai/api/v1/billing/usage', 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.venice.ai/api/v1/billing/usage",
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.venice.ai/api/v1/billing/usage"
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.venice.ai/api/v1/billing/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.venice.ai/api/v1/billing/usage")
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{
"error": "<string>"
}