Billing
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>"
}Exports usage data for a user. Descriptions of response fields can be found below:
- timestamp: The timestamp the billing usage entry was created
- sku: The product associated with the billing usage entry
- pricePerUnitUsd: The price per unit in USD
- unit: The number of units consumed
- amount: The total amount charged for the billing usage entry
- currency: The currency charged for the billing usage entry
- notes: Notes about the billing usage entry
- inferenceDetails.requestId: The request ID associated with the inference
- inferenceDetails.inferenceExecutionTime: Time taken for inference execution in milliseconds
- inferenceDetails.promptTokens: Number of tokens requested in the prompt. Only present for LLM usage.
- inferenceDetails.completionTokens: Number of tokens used in the completion. Only present for LLM usage.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
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
Was this page helpful?
⌘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>"
}