Skip to content

Cost and FinOpsGuide

Coding agent costs for teams: Claude Code, Codex and caps

Two ways to pay for coding agents, the mechanics that make an agent session expensive, and a working plan for measuring spend per developer, repository and project, then capping it before the provider call.

By INFRO Editorial

Published

9 min read

Dark ground with several glass terminal panes feeding thin amber streams into one central glass node that meters and caps them

In short

Claude Code cost and Codex cost come from one of two models: subscription seats with a usage allowance, or API keys billed per token by the provider. Anthropic reports an enterprise average of about $13 per developer per active day. Sessions grow because the whole conversation is resent each turn, so context size, cache hits, model choice and parallel subagents decide the bill; measure per developer with one key each and cap spend before the call.

Key takeaways

  • Teams pay for coding agents either through subscription seats with a usage allowance or through API keys billed per token; a gateway credential always moves traffic onto per-token billing.
  • Anthropic reports about $13 per developer per active day across enterprise deployments, and $150 to $250 per developer per month. Treat it as a planning starting point, then measure your own pilot.
  • Agent sessions resend the whole conversation on every request, so context size, cache hits, thinking effort, model choice and parallel subagents drive cost more than the number of prompts.
  • Give every developer and every automated agent its own key, tag requests with a workflow or repository header, and you can report spend per developer, repository and project without asking anyone.
  • Caps belong before the provider call: a refusal at the gateway is a message to the developer, while a cap enforced after the fact is an invoice line.

The short answer to "what does Claude Code cost" is that it depends on how you pay for it, and then on how long each session's context gets. Anthropic's own figure for enterprise deployments is about $13 per developer per active day, $150 to $250 per developer per month, with 90% of users staying under $30 per active day1. Codex follows the same pattern on OpenAI's side: included usage on a ChatGPT plan, or API-key usage billed at API rates2.

This guide covers the two ways teams pay, why an agent session costs what it does, how to measure spend per developer, repository and project, and where caps and default models belong.

The two ways teams pay for coding agents

Every coding agent bill falls into one of two shapes.

Subscription seatsAPI keys billed per token
Who bills youAnthropic (Claude Team, Enterprise) or OpenAI (ChatGPT plans)Your provider account: Anthropic Console, Bedrock, Vertex, Foundry, OpenAI API
What you pay forA seat with a usage allowanceEvery input, output, cache and thinking token
LimitsRolling usage windows per seatRate limits and spend limits you set
Per-person reportingThe vendor's admin analyticsWhatever you measure: provider workspaces, OpenTelemetry, a gateway
FitsInteractive work by peopleCI jobs, automation, heavy users you want to cap individually
Seats bound usage by allowance; API keys bound it only by the limits you configure.

On Claude for Teams and Enterprise, each member's Claude Code usage draws from a per-seat allowance that resets on a rolling five-hour window and a weekly window, shared with Claude chat1. On the Claude Console and on cloud providers, usage is billed per token to the organization, and if an organization mixes sign-in methods, each developer is metered by the one they authenticated with1.

OpenAI describes the same split for Codex. Signing in with a ChatGPT plan uses the plan's included usage, and OpenAI says the number of messages "depends on the model used, size and complexity of your tasks"2. API-key usage "follows API pricing", is recommended for automation in shared environments such as CI, and has no cloud-based features such as GitHub code review2.

Why does an agent session cost what it does?

A chat message is one request. An agent turn is many: each time the agent reads a file, runs a test or calls a tool, it sends another request carrying the results. Anthropic puts it directly: Claude Code "sends your full conversation with every request", so a one-line question in a session that has been open all day still draws usage for the whole conversation1. Five mechanics decide the size of that bill.

Context resend and caching

Because history is resent, input tokens dominate. Prompt caching makes the resent prefix much less expensive: on Anthropic's API a cache hit is billed at 0.1x the base input rate, and at 0.05x on Claude Opus 5.5 and Claude Sonnet 5.5, while a five-minute cache write costs 1.25x4. The catch is the cache lifetime. On an API key or cloud provider it is five minutes by default, so the first message after a coffee break misses the cache and reprocesses the full context1. The arithmetic is in our prompt caching break-even guide.

Model choice

Anthropic's own advice is that Sonnet handles most coding tasks and costs less than Opus, with Opus reserved for complex architectural decisions or multi-step reasoning; simple subagent tasks can run on Haiku1. OpenAI tells Codex users the same thing in its own words: if usage is higher than expected, consider whether a smaller model or tighter task scope would still produce a useful result2. Published list rates for the main coding models are compared in Coding models compared.

Thinking effort

Thinking tokens are billed as output tokens, and Anthropic notes the default budget can be tens of thousands of tokens per request depending on the model1. Lowering the effort level for routine work is one of the few levers that cuts output cost rather than input cost.

Parallel subagents and agent teams

