通过API访问计费使用量和成本数据

来源: Vercel News

原文

Vercel now supports programmatic access to billing usage and cost data through the API and CLI. The new /billing/charges endpoint returns data in the FOCUS v1.3 open-standard format, allowing teams to ingest cost data into FinOps tools without custom transformation logic.

The endpoint supports 1-day granularity with a maximum date range of one year. Responses are streamed as newline-delimited JSON (JSONL) to handle large datasets efficiently.

SDK usage

curl usage

CLI usage

For quick introspection, the vercel usage command displays billing usage for the current period or a custom date range. This includes credit-use and costs for each service.

View usage for the current billing period

View usage for a custom date range

Vantage has also released a native integration that connects Vercel teams to Vantage accounts. This automatically syncs usage and cost data alongside other tools, simplifying cost observability. Read the Vantage announcement blog for details.

Learn more in the API documentation and CLI reference.

Read more