# Connect Vercel

Costfluent reads your Vercel spend from the team's billing charges, which Vercel's API serves in the
FinOps FOCUS format, with an access token you create for it. One connection is one Vercel team, and
the cost of everything that team runs and buys.

## How Costfluent connects

You give Costfluent the token and the team ID. Costfluent stores the token encrypted and uses it on
`api.vercel.com` for two reads only, and never for a request that changes anything: the team, to
confirm the token reaches it, and the team's billing charges, a range of days at a time. The team ID
becomes the connection's identity, and the token is only ever used for that team.

Vercel offers no token that can only read billing. A token carries the whole role of the member who
created it, and the role that reads billing charges, **Billing**, also manages the team's billing
details and payment methods
([Access roles](https://vercel.com/docs/rbac/access-roles), read 2026-11-19).

:::caution
Create the token as a team member who exists for Costfluent alone and holds only the Billing role,
not as an owner or a developer. Its token then reaches nothing but billing and read-only projects,
and you can remove the member without touching anyone else's access.
:::

## Prerequisites

1. The Owner or Integration owner organization role in Costfluent.
2. A Vercel team on the Pro or Enterprise plan. Vercel offers the Billing role on those plans only.
3. A member of the team with the **Billing** role, or **Enterprise Viewer** on Enterprise. On Pro the
   Billing role is free and a team can have one such member. The Viewer roles cannot read billing.

## Connect

### Create the token in Vercel

<Stepper>

1. As an owner of the team, open the team's “Settings”, then “Members”, and invite a member for
   Costfluent with the “Billing” role, or “Enterprise Viewer” on Enterprise.
2. Signed in as that member, open “Account Settings” from the avatar, then “Tokens”.
3. Name the token for Costfluent, choose the team as its “Scope”, and choose an expiration.
4. Select “Create Token” and copy the token. Vercel shows it only once.
5. Copy the team ID from the team's “Settings”, under “General”. It starts with `team_`, such as
   `team_nllPyCtREAqxxdyFKbbMDlxd`; the team's slug in its address is not its ID.

</Stepper>

### Connect in Costfluent

<Stepper>

1. Open **Settings**, then **Integrations**, select **Vercel**, and open the **Connect** tab.
2. Select "Add access token", keep the suggested **Display name** or enter your own, paste the token
   into **Access token** and the team ID into **Team ID**.
3. Select "Test connection" to see each check, or "Connect" to save.

</Stepper>

Costfluent reads the team and a day of the team's billing charges before storing anything, so a
connection that saves can read your cost. A team your organization has already connected is
refused.

Each team is its own connection. To read several teams of a Vercel account, connect each with a
token scoped to it.

## Data and freshness

Connecting imports as far back as your plan's backfill reaches, and at most six months
([Manage connections](/connect/manage-connections#how-it-behaves)). Cost arrives by UTC day, in US
dollars, the day after it is incurred.

:::note
A day's cost can change until the team's billing cycle closes, and a Vercel billing cycle starts on
the team's own day of the month, not the 1st. Each sync therefore reads the running month and the
whole previous month again, so a day Vercel revises is replaced, not counted twice. Costfluent does
not read the invoice itself, which Vercel offers only as a PDF.
:::

Every charge line is kept with its sign, whatever its category: usage, purchases, and credits as
their own negative rows. A month's total in Costfluent is therefore the sum of
those rows, credits included. If Vercel refuses a range of days, that collection fails with
Vercel's answer and the days show no cost; Costfluent never records a refused day as zero.

## Reporting dimensions

- **Service** is the Vercel product the charge is for, such as `Serverless Function Execution` or
  `Edge Requests`, with its **Service category**, such as `Compute` or `Networking`.
- **SKU** is Vercel's SKU of the charge.
- **Resource** is the Vercel project, by its ID and name, of type `project`. A charge Vercel names
  no project for has no resource.
- **Region** is the Vercel region the usage ran in, such as `iad1`, where Vercel names one.
- **Sub-account** is the team, by its ID and name.
- Vercel's rows carry none of your own tags, only Vercel's own metadata, so Vercel rows carry no
  tags.
- The billing account is the team, and the billing period is the calendar month the charge starts
  in.

## Update or disconnect

### After connecting

The **Manage** tab lists the connection by its display name. Open the gear icon beside it to see
whether the billing charges are still readable, which workspaces the connection feeds, and which
months have been imported. **Run checks** runs the checks again on request.

### Rotating or removing access

To rotate the token, or before it expires, create a new token as the same member with the same team
as its scope, select **Update credentials** on the connection page, and paste it with the same team
ID; then delete the old token under “Tokens”. A token for another team is refused, because the
connection's history belongs to its team: connect that team as a new connection instead.

To retire the connection, remove it in Costfluent, delete its token, and remove the member you
created for Costfluent from the team. Removing it erases the cost it imported
([Remove a connection](/connect/manage-connections#remove-a-connection)).

## Troubleshooting

The check's messages say what Vercel answered:

- **A Vercel team ID starts with team_ and is followed by letters and digits.** The value is not a
  team ID, often the team's slug from its address. Copy the ID from the team's “Settings”, under
  “General”.
- **Vercel refused this token.** The token is wrong, has expired or was revoked. Create a new token
  scoped to the team, as described above, and paste it.
- **This token cannot read team … Create the token with this team as its scope.** The token's scope
  is another team, the team ID belongs to a team the token's member is not in, or Vercel does not
  know the token: Vercel answers a mistyped or deleted token this way too. Check the team ID, and
  create the token with this team as its scope.
- **Vercel refused the team's billing charges for this token … Create the token as a member of the
  team with the Billing role.** The token's member has a role that cannot read billing, such as a
  Viewer role. Give the member the Billing role, or Enterprise Viewer on Enterprise, and create the
  token again.
- **The supplied Vercel team ID does not match the one the token was validated against.** Shown when
  updating credentials: the team ID is another team's. Connect that team as a new connection.
- **Vercel could not be reached to verify these credentials.** Vercel did not answer, or answered
  with an error of its own. Select **Run checks** later; a connection saved meanwhile is checked
  again automatically.
- **A sync that ends with "Reconnect it with an access token scoped to the team and the team ID".**
  Vercel refused the stored token while collecting: it has expired, was revoked, or its member lost
  the Billing role. Create a new token and select **Update credentials**.

## From your assistant

With the [Costfluent MCP server](/developers/mcp) connected, your assistant answers these with `query_costs` and `list_anomalies`.

```text
Which Vercel regions such as iad1 ran the most Serverless Function Execution cost last month, per project?
```

```text
Which open cost anomalies sit on Vercel products such as Edge Requests, and which project contributed to each?
```