Every subagent sends its own requests on top of the main conversation's1. Anthropic states that agent teams use approximately 7x more tokens than standard sessions when teammates run in plan mode, because each teammate maintains its own context window1. Parallelism buys wall-clock time with tokens.

Context you did not ask for

MCP servers, large instruction files and idle background work all add input. OpenAI notes that every MCP server adds more context to Codex messages2; Anthropic recommends keeping CLAUDE.md under 200 lines and moving workflow-specific instructions into skills that load on demand1. Scheduled tasks and goal check-ins fire while a session sits idle, sending the full context each time1.

How to measure spend per developer, repository and project

What you can see depends on how people sign in. Anthropic's table is the clearest map: Team and Enterprise plans have a spend report in org analytics; the Claude Console has a usage page, a Claude Code dashboard and an analytics API; on Bedrock, Vertex or Foundry, per-user numbers come from OpenTelemetry or an LLM gateway1. Claude Code's own /usage figure is computed locally at list price unless an administrator sets contracted rates in managed settings, and Anthropic calls it an estimate, not the invoice1.

For per-token billing, three rules produce useful numbers without anyone filling in a spreadsheet:

  1. One credential per developer, one per automated agent. Anthropic's gateway rollout steps say the same: issue each developer a gateway credential so usage is attributed and offboarding revokes one credential3. A shared key turns every question about spend into an argument.
  2. A tag per repository or workflow. Claude Code sends extra headers from ANTHROPIC_CUSTOM_HEADERS; Codex adds static headers from http_headers in config.toml5. Commit the setting with the repository, and every request carries its origin.
  3. A project per budget owner. Group keys into projects that match how money is actually approved: a team, a product line, a client engagement. Cost attribution covers the tagging model in more depth.

Then report on three numbers per developer: spend per active day, the share of input served from cache, and the share of spend on the most expensive model. The first finds outliers, the second finds sessions that are never cleared, and the third finds an Opus default nobody chose on purpose.

Set caps, alerts and default models

A cap that fires after the invoice is a report. A cap that refuses the next request is a control. The difference matters more for agents than for chat, because an agent in a loop can spend a day's budget in minutes; bounding agent loops covers step and time limits on the agent side.

  • Per-developer caps. On seats, the allowance is the default ceiling, and extra usage past it can be limited per organization, group or member1. On API keys, Anthropic workspaces take spend limits and a workspace rate limit, which Anthropic suggests using to cap Claude Code's share and protect other production workloads1.
  • Rate limits sized to the team. Anthropic publishes per-user tokens-per-minute recommendations that fall as teams grow, from 200k to 300k per user for 1 to 5 users down to 10k to 15k for 500 or more, because fewer users run Claude Code at the same moment in large organizations1.
  • Alerts before the cap. Alert at 50% and 80% of a monthly limit so the owner can raise it on purpose. Spend controls explains how hard caps and soft alerts fit together.
  • Default models by policy. Set the default model and effort in managed settings, and allow the expensive model only where someone asked for it. Anthropic notes that unexpectedly high API spend usually traces back to long sessions that were never cleared or to Opus left as the default1.

The API-key route through a gateway

Both agents can point at a different base URL. Claude Code reads ANTHROPIC_BASE_URL and sends any gateway that exposes a supported API format its requests3. Codex takes a custom provider in config.toml with base_url, env_key and wire_api, where responses is the only supported value5. Anthropic lists what a gateway gives an organization: provider keys stay server-side, usage is attributed by developer or team, budgets and rate limits are enforced in one place, and every request can be logged3. It also names the tradeoff: the gateway becomes infrastructure your organization operates, and it must forward what each new Claude Code release sends3.

Anthropic also states that it does not support routing Claude Code to non-Claude models through any gateway3. Use a gateway for credentials, attribution, caps and failover between Claude providers, not to swap the model under the agent.

INFRO serves both shapes: POST /v1/messages in Anthropic's Messages format and POST /v1/responses in OpenAI's Responses format, on your organization's own provider accounts. Give each developer an INFRO gateway key with a spend limit; requests that limit cannot cover are refused with 402 before the provider is called, and the request log shows estimated provider cost per key, project and workflow tag. On an Anthropic connection, or Claude on Vertex AI, the body Claude Code sends reaches the provider as written, including cache_control breakpoints and thinking blocks, so caching behaves as it does direct. Your provider bills you for the tokens; INFRO's subscription is separate and adds nothing to them. The configuration is from the Claude Code and Codex docs page:

Shell
# Claude Code: shell, or the env block of managed settings
export ANTHROPIC_BASE_URL="https://api.infro.io"
export ANTHROPIC_AUTH_TOKEN="sk_infro_..."
export ANTHROPIC_CUSTOM_HEADERS="X-INFRO-Workflow: claude-code"
toml
# Codex: ~/.codex/config.toml
model_provider = "infro"

[model_providers.infro]
name = "INFRO"
base_url = "https://api.infro.io/v1"
env_key = "INFRO_API_KEY"
wire_api = "responses"
http_headers = { "X-INFRO-Workflow" = "codex" }

