Skip to content
Dashboard

Access billing usage and cost data via API

, Mingchung Xia
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.billing.listBillingCharges({
from: "2025-01-01T00:00:00.000Z",
to: "2025-01-31T00:00:00.000Z",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
for await (const event of result) {
// Handle the event
console.log(event);
}
}
run();

curl -N --request GET \
--url 'https://api.vercel.com/v1/billing/charges?teamId=<team>' \
--header 'Authorization: Bearer <token>' \
--header 'Accept-Encoding: gzip' \
--compressed

vercel usage

vercel usage --from 2025-01-01 --to 2025-01-31