Billing
Get billing usage summary
Returns billing usage data within the specified date range. Includes dedicated model serving, training, and model APIs usage. The date range must not exceed 31 days.
GET
/
v1
/
billing
/
usage_summary
cURL
curl --request GET \
--url https://api.baseten.co/v1/billing/usage_summary \
--header "Authorization: Bearer $BASETEN_API_KEY"import requests
import os
API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
url = "https://api.baseten.co/v1/billing/usage_summary"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.request(
"GET",
url,
headers=headers,
json={}
)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.baseten.co/v1/billing/usage_summary', 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.baseten.co/v1/billing/usage_summary",
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.baseten.co/v1/billing/usage_summary"
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.baseten.co/v1/billing/usage_summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baseten.co/v1/billing/usage_summary")
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{
"dedicated_usage": {
"subtotal": 123,
"credits_used": 123,
"total": 123,
"minutes": 123,
"breakdown": [
{
"billable_resource": {
"id": "<string>",
"is_deleted": true,
"name": "<string>",
"model_name": "<string>",
"instance_type": "<string>",
"environment_name": "<string>",
"chain_metadata": {
"chain_id": "<string>",
"chain_deployment_id": "<string>",
"chain_name": "<string>"
}
},
"subtotal": 123,
"compute_cost": 123,
"surcharge_cost": 123,
"minutes": 123,
"inference_requests": 123,
"daily": [
{
"date": "2023-12-25",
"subtotal": 123,
"compute_cost": 123,
"surcharge_cost": 123,
"minutes": 123,
"inference_requests": 123
}
]
}
]
},
"training_usage": {
"subtotal": 123,
"credits_used": 123,
"total": 123,
"minutes": 123,
"breakdown": [
{
"billable_resource": {
"id": "<string>",
"is_deleted": true,
"name": "<string>",
"model_name": "<string>",
"instance_type": "<string>",
"environment_name": "<string>",
"chain_metadata": {
"chain_id": "<string>",
"chain_deployment_id": "<string>",
"chain_name": "<string>"
}
},
"subtotal": 123,
"minutes": 123,
"daily": [
{
"date": "2023-12-25",
"subtotal": 123,
"minutes": 123
}
]
}
]
},
"model_apis_usage": {
"subtotal": 123,
"credits_used": 123,
"total": 123,
"breakdown": [
{
"model_name": "<string>",
"subtotal": 123,
"input_tokens": 123,
"output_tokens": 123,
"cached_input_tokens": 123,
"model_family": "<string>",
"daily": [
{
"date": "2023-12-25",
"subtotal": 123,
"input_tokens": 123,
"output_tokens": 123,
"cached_input_tokens": 123
}
]
}
]
}
}Authorizations
Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.
Query Parameters
Start date (ISO 8601, UTC). Earliest queryable: 2026-01-01.
End date in ISO 8601 format (UTC). Date range cannot exceed 31 days.
Response
200 - application/json
Billing usage summary for the requested date range.
Was this page helpful?
Previous
OverviewTruss authors model code and the Baseten CLI manages your workspace: what each is for, where they overlap, and how to use them together.
Next
⌘I
cURL
curl --request GET \
--url https://api.baseten.co/v1/billing/usage_summary \
--header "Authorization: Bearer $BASETEN_API_KEY"import requests
import os
API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
url = "https://api.baseten.co/v1/billing/usage_summary"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.request(
"GET",
url,
headers=headers,
json={}
)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.baseten.co/v1/billing/usage_summary', 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.baseten.co/v1/billing/usage_summary",
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.baseten.co/v1/billing/usage_summary"
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.baseten.co/v1/billing/usage_summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baseten.co/v1/billing/usage_summary")
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{
"dedicated_usage": {
"subtotal": 123,
"credits_used": 123,
"total": 123,
"minutes": 123,
"breakdown": [
{
"billable_resource": {
"id": "<string>",
"is_deleted": true,
"name": "<string>",
"model_name": "<string>",
"instance_type": "<string>",
"environment_name": "<string>",
"chain_metadata": {
"chain_id": "<string>",
"chain_deployment_id": "<string>",
"chain_name": "<string>"
}
},
"subtotal": 123,
"compute_cost": 123,
"surcharge_cost": 123,
"minutes": 123,
"inference_requests": 123,
"daily": [
{
"date": "2023-12-25",
"subtotal": 123,
"compute_cost": 123,
"surcharge_cost": 123,
"minutes": 123,
"inference_requests": 123
}
]
}
]
},
"training_usage": {
"subtotal": 123,
"credits_used": 123,
"total": 123,
"minutes": 123,
"breakdown": [
{
"billable_resource": {
"id": "<string>",
"is_deleted": true,
"name": "<string>",
"model_name": "<string>",
"instance_type": "<string>",
"environment_name": "<string>",
"chain_metadata": {
"chain_id": "<string>",
"chain_deployment_id": "<string>",
"chain_name": "<string>"
}
},
"subtotal": 123,
"minutes": 123,
"daily": [
{
"date": "2023-12-25",
"subtotal": 123,
"minutes": 123
}
]
}
]
},
"model_apis_usage": {
"subtotal": 123,
"credits_used": 123,
"total": 123,
"breakdown": [
{
"model_name": "<string>",
"subtotal": 123,
"input_tokens": 123,
"output_tokens": 123,
"cached_input_tokens": 123,
"model_family": "<string>",
"daily": [
{
"date": "2023-12-25",
"subtotal": 123,
"input_tokens": 123,
"output_tokens": 123,
"cached_input_tokens": 123
}
]
}
]
}
}