Ai Coding Spend Per Developer
ASecurityMeasure what an engineering org spends on AI coding tools (Claude Code, Cursor, GitHub Copilot, OpenAI Codex) per developer and per team, and whether adoption and spend are growing. Use this whenever someone asks how much AI coding assistants cost, what the cost per developer or per active developer is, who actually uses which tool, how many paid seats sit unused, which models people use, how seat pricing combines with usage-based overage or pooled credits, or how to report AI coding adoption...
- 5 stars
- 0 votes
- 0 copies
- 0 views
- Added December 1, 2026
Works with
Security analysis
100/100Pro scans all 3 files and shows the line behind each finding
npx -y skills add costory-io/finops-skills --skill ai-coding-spend-per-developer --agent claude-codeAre you the author of Ai Coding Spend Per Developer?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/costory-io-ai-coding-spend-per-developer)---
name: ai-coding-spend-per-developer
description: Measure what an engineering org spends on AI coding tools (Claude Code, Cursor, GitHub Copilot, OpenAI Codex) per developer and per team, and whether adoption and spend are growing. Use this whenever someone asks how much AI coding assistants cost, what the cost per developer or per active developer is, who actually uses which tool, how many paid seats sit unused, which models people use, how seat pricing combines with usage-based overage or pooled credits, or how to report AI coding adoption to leadership. Also use it when they paste Copilot seat lists, Cursor usage exports or Claude Code analytics and ask what it means, even if they never say "spend".
---
# AI coding spend per developer
Every AI coding tool bills differently: a seat, a seat with included usage, pooled credits, or pure pay-per-token. The invoices answer "how much in total", never "how much per active developer, per team, and is it growing". This skill pulls what each provider's admin API exposes, joins identities across tools, and reports at team level.
The framing is **adoption, not cost-cutting**. The useful questions are: who uses which tool, how much, with which models, how that trends per team, which seats are paid but idle, and what a working developer costs all-in. Heavy users are usually your champions and the people who teach the rest; treat them that way.
Everything here is read-only. The script only calls GET or read-style POST endpoints. Seat removals and spend limits are changes: present them, never run them.
| Tool | Billing model | What the API exposes | Money in the API? |
|------|---------------|----------------------|-------------------|
| Claude Code (Claude Console, API billing) | Pay per token | Per-user daily sessions, lines, commits, PRs, tokens per model | Yes, `estimated_cost` per model (provider-estimated) |
| Claude Code (Claude Team / Enterprise seats) | Seat; Enterprise adds usage at API rates | Team: dashboard only (no Admin API on the Team plan). Enterprise: Claude Enterprise Analytics API | Enterprise usage-based plans only |
| Cursor (Teams / Enterprise) | Seat with included usage, then on-demand | Members, daily active usage, per-event charges, billing items | Yes, `chargedCents` per event (measured) |
| GitHub Copilot (Business / Enterprise) | Seat that includes AI credits, pooled per org, then overage | Seats with `last_activity_at`, per-user engagement reports (with `ai_credits_used`), AI credit usage per org or per user | Yes: org net amount, and per-user gross credits via the `user` filter (REST) |
| OpenAI Codex | ChatGPT seat plus workspace credits, or API key at API rates | Codex Enterprise Analytics API (ChatGPT admin), OpenAI org Costs API for API keys | Credits, not dollars, on the ChatGPT side (verify) |
## 1. Set up
Ask for, or discover:
- **Which tools are in use and on which plan.** The plan decides which API exists. A Claude Team plan has no admin API; a Copilot Business org has seats and AI credits; Codex can be both a ChatGPT seat and an API key.
- **Keys**, as env vars only. Never paste them into the chat, never write them to files:
- `ANTHROPIC_ADMIN_KEY`: Admin API key (`sk-ant-admin01-...`) of the Claude Console org, created by an org admin.
- `CURSOR_ADMIN_KEY`: Cursor Admin API key, created by a team admin (Basic auth, key as username).
- `GITHUB_TOKEN` plus `--github-org`: an org owner token with `manage_billing:copilot` or `read:org` for seats and metrics; the billing usage endpoints need org admin.
- **Team mapping**: a CSV the user maintains, `email,team[,github_login]`. HR or the IdP is the usual source. This is the only way to get to teams: none of the providers knows your org chart.
- **Seat prices actually paid**: list prices below are defaults; negotiated prices differ. Pass them with `--seat-price tool=USD`.
List prices, checked 2026-11-30 (confirm on the provider pages, all USD per user per month):
| Seat | Price | Included usage |
|------|-------|----------------|
| GitHub Copilot Business / Enterprise | 19 / 39 | 1,900 / 3,900 AI credits per user per month (1 credit = $0.01), pooled across the org, reset monthly |
| Claude Team standard / premium | 20 / 100 annual, 25 / 125 monthly | Usage limits, not a dollar allowance |
| Claude Enterprise | 20 seat fee, annual, 20 seat minimum | "Seat price + usage at API rates" |
| Cursor Teams | 30+ | Included usage, then on-demand at API list price for third-party models |
| ChatGPT Business (includes Codex) | 20 annual, 25 monthly | Plan limits; extend with ChatGPT credits |
Run:
```bash
export CURSOR_ADMIN_KEY=... # set only the ones you have; others are skipped
python3 scripts/ai_coding_spend.py --teams teams.csv --github-org acme --days 30 \
--seat-price cursor=30 --extra-seats manual_seats.csv --copilot-per-user --out out/
```
- `--extra-seats` (`tool,email,monthly_usd[,last_active]`) covers seats no API exposes: Claude Team seats, ChatGPT Business seats used for Codex. Export the member list from the admin console.
- `--copilot-per-user` reads per-user Copilot AI credits from REST (`ai_credit/usage` with `user=<login>`, one call per seat holder and month) and allocates the org's net overage by each user's share of gross credits (computed estimate). `--copilot-ai-report` is the alternative: the per-user AI usage report downloaded from GitHub billing settings (columns include `date`, `model`, `username`, `quantity`, `net_amount`). With neither, Copilot overage is one org-level line.
- Output: `ai_coding_rows.csv` (`date, tool, person, team, metric, value, usd, basis, detail`) and `ai_coding_summary.csv` (per team: active devs, seats, seats unused 30d, seat cost, usage cost, total, cost per active dev).
- The `basis` column labels every number: `measured` (billed or counted by the provider), `provider-estimated` (Claude Code `estimated_cost`), `computed-estimate` (Copilot overage allocated per user). Seat cost columns are computed estimates (seats x price x days / 30).
## 2. What each provider exposes
### Anthropic (Claude Code)
- `GET https://api.anthropic.com/v1/organizations/usage_report/claude_code?starting_at=YYYY-MM-DD`, headers `x-api-key`, `anthropic-version`. One UTC day per call, cursor pagination (`limit` up to 1000, `next_page`, `has_more`). Data appears within about an hour; no stated deletion period. Free to call.
- Per record: `actor` (`user_actor` with `email_address`, or `api_actor` with `api_key_name`), `terminal_type`, `customer_type`, `subscription_type`, `is_remote`, `core_metrics` (`num_sessions`, `lines_of_code.added/removed`, `commits_by_claude_code`, `pull_requests_by_claude_code`), `tool_actions` accept/reject counts, `model_breakdown[]` with tokens and `estimated_cost.amount` **in cents**.
- An actor can have several records per day (one per terminal type, remote flag, etc.). Sum them before counting anything per person.
- **The trap:** this API covers only usage authenticated against the Claude Console org (API billing). Anyone signed in with a Pro, Max, Team or Enterprise subscription is invisible here. Enterprise orgs use the **Claude Enterprise Analytics API** (`/v1/organizations/analytics/...`, Analytics API key with `read:analytics` created by the primary owner in claude.ai, data from 2026-01-01) for per-user Claude Code activity and, on usage-based Enterprise plans, cost. Per-user Claude Code cost: `GET /v1/organizations/analytics/cost?products[]=claude_code&group_by[]=actor&actor_types[]=user_actor` with the headers `anthropic-version` and `anthropic-beta: analytics-usage-cost-2026-08-24`; amounts are cents, decimal strings. The same call works on a Claude Console org with its Admin API key. The script does not call it yet. Team plan: no Admin API, analytics dashboard only.
- Claude Code used through Amazon Bedrock or Vertex shows up in that cloud's bill, not in these APIs.
- **Filling the blind spot with OpenTelemetry** (works on every plan, including Team, Pro/Max, Bedrock and Vertex): Claude Code exports OTel metrics when `CLAUDE_CODE_ENABLE_TELEMETRY=1` and an exporter is set (`OTEL_METRICS_EXPORTER=otlp` or `prometheus`, `OTEL_EXPORTER_OTLP_ENDPOINT`). Push it to everyone through the managed settings file (`env` block). Useful metrics: `claude_code.cost.usage` (USD, per API request, with `model`), `claude_code.token.usage`, `claude_code.session.count`, `claude_code.active_time.total`, `claude_code.commit.count`, `claude_code.pull_request.count`. Every datapoint carries `user.email` when signed in, `organization.id`, and any keys you set in `OTEL_RESOURCE_ATTRIBUTES` (set `team.id=payments` there and you get the team without a CSV join). You need a collector you already run (Prometheus, Grafana, Datadog, Honeycomb...). It only counts from the day you turn it on: no history. `cost.usage` is a client-side figure at API rates: on seat plans it measures usage value, not what you are billed (provider-estimated). Prompts stay `<REDACTED>` unless `OTEL_LOG_USER_PROMPTS` is set; leave it off.
### Cursor
- Base `https://api.cursor.com`, Basic auth with the key as username and an empty password.
- `GET /teams/members`: `teamMembers[]` with `email`, `role`, `isRemoved`. Count non-removed members as seats.
- `POST /teams/daily-usage-data` with `startDate`/`endDate` in epoch ms, **30-day max per call**. Without `page` and `pageSize` it returns only active users; with them, every member with `isActive` per day. Request-count fields are raw events, not billable units.
- `POST /teams/filtered-usage-events`: per event `timestamp` (epoch ms string), `userEmail`, `model`, `kind` (e.g. `Usage-based`, `Included in Business`, `Credit`), `isChargeable`, `chargedCents`, `tokenUsage`. Included usage comes as `isChargeable: false` with a non-zero `chargedCents` (the documented example: `Included in Business`, `chargedCents: 8`); usage paid from a credit grant has `kind: Credit` and `chargedCents: 0`. The script adds only `isChargeable` events to cost and keeps the rest as `included_usage_usd_not_added`, so included usage is not counted twice on top of the seat. `chargedCents` includes the Cursor Token Rate on third-party models. Summing `chargedCents` over all events matches `/teams/spend` `overallSpendCents`.
- `GET /v2/teams/billing-items`: one item per usage event, credit or adjustment, with product, usage type, amounts and cost, filterable by product, usage type, model and who it is billed to (60/min). Use it to reconcile credits and adjustments with the invoice; the script does not call it yet.
- `POST /teams/spend`: current billing cycle only, per member `spendCents` (on-demand only) and `overallSpendCents` (on-demand plus included). Use it to cross-check the event sum for the current cycle, not for history.
- Rate limits per team: 20/min for daily usage, 60/min for usage events.
### GitHub Copilot
- Since **June 1, 2026** Copilot is usage-based: the seat price stays, it now includes the same amount in AI credits, pooled across the org. Code completions and next edit suggestions are not metered. Beyond the pool, usage continues at published rates unless an admin disabled paid usage or a budget stops it. Premium requests are the legacy model; for months before June 2026 use `premium_request/usage` instead.
- Seats: `GET /orgs/{org}/copilot/billing/seats` (100 per page): `assignee.login`, `assignee.email` (usually null, only a public profile email), `plan_type`, `created_at`, `pending_cancellation_date`, `last_activity_at`, `last_activity_editor`. IDE activity reaches `last_activity_at` only if the user has IDE telemetry enabled, so "no activity" can mean "telemetry off". Confirm with the usage metrics report before reclaiming a seat.
- Seat totals: `GET /orgs/{org}/copilot/billing` returns `seat_breakdown` (`total`, `active_this_cycle`, `inactive_this_cycle`, `pending_invitation`...).
- Engagement: `GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest` (or `users-1-day?day=`) returns signed `download_links`; files hold per-user records (`user_login`, `day`, `user_initiated_interaction_count`, `used_agent`, `used_chat`, `totals_by_model_feature`...). Needs the "Copilot usage metrics" policy enabled. Daily reports available from 2025-10-10, up to 1 year back. The legacy `/orgs/{org}/copilot/metrics` API was closed on 2026-04-02.
- Money: `GET /organizations/{org}/settings/billing/ai_credit/usage?year=&month=` gives org totals by model (`grossAmount`, `discountAmount` for included credits, `netAmount` billed). 24 months of history. Organization admin, fine-grained token with Organization Administration read. The same endpoint takes `user`, `model`, `product` and `day` filters, so per-user gross credits come from REST with one call per user. The users-28-day metrics report also carries `ai_credits_used` per user. The AI usage report downloaded from the billing UI (31 days max) is the alternative.
- Pooled credits mean there is no per-user overage: a heavy user consumes the pool that light users leave untouched, so a per-user `netAmount` is not a meaningful bill. Report Copilot at team level: seats x seat price + the team's share of org net overage, allocated by the team's share of gross AI credit usage (computed estimate).
### OpenAI Codex
- **ChatGPT seats** (Business, Enterprise, Edu) include Codex. Usage beyond plan limits consumes ChatGPT workspace credits, whose price depends on the plan or agreement. The ChatGPT admin analytics dashboard and the Codex Enterprise Analytics API (key scoped `codex.enterprise.analytics.read`, reference at chatgpt.com admin API reference) report per-user threads, turns and credits (verify paths, fields and plan availability before automating; the script does not call it). For now, put ChatGPT seats in `--extra-seats` with the last active date from the admin console.
- **API key**: Codex CLI or IDE signed in with an API key is billed at API rates to the OpenAI platform org, outside the ChatGPT allowance. `GET /organization/costs` (admin key, daily buckets) can group by `api_key_id`, `user_id` or `project_id`, but cannot tell Codex calls from other API traffic. Attribute it by giving Codex its own project or one key per developer.
## 3. Identity join
- Key everything on work email, lowercased. Claude Code and Cursor return emails. Copilot returns GitHub logins; put them in the `github_login` column of the team CSV. Do not guess logins from names.
- On orgs with SAML SSO, the linked identity (`externalIdentities` in the GraphQL API) maps logins to IdP emails (verify for your setup). Personal GitHub accounts with a work seat are common: expect a few unmapped logins and list them.
- API-key actors (`apikey:...` in Claude Code, service accounts in Cursor) are not people. Report them as a separate "automation" line, not as developers.
- Anything unmapped goes to `(unmapped)`. If that line is more than a few percent of spend, fix the CSV before presenting.
## 4. Read the results
- **Cost per developer must combine seat and usage.** Seat cost alone understates heavy-usage tools; usage alone makes seat tools look free. All-in = seats x seat price + metered usage beyond what the seat includes. Never add included usage on top of the seat that pays for it.
- **Divide by active developers, not seats.** Cost per seat rewards over-provisioning. Cost per active developer (active = any activity in the window) is the number to trend. Show seats and unused seats next to it.
- **Unused seats:** no activity in 30 days (Copilot `last_activity_at`, Cursor no `isActive` day, manual last active). Exclude seats created in the last 30 days and people on leave. Watch for telemetry-off false positives on Copilot.
- **One person, several tools** is normal and often healthy during evaluation. Count a developer once in "active devs" for the team, and show per-tool overlap separately. Overlap that persists after an evaluation is a consolidation question, not waste by default.
- **Trend:** compare the same window month over month per team: active devs, cost per active dev, share of usage on premium models. Growth in active devs with flat cost per dev is adoption; flat devs with rising cost per dev is a model mix or agent usage shift worth understanding, not a problem by default.
- **Models:** the share of spend on the largest models is usually the biggest lever, and the right answer can be "yes, that is where the value is". Present it, let teams decide.
- **Heavy users** are champions: ask what they do, document it, and have them pair with low-adoption teams. A high spender with high output (commits, PRs, accepted edits) is the success case.
## 5. Report at team level, and say why
Do not rank individuals in anything shared beyond the person and their manager. Reasons to give the user: per-person spend tables read as surveillance and push people to stop using the tools (the opposite of the adoption goal); usage metrics are a poor proxy for output; and in many jurisdictions (EU works councils, GDPR) individual monitoring needs a legal basis and consultation. Teams under 5 active developers identify individuals: merge them before sharing. The per-person CSV stays with whoever runs the script, for fixing mappings and reclaiming idle seats.
```
# AI coding tools: <org>, <window>, <date>
## Summary
<2-3 sentences: total spend, active devs, cost per active dev and its trend, top 1-2 actions>
## Per team
| Team | Active devs | Seats | Unused 30d | Seat cost (computed) | Usage (measured / provider-estimated) | Total | Per active dev | Trend |
## Per tool
<billing model, seats vs active, model mix, what the API could not see>
## Actions
<reclaim or reassign idle seats, consolidation questions, champions to involve, mapping gaps to fix>
```
Rules for the numbers:
- Label each figure measured, provider-estimated, or computed estimate. Claude Code `estimated_cost` is provider-estimated, not an invoice. Seat cost prorated to the window is a computed estimate.
- Say which tools or plans could not be measured (Claude Team without OTel, ChatGPT credits, Copilot overage left at org level) instead of leaving them out silently.
- **Reconcile with the invoices before presenting.** For each tool, the per-team totals (seats + allocated usage + unmapped + automation) must add up to that tool's invoice for the same period. Show a small table: invoice, sum of teams, gap, reason (proration, mid-cycle seat changes, taxes, credits, usage the API cannot see). A CFO will check this first; an unexplained gap discredits the whole report.
- Seat reclaim "savings" are forecasts until the seat count on the invoice changes.
## When you cannot run it yourself
If you have no access to the user's environment, paste the complete, filled-in SQL or command in your answer so the user can run it as is, with their project, period and table names already substituted where known. Do not point the user to this skill's file paths (`sql/...`, `scripts/...`): they usually cannot see them. Then interpret the output they paste back with the rules above.
## Going further
This is a snapshot that drifts: people join and change teams, plans switch from premium requests to credits, a new model doubles cost per active developer in a month. Keeping it current means a daily pull from each provider and a maintained mapping from each tool's user (email, GitHub login) to a team. Seeing AI coding spend alongside LLM API, cloud and data spend, per team and over time, is the useful view; you can build it on these APIs plus your billing exports, and tools such as Costory (costory.io), whose team wrote this skill, do it as a product for Cursor, Claude (Claude Console and Claude Enterprise) and [GitHub Copilot](https://docs.costory.io/setup/billing/github-copilot).
Files in this skill
- SKILL.md
- references/sources.md
- scripts/ai_coding_spend.py
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.