> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorcost.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Coding agents

> See what each developer spends in Claude Code, Cursor, GitHub Copilot and Bedrock, set a budget per developer, and refuse Claude Code at the TensorCost gateway.

**Spend › Developers** shows what each developer spends in Claude Code, Cursor, GitHub Copilot and Bedrock, counted once. A per-developer budget can hold that spend to a limit. How hard it is held depends on the tool, and the page says so for each one.

Admins can edit aliases on the page. Finance can read it. Members don't see it.

## What you connect

| Tool | What you connect | Where the spend comes from |
| - | - | - |
| Claude Code | An Anthropic connection with an admin key | Your Anthropic bill, split across developers by Claude Code's own usage report. Calls sent through the TensorCost gateway are counted to the developer directly. |
| Cursor | A Cursor Admin API key | Cursor's usage per developer |
| GitHub Copilot | A GitHub App installed on your organization | Copilot AI credit usage per seat |
| Bedrock (other callers) | Your AWS connection | Bedrock spend that isn't Claude Code through the gateway, by the IAM principal that made the call |

All of them are added in **Connect › Sources**; see [Connect your data](https://docs.tensorcost.com/connect/overview.md).

Claude Code's usage report only says how to divide the Anthropic bill. It is never added as spend of its own. If your Anthropic account also serves your own apps, that part of the bill stays off this page.

Every figure uses the same counting rule as the rest of Spend, so a call isn't counted twice. See [How TensorCost counts AI spend](https://docs.tensorcost.com/concepts.md).

## What the page shows

* One row per developer and one column per tool, with a total. The period switch is This month or Last month.
* Under each tool's name, how its spend is held: **Enforced at the gateway**, **Cap pushed** or **Tracked**. [Tracked and enforced](#tracked-and-enforced) explains each.
* A line for spend that isn't tied to a developer yet. It lists the raw names behind it, largest first, up to 50. Anything past the list, or a call with no name at all, is summed in a line under it.
* An **Aliases** list.

## Who a developer is

A developer is one lowercased email. Each tool names its callers differently, so TensorCost folds them to that email and a developer's spend adds up across tools. It looks, in this order, at:

1. The email the tool reports (Cursor, Claude Code's report and its OpenTelemetry metrics all carry one).
2. For Bedrock, an IAM role session name that is an email, then an `iamPrincipal/email` tag.
3. Your aliases.

An alias maps a name to a developer's email. There are four kinds:

| Kind | What it names |
| - | - |
| Email | A second address of the same person, such as a personal one, folded to their work address |
| GitHub login | A Copilot seat |
| IAM principal | A Bedrock caller's role or user |
| API key name | An Anthropic API key used by one developer |

Email and GitHub login values are matched without regard to case. IAM principals and API key names must match exactly.

TensorCost never guesses. A caller it can't resolve stays in the unattributed line. Each name there has a **Map** button for admins, which opens the alias form with the name filled in. A Cursor service account is shown as a service account and has no **Map** button, because it isn't a person.

## Spend per repository

The Developers page has no repository column. Repository comes only from Claude Code's OpenTelemetry metrics, and it is available through the API: `GET /v1/api/ai/spend/developers?by=repo` adds `by_repo` to each developer. The metrics only say how to divide the Claude Code cents the page already counts, so a developer's repositories add up to their Claude Code figure. A developer with no repository data gets one repository called `(none)`.

Cursor and Copilot spend has no repository detail.

## Budgets per developer

Create one in **Spend › Budgets**: **New budget**, then set **Who it applies to** to **Each developer**.

* **Tool** is All tools, Claude Code, Cursor, GitHub Copilot or Bedrock (other callers).
* **Limit per developer** is one amount, and everyone gets the same limit.
* **Period** is weekly, monthly, quarterly or annual.
* **Enforcement** is Notify only, Warns callers or Blocks at the limit, as on any budget. All tools and Bedrock can only notify.

Alerts name the developer and the tool, for example "[ana@acme.com](mailto:ana@acme.com) has spent 80% of Each developer (Cursor)". The budget's detail page lists the 50 developers furthest into the limit. Once created, a per-developer budget keeps its tool and period. You can change its limit, enforcement and alerts, and to change anything else you make a new budget. It can't have a parent budget.

What each tool does at the limit:

| Tool | Blocks at the limit | Warns callers |
| - | - | - |
| Claude Code | The gateway refuses the developer's next call | The gateway lets the call through with a warning |
| Cursor | A spend limit is pushed to that developer in Cursor | Tracked. Nothing is pushed. |
| GitHub Copilot | A budget that stops further use is pushed to that seat | Tracked. Nothing is pushed. |
| Bedrock, All tools | Not available. Notify only. | Not available |

### Cursor

Cursor accepts a per-user limit on Enterprise teams only. On another plan the budget shows **Cursor Enterprise needed** and stays tracked.

TensorCost records a developer's own Cursor limit before it sets one, and puts that limit back when the cap is removed. Limits are whole dollars, and a cap is rounded down so Cursor never allows more than the budget.

### GitHub Copilot

The GitHub App needs these organization permissions: **Administration** (read and write) and **GitHub Copilot Business** (read). Without Administration write, the budget shows **GitHub App can't set budgets** and the cap isn't pushed.

The cap is a user budget on AI credits that stops further usage, in whole dollars rounded down. TensorCost only changes or deletes budgets it made. If a seat already has its own AI credits budget for that user, TensorCost leaves it alone and reports an error for that seat.

### Whether a cap was pushed

The budget's detail page says how many seats hold the cap, for example "2 of 3 seats hold the cap", and why a seat doesn't. The tag reads **Cap pushed to Cursor** only when every seat has it, and otherwise **Tracked · cap not pushed yet**. The vendor enforces the cap, not TensorCost. If a push hasn't landed, the developer isn't held.

Disconnecting Cursor or Copilot first takes TensorCost's caps off. If they can't be taken off, the disconnect is refused with a message saying to remove the developer caps first.

## Claude Code through the gateway

A Claude Code budget with **Blocks at the limit** is enforced only for calls that go through the TensorCost gateway. This is set up on **Connect › Claude Code**, which every workspace has, since Claude Code's calls are counted on every plan. Spend per developer and per-developer caps come with the Coding agents add-on. It needs Claude Code 2.1.285 or later.

**1. Name the gateway's key**

The gateway calls Anthropic with the key in your Anthropic connection. Name that key `tensorcost-gateway` in Anthropic, exactly, so Claude Code's usage report doesn't count the gateway as a developer. It must be a standard, model-calling key. An admin key alone gets a 503 from the gateway. Change it in **Connect › Sources**.

**2. Mint a token for each developer**

Enter a developer's email and select **Mint token**. The token is shown once. **Mint tokens for N members** makes one for every active member and downloads them once as a CSV with the columns `email` and `token`. The page doesn't keep them.

**3. Roll out the managed settings**

Put the snippet in Claude Code's managed settings file. Each developer sets `TENSORCOST_DEV_TOKEN` in their own environment to their token.

The snippet for an Anthropic connection looks like this. The console fills in your gateway address.

```json theme={null}
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.tensorcost.com/api/inference-proxy",
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "OTEL_METRICS_EXPORTER": "otlp",
    "OTEL_EXPORTER_OTLP_METRICS_PROTOCOL": "http/json",
    "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT": "https://api.tensorcost.com/api/inference-proxy/otlp/v1/metrics",
    "OTEL_METRICS_INCLUDE_REPOSITORY": "true",
    "OTEL_EXPORTER_OTLP_HEADERS": "x-api-key=<your developer token>"
  },
  "apiKeyHelper": "printenv TENSORCOST_DEV_TOKEN",
  "allowedProviders": ["customEndpoint"]
}
```

* `ANTHROPIC_BASE_URL` and `apiKeyHelper` send Claude Code's calls to the gateway with the developer's token. Identity is the token, so a token is minted for one email.
* `allowedProviders` keeps Claude Code on that endpoint.
* The `OTEL_` variables send Claude Code's metrics to TensorCost. Those metrics are where spend per repository comes from. Replace the placeholder in `OTEL_EXPORTER_OTLP_HEADERS` with the same developer token, in each developer's own settings or shell, not in a file you share.
* The **Bedrock** tab of the snippet sets `CLAUDE_CODE_USE_BEDROCK`, `ANTHROPIC_BEDROCK_BASE_URL` and `CLAUDE_CODE_SKIP_BEDROCK_AUTH` instead of `ANTHROPIC_BASE_URL`. Leave `AWS_BEARER_TOKEN_BEDROCK` unset, because Claude Code sends it in place of the token when it is set.

If your workspace runs in your own cloud, the address is your install's; see [Pointing the SDK and API at your install](https://docs.tensorcost.com/byoc/for-developers.md).

### What happens at the limit

When a developer's Claude Code spend for the budget's period reaches the limit:

* **Blocks at the limit.** The gateway answers with HTTP 429 in Anthropic's error format, with `x-should-retry: false`. Claude Code reads that header and doesn't retry. The message reads "TensorCost: you've reached your Claude Code budget (name, \$1,500/month). Ask Jo to raise it." Jo is the budget's owner, by name, and the text says "your TensorCost admin" when none is known.
* **Warns callers.** The call goes through with an `x-tensorcost-warning` header saying they are over the budget.

The gateway counts calls as they are recorded and reconciles that count with the Developers page every 10 minutes. So Claude Code spend that didn't go through the gateway is counted toward the limit too, but a developer whose Claude Code calls Anthropic directly is not refused, only tracked.

Separately, a developer token is held to 120 calls a minute, and the workspace to 6,000 across all tokens. Past that the gateway answers 429 with `retry-after`, and Claude Code waits and retries.

The gateway fails open. If TensorCost can't read the budgets or the counter, the call goes through. A token minted without an email is never refused by a budget. A budget whose period has ended isn't applied.

## Tracked and enforced

The words under each tool's name on the Developers page mean this:

| Label | Meaning |
| - | - |
| **Enforced at the gateway** | Claude Code. There is an active Claude Code budget that blocks at the limit, and developers' calls went through the gateway in the period. |
| **Cap pushed** | Cursor or GitHub Copilot. A per-developer budget that blocks at the limit has been pushed for every seat. The vendor does the refusing. |
| **Tracked** | Everything else. TensorCost counts the spend and can alert, and nothing stops a call. This is also what Bedrock always shows. |

A tracked tool still has spend, alerts and budgets. What it doesn't have is a refusal.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.