For failover, give Claude Code's route Claude targets on more than one provider, such as Anthropic and Claude on Vertex AI; those are served as written. Model allowlists on the key keep a developer's default from drifting to a model nobody approved.

A rollout plan that keeps the numbers honest

  1. Pick five to ten developers who use the agent daily. Issue each a personal key with a modest monthly limit and a repository header.
  2. Run two weeks. Record spend per active day, cache share and model mix per person.
  3. Compare the pilot with Anthropic's published averages1. Investigate anyone well above them before you set team-wide limits: it is usually one long session or one default model.
  4. Set the team's limits from the pilot, with alerts below each cap, and decide per person whether seats or API keys fit.
  5. Review monthly. Models, cache rates and agent features change quickly, and so does the bill.

Questions readers ask

How much does Claude Code cost per developer?
Anthropic's own figure for enterprise deployments is about $13 per developer per active day and $150 to $250 per developer per month, with 90% of users under $30 per active day. Your number depends on model choice, codebase size and how many sessions run in parallel, so run a small pilot with per-developer keys before you budget for the whole team.
Should a team pay for coding agents with seats or with API keys?
It depends on how heavily each person uses the agent. Seats include a usage allowance with rolling windows and suit people who work interactively; API keys bill every token and suit automation, CI jobs and heavy users whose spend you want to see and cap per person. Many teams run both and route automated work through API keys.
Does routing Claude Code through a gateway change my bill?
A gateway credential replaces the developer's subscription login for those requests, so they are billed per token to whoever owns the provider credential behind the gateway. With a BYOK gateway that is your own Anthropic, Bedrock or Vertex account, at your own rates. The gateway's own fee is separate from the provider's token charges.
How do I see Claude Code spend per repository?
Send a header that names the repository or workflow on every request. Claude Code reads extra headers from ANTHROPIC_CUSTOM_HEADERS and Codex from http_headers in config.toml, so a per-repository settings file can tag traffic without developers doing anything; the gateway then groups spend by that tag.

From the team that builds it

Where this shows up in INFRO

INFRO is a control plane in front of the provider accounts you already hold. The capabilities below are the parts of it this article touches, each with the documentation that defines its behaviour.

  • Claude Code and Codex through INFRO

    Available with a plan

    Point Claude Code, the Claude Agent SDK, Codex or the OpenAI Agents SDK at INFRO by changing the base URL and the key. Anthropic's Messages API and OpenAI's Responses API, with routing, budgets refused before the call, guardrails and the request log applied as on every other request.

  • Budgets and spend ceilings

    Available with a plan

    A hard cap per organization, project, member, and key, with alerts at your own thresholds.

    Read the documentation for Budgets and spend ceilings
  • Usage and cost per request

    Available with a plan

    Every request records its model, latency, token or unit counts, and estimated provider cost, queryable by project and key.

    Read the documentation for Usage and cost per request
  • Spend attribution

    Available with a plan

    Group cost by model, project, key, or an end-user id you attach to the request.

    Read the documentation for Spend attribution
  • Request traces and payload logs

    Available with a plan

    Per-request timing detail, with prompt and completion logging off by default and a retention window you choose.

    Read the documentation for Request traces and payload logs
  • Model allowlists

    Available with a plan

    Approve which models a project may call; anything else returns a policy error instead of a line item.

    Read the documentation for Model allowlists
  • Health-aware routing

    Available with a plan

    Named routes use priority or weighted targets over your own connections, with health checks, retries and failover.

    Read the documentation for Health-aware routing

INFRO accounts are self-serve. Provider usage is billed to you by your providers; INFRO charges a software subscription and takes 0% of model spend. See plans.

Sources

Numbered in order of first citation. Each was opened and checked against the claim on the date shown.

  1. 1.Manage costs effectively (opens in a new tab) — Anthropic. Accessed Oct 19, 2026.
  2. 2.Codex pricing (opens in a new tab) — OpenAI. Accessed Oct 19, 2026.
  3. 3.Other LLM gateways (opens in a new tab) — Anthropic. Accessed Oct 19, 2026.
  4. 4.Pricing (opens in a new tab) — Anthropic. Accessed Oct 19, 2026.
  5. 5.Codex configuration reference (opens in a new tab) — OpenAI. Accessed Oct 19, 2026.

About this article

Written on 2026-10-19 from Anthropic's Claude Code documentation (costs, LLM gateway), Anthropic's API pricing page, OpenAI's Codex pricing and configuration reference pages, all read that day, and from INFRO's public documentation for its /v1/messages and /v1/responses endpoints. Spend figures are Anthropic's own published averages, quoted with their source. Numbers inside example blocks are illustrative.

Last checked against its sources on . The next review is due by . No separate named reviewer is recorded for this article.

How articles are written, sourced and corrected is set out in the editorial standards.