Facturation
API d'utilisation de facturation (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>"
}Exporte les données d’utilisation pour un utilisateur. Les descriptions des champs de la réponse sont fournies ci-dessous :
- timestamp : L’horodatage de création de l’entrée d’utilisation de facturation
- sku : Le produit associé à l’entrée d’utilisation de facturation
- pricePerUnitUsd : Le prix par unité en USD
- unit : Le nombre d’unités consommées
- amount : Le montant total facturé pour l’entrée d’utilisation de facturation
- currency : La devise facturée pour l’entrée d’utilisation de facturation
- notes : Notes concernant l’entrée d’utilisation de facturation
- inferenceDetails.requestId : L’ID de requête associé à l’inférence
- inferenceDetails.inferenceExecutionTime : Temps pris pour l’exécution de l’inférence en millisecondes
- inferenceDetails.promptTokens : Nombre de tokens demandés dans le prompt. Uniquement présent pour l’utilisation des LLM.
- inferenceDetails.completionTokens : Nombre de tokens utilisés dans la complétion. Uniquement présent pour l’utilisation des LLM.
Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Réponse
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
Cette page vous a-t-elle été 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>"
}