Ryan KatayiSenior full-stack engineer
    All sessions

    Engineering notes — ExplainersUsing the new Vercel billing CLI in real projects

    How to use the new vercel billing commands to inspect invoices, usage and budgets from the CLI, and wire them into dashboards and CI for real projects.

    9 min

    #Vercel#Next.js#Infrastructure

    Vercel just added billing commands to the CLI, under a single vercel billing prefix. You can now inspect billing overview, invoices, usage, contracts and budgets from a terminal, with JSON output for scripts and agents. That’s enough to wire your Vercel spend into a Next.js/Supabase dashboard and add budget checks to CI.

    This post walks through how the new commands work, how to try them, and how I’d integrate them into a real client project to catch billing problems before they reach a credit card.

    What changed in the Vercel billing CLI?

    Vercel’s changelog describes the new capability like this:

    "You can now check your team’s billing overview, review and download invoices, and preview upcoming charges with the Vercel CLI. All billing commands, including usage, contracts, and budgets, are now grouped under vercel billing."

    Vercel changelog, 2026-11-19: Vercel Billing CLI is now available

    There are three important pieces:

    1. A billing overview command: vercel billing overview.
    2. Invoice and upcoming-charge commands grouped under vercel billing invoices.
    3. Existing usage, contract and budgets commands moved under the same prefix.

    Vercel also says that in Vercel CLI 65.17.0 and later, the billing overview includes configured invoice details such as the billing address, tax ID and purchase order. Upcoming invoice estimates require an active paid subscription. Free plans still get the overview and invoice history, subject to team billing permissions.

    If you’ve used the previous commands, Vercel says:

    "Existing usage, contract, and budget commands now also use the same prefix: vercel usage → vercel billing usage, vercel contract → vercel billing contract, vercel budgets → vercel billing budgets. The previous command names continue to work as aliases."

    Vercel changelog, 2026-11-19: Vercel Billing CLI is now available

    So you don’t have to change existing scripts immediately, but new automation should use the vercel billing prefix.

    How vercel billing overview works

    The overview call gives you the current state of your team’s billing in one shot. According to Vercel’s post, it includes:

    • Plan
    • Billing status
    • Billing cycle
    • Balance due
    • Overdue invoices
    • Configured invoice details (on CLI 65.17.0+), such as billing address, tax ID and purchase order

    You run it from a terminal once you have the CLI set up for your Vercel account:

    vercel billing overview

    For scripts and agents, Vercel says you can add --json to vercel billing overview for structured output:

    vercel billing overview --json

    Mechanically, this turns the output from a human‑oriented summary into a machine‑readable JSON object. That’s what you’d parse in a Node script or a CI job when you want to gate a deploy on current billing state.

    For a Next.js/Supabase project, this gives you a simple check you can run before production deploys. For example, a CI job can call vercel billing overview --json, look for a non‑zero balance due or an overdue flag in the parsed JSON, and fail the job if your policy is “no deploys while billing is in a bad state”. Vercel’s announcement doesn’t show the exact JSON schema, so you’d inspect it once and code against the fields you see.

    How to list invoices and upcoming charges from the CLI

    Invoices and estimates moved under one namespace. Vercel says:

    "Use vercel billing invoices to review invoices, download PDFs, and preview upcoming charges. For inspect and download, replace with a full invoice ID from the list output. Upcoming charges are estimates and may change until the end of the billing period."

    That tells us three things about how this works:

    1. vercel billing invoices has a list-style subcommand that returns invoice IDs.
    2. There are subcommands to inspect and download a specific invoice, given a full invoice ID.
    3. There is a way to preview upcoming charges, and those previews are explicitly described as estimates.

    Vercel also states that you can add --json to any vercel billing invoices subcommand, which is enough to plan automation.

    A basic pattern for working with invoice data as a developer looks like this:

    # List invoices in JSON
    vercel billing invoices --json > invoices.json
    
    # Later, given a specific invoice ID from that list, inspect or download it
    # (subcommand names come from `vercel billing invoices --help`)

    Once you have JSON on disk, you can:

    • Parse it in a Node/TypeScript script and push a subset of fields into Supabase.
    • Feed it to a Next.js route handler that returns filtered or aggregated invoice data to a dashboard.
    • Store just invoice metadata in Postgres and keep PDFs elsewhere.

    For a client dashboard, I’d usually import only the attributes people actually use, for example date, total amount, status and a link or ID, and then call the CLI on a schedule to refresh that data.

    If you care about upcoming estimates in a project, the same pattern applies. Call the upcoming‑charges subcommand under vercel billing invoices with --json, store the result, and label it clearly in your UI as an estimate, not a final bill.

    Getting usage, contracts and budgets in JSON

    The existing commands for usage, contracts and budgets are now namespaced under vercel billing:

    • vercel billing usage
    • vercel billing contract
    • vercel billing budgets

    Vercel says the old names continue to work as aliases, so vercel usage and friends still run. For new code I’d switch to the new names now, so you don’t carry historical command names in scripts.

    A simple pattern for usage and budgets, using the JSON hint from the invoices and overview sections, is:

    vercel billing usage --json
    vercel billing budgets --json

    Vercel’s announcement doesn’t document their JSON schema, only that existing functionality is now grouped under the new prefix. You’d confirm what each command returns in your own environment, then treat that structure as an informal contract in your scripts.

    For a Next.js/Supabase app, these two commands are the ones that make budget automation possible:

    • vercel billing usage --json is the raw feed of how much you’ve used so far in the billing period.
    • vercel billing budgets --json is the definition of what you meant to spend.

    You can compare them in code and act when usage approaches or exceeds a budget.

    If you’re already thinking in terms of internal tools, this pairs well with the kind of operational dashboards I’ve built for clients on Next.js, like the workflows described in the Fraq case study and Goodjuice / bevbase case study.

    Trying it once on a real project

    Before writing any scripts, I’d do a quick manual pass on a real project. Vercel suggests updating your CLI like this:

    vercel upgrade

    After that, run a few commands in the root of a project linked to a Vercel team with billing access:

    # Human‑readable overview
    vercel billing overview
    
    # Machine‑readable overview
    vercel billing overview --json
    
    # See what invoice commands are available
    vercel billing invoices --help

    Use the --json flag on one or two vercel billing invoices subcommands and on vercel billing usage / vercel billing budgets as well. Redirect each to a file and open them in your editor. This is where you decide which fields you trust and want to rely on.

    You’ll also learn how your billing permissions affect the output. Vercel says billing overview and invoice history are “subject to your team’s existing billing permissions”, so if you’re on a contractor account you may need the client to grant or adjust access.

    Wiring billing into a Next.js + Supabase dashboard

    Once the manual checks look good, you can start pulling billing JSON into your stack. I’ll describe one pattern I’d use, as an illustration.

    1. A scheduled job runs vercel billing overview --json and vercel billing invoices --json for a team.
    2. The job parses the JSON and pushes a few fields into Supabase tables via an authenticated HTTP endpoint.
    3. A Next.js app queries Supabase and renders a simple billing dashboard.

    In code, the ingest step might be a small Node script that runs on a schedule, for example from a GitHub Actions workflow or another scheduler.

    Illustration of a Node script that calls the CLI and posts to an API route:

    // scripts/push-vercel-billing.ts
    import { execSync } from "node:child_process";
    import fetch from "node-fetch";
    
    function run(command: string) {
      const out = execSync(command, { encoding: "utf8" });
      return JSON.parse(out);
    }
    
    async function main() {
      const overview = run("vercel billing overview --json");
      const invoices = run("vercel billing invoices --json");
    
      await fetch("<your-api-base>/api/billing/vercel", {
        method: "POST",
        headers: { "content-type": "application/json" },
        body: JSON.stringify({ overview, invoices }),
      });
    }
    
    main().catch((err) => {
      console.error(err);
      process.exit(1);
    });

    On the Next.js side, you’d implement /api/billing/vercel as a route handler that validates the payload and writes only the fields you want into Supabase. From there, it’s a standard dashboard problem: fetch from Supabase, show trends and alert markers.

    If you’ve built out Supabase‑backed admin panels before, this fits the same pattern as project metrics, like I describe in the Recall case study and Axlow case study.

    Adding budget guards to CI so deploys don’t surprise you

    The other useful integration point is CI. Since vercel billing commands now return JSON, you can turn spend checks into fast, deterministic gates.

    One pattern:

    1. A CI job calls vercel billing budgets --json and vercel billing usage --json.
    2. A small script compares the two, using whatever rule you care about.
    3. If the rule fails, the job exits non‑zero and the pipeline stops before calling vercel deploy.

    A minimal shell‑plus‑Node example, treating any usage over a given percentage of budget as a hard stop, might look like this in a GitHub Actions step or similar CI system. The exact JSON parsing depends on what those commands return in your account.

    Conceptually:

    # In CI, after checking out code and installing Node
    usage_json=$(vercel billing usage --json)
    budgets_json=$(vercel billing budgets --json)
    
    node scripts/check-vercel-budget.js "$usage_json" "$budgets_json"

    Then scripts/check-vercel-budget.js reads process.argv[2] and process.argv[3], parses them, and compares usage to budget. If the condition fails (for example, usage past 90% of budget), it calls process.exit(1) and the job fails. If not, CI continues to your deploy step.

    This doesn’t replace Vercel’s own budgeting and alerts. It gives you a second line of defense at the point where infrastructure and code meet, where you already have approvals and reviews.

    If you’re already using Vercel features like Blob TTL, which I wrote about in Vercel Blob TTL automatic deletion, this kind of CLI‑driven guardrail fits the same philosophy: express operational rules as code, checked automatically.

    When I wouldn’t automate this yet

    I wouldn’t build dashboards or CI checks on top of the new commands in a rush if:

    • You don’t have stable billing access. If your client won’t grant billing permissions, the CLI output may be incomplete or fail.
    • Your team doesn’t care about spend on that project. Internal tools on a shared Vercel account with trivial usage might not justify the extra code.
    • You need guarantees on the JSON schema. You shouldn’t treat individual field names as fixed until you’ve watched them across a couple of billing cycles.

    In those cases, using the CLI manually when you need a quick view of invoices or estimates is enough. Automation can wait until the need is clear.

    Billing data from the CLI is one more integration point between your infrastructure and your application. Once you can pull overview, invoices, usage and budgets as JSON, you can bring spend into the same workflows where you already manage deploys, permissions and incidents. If you want help wiring that into a Next.js/Supabase project, or adding budget checks to your deploy pipelines, I do this kind of work as part of my Next.js development services.

    Sources

    Now playingCudioGet in touch