Connect a source

Connect Anthropic (Claude API)

Paste an Admin API key of your Anthropic organization, and Costfluent imports its daily Claude API cost by workspace, line item and API key.

Costfluent reads your Claude API spend from Anthropic's cost report, through the Admin API, with an Admin API key you create for it. One connection is one Anthropic organization, and the cost of every workspace in it.

How Costfluent connects

Anthropic has no read-only key and no token exchange, so Costfluent stores the Admin API key encrypted and uses it for four reads only: which organization the key belongs to, the daily cost report, the daily usage report, which holds the token counts and the API keys and user accounts behind them, and the organization's list of API keys, of which Costfluent keeps each key's ID and name only. The organization becomes the connection's identity, and the key is only ever used for that organization.

An Admin API key cannot be scoped down: besides reading cost, it can manage the organization's members, workspaces and keys. Create one for Costfluent alone, so you can revoke it without touching anything else.

Prerequisites

  1. The Owner or Integration owner organization role in Costfluent.
  2. An Anthropic organization. Individual accounts have no Admin API.
  3. An Admin API key, which only an organization admin can create, in the Claude Console under Settings, then Admin keys. It starts with sk-ant-admin01-.

Connect

  1. Open Settings, then Integrations, select Anthropic, and open the Connect tab.
  2. Select "Add Admin key", keep the suggested Display name or enter your own, and paste the key into Admin API key.
  3. Select "Test connection" to see each check, or "Connect" to save.

Costfluent reads the key's organization and one day of the cost report before storing anything, so a connection that saves can read your cost. A key of an organization that is already connected is refused. If the cost report does not answer during that check, the connection is saved anyway and checked again automatically.

Data and freshness

Connecting imports as far back as your plan's backfill reaches, and at most six months (Manage connections), as long as Anthropic reports cost that far back. Cost arrives by UTC day, in US dollars, as Anthropic reports it.

Priority Tier usage is not in Anthropic's cost report, so it is not in Costfluent either.

Reporting dimensions

  • Account is the workspace. Cost outside any workspace appears under default.
  • Service is the model, such as claude-sonnet-4-5-20250929. Cost that belongs to no model, such as web search, appears under Anthropic.
  • SKU is Anthropic's line item, such as Claude Sonnet 4.5 Usage - Input Tokens. The same line item at another service tier, context window or inference geography is a separate charge.
  • Resource is the API key, by the name it has in the Claude Console, and Resource ID its ID, shown as name (id); Resource type is API key. Anthropic's cost report names no key, so a line item several keys used is split between them by each key's share of the line's own tokens, or of its web search requests, from the usage report, and the shares add up to the line. Usage in the Claude Console has no key, a line item the usage report cannot split stays whole without one, and a key deleted since is named by its ID, as is a key whose name holds an @, which is often a person's email address.
  • Tag ai:user is the ID of the user account behind requests signed in with a Claude account (OAuth), such as Claude Code; Anthropic names no user for requests made with an API key. Costfluent keeps the ID only, never a name or an email address.
  • Usage unit is Tokens for a token line item, counted from Anthropic's usage report for the same day, workspace, model, service tier, context window, inference geography and speed, and Requests for web search, summed over the day's matching usage. A token line item the usage report has no count for, or whose count another line item of the day would read too, carries no usage.
  • Cost imported before Costfluent read API keys shows no key and no user until that month is collected again.
  • The billing account is the organization ID, and the billing period is the calendar month.

Update or disconnect

After connecting

The Manage tab lists the connection by its display name, with its Organization ID. Open the gear icon beside it to see whether the cost report is 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 key, create a new Admin API key in the same organization, select Update credentials on the connection page, and paste it; then revoke the old key in the Claude Console. A key of another organization is refused, because the connection's history belongs to its organization: connect that organization as a new connection instead.

To retire the connection, remove it in Costfluent and revoke its key in the Claude Console. Removing it erases the cost it imported (Remove a connection).

Troubleshooting

  • Anthropic refused this key. The key is not an Admin API key, or it was revoked. Create an Admin API key under the organization's settings; an ordinary API key starts with sk-ant-api instead and cannot read cost.
  • Anthropic refused the cost report for this key. The key belongs to an organization whose cost it cannot read. Use an Admin API key of the organization whose spend you want to see.
  • This key belongs to another organization. Shown when updating credentials. Connect that organization as a new connection